Bind to IP Address or Network Adapter

Discussion in 'General Discussion' started by SylenThunder, Oct 15, 2020.

  1. SylenThunder

    SylenThunder Captain

    Joined:
    Jul 30, 2016
    Messages:
    219
    Likes Received:
    138
    Ok, there has got to be some way to do this. Literally every other server I've ever run has the ability to bind to a specific IP or network adapter.

    Except Emprion for some reason. In most other games it's either an option in the management tool, a command line argument you can add for startup, or a setting in the config ini file. However for Empyrion, I am completely unable to find anything that works.

    Over the last week, our server has been "offline" twice because the stupid server client chose to bind to a different adapter than the one the ports are forwarded to. At first I thought it picked the adapter by "Alpha" name, and Windows had decided to re-order the default naming of the adapters. So I custom named them so they would be sorted properly, and the first adapter was the one Empyrion bound to.
    However yesterday it decided to just arbitrarily bind to a completely different adapter for no apparent reason. Restarting the machine had no effect, and my adapter "names" in Windows are still the same as when I fixed it last time this happened.

    So in order to properly host this, I need a way to force the server to use the right adapter. Just like every other dedicated game server has the ability to do. I imagine there has to be a way to do it, I just haven't found it. It's not documented anywhere I can find, and the attempt of using external software to force the client on an adapter failed completely.

    Or you know, Eleon could offer a Linux dedi. (It's not terribly difficult, and I could probably do it in a month or so if I had the time to dedicate to it.)
     
    #1
  2. SylenThunder

    SylenThunder Captain

    Joined:
    Jul 30, 2016
    Messages:
    219
    Likes Received:
    138
    Today it has happened again. Have to take 10 other servers offline to fix one that can't even manage itself.

    I'm starting to see why multiplayer server numbers for this game are so low. You can't reliably host one without dedicating an entire machine to just it.
     
    #2
  3. Kryjeck

    Kryjeck Ensign

    Joined:
    Nov 16, 2017
    Messages:
    2
    Likes Received:
    0
    I too need assistance like this.

    Have a Dedicated server and have 4 IPs to use, cannot connect to any of them when running the server (all IPs listed as cannot connect). I do have one game running on an IP already that I can connect to, and don't know if there is a conflict because Empyrion is trying to use the same IP, or any information on how to get it to connect.

    I've tried port forwarding, and forcing an IP and nothing has worked.
     
    #3
  4. Xango2000

    Xango2000 Captain

    Joined:
    Jun 15, 2016
    Messages:
    385
    Likes Received:
    202
    Isn't it possible to set up a software firewall on your server so that the server software can only connect using a certain adapter?
     
    #4
  5. JoJoWilko

    JoJoWilko Ensign

    Joined:
    May 16, 2018
    Messages:
    3
    Likes Received:
    2
    Are you talking about port forwarding to a machine to run a server? If so, I run 2 servers on 2 machines and have no issues with this - but it's important that the mac address for the network card is set to a reserved IP on your router (or domain controller). Then simply have ports 30000, 30004 forwarded to that IP address. Even with 2 network cards in the same machine, I'm not seeing this issue - the physical mac address means THAT card gets the IP address that the router forwards to, if this (for some reason) is changing then that's down to a configuration at router (domain controller) level, surely? Forgive me if I'm misunderstanding the problem.
     
    #5
  6. zaphodikus

    zaphodikus Captain

    Joined:
    Oct 1, 2016
    Messages:
    471
    Likes Received:
    227
    So basically you would love if EGS could execute in a runspace where it only sees one virtual NIC and thus binds to that nic.
    Would help if the underlying multiplayer library used was known to correlate with other games that will face the same issue.
     
    #6
  7. Khaleg

    Khaleg Commander

    Joined:
    Nov 5, 2020
    Messages:
    103
    Likes Received:
    117
    I would go with the solution that @JojoWilco said. Reserve an IP in base to the mac address of the interface, so the interface will have always the same IP, then, at router / firewall level, forward the incoming packets to the local IP, instead to the interface.

    The dedicated server should be linked to this fixed IP that the interface will have in base to its mac address.

    I do not know if you are able of this, if the network settings are under your control, but seems a valid solution.
     
    #7
  8. SylenThunder

    SylenThunder Captain

    Joined:
    Jul 30, 2016
    Messages:
    219
    Likes Received:
    138
    Already have static IP's configured. Each server is assigned to that adapters IP address in it's startup configuration. Except Empyrion, which has no such option that I have been able to discover. So instead of being bound to a specific IP like all the other servers we host, it just takes whichever one Windows gives it automatically when it starts.

    Here is an example of the startup for one of the Ark servers.
    E:\servers\ArkIsland\ShooterGame\Binaries\Win64\ShooterGameServer.exe TheIsland?listen?MultiHome=192.168.1.147?Port=30100?QueryPort=30104?MaxPlayers=30?AllowCrateSpawnsOnTopOfStructures=False -ForceAllowCaveFlyers -EnableIdlePlayerKick -clusterid=456988 -ClusterDirOverride="D:\ArkData" -NoTransferFromFiltering -UseBattlEye -servergamelog -ServerRCONOutputTribeLogs -usecache -nosteamclient -game -server -log

    Conan Exiles
    Command line: /Game/Maps/ConanSandbox/ConanSandbox -LANPLAY -MULTIHOME -MULTIHOME=192.168.1.146 -useallavailablecores -MaxPlayers=30


    Notice the section in green? That's where it's told which IP address to bind to. It will use only the adapter that has that IP address.


    In Linux we just bind the process to the adapter, so it doesn't matter if the client has an option or not. This used to be possible in Windows, but it was removed. Most game servers designed to run on Windows have this option though, as seen above. Somewhere either in the startup, or in the configuration files, is an option to set the IP address that the client will bind to.
    Except Empyrion.
     
    #8
    Last edited: Nov 17, 2020
    zaphodikus likes this.
  9. zaphodikus

    zaphodikus Captain

    Joined:
    Oct 1, 2016
    Messages:
    471
    Likes Received:
    227
    SylenThunder , yeah.
    I'm just boosting this thread, because most people here don't understand the concept of multiple instances of a server app side by side on one machine yet. Hope you get some joy soon. It's just a pity that virtualizing is not an option? Or is it?
     
    #9
  10. SylenThunder

    SylenThunder Captain

    Joined:
    Jul 30, 2016
    Messages:
    219
    Likes Received:
    138
    Technically, sure I could virtualize. In doing so I'm going to loose a lot of performance overhead on the server, will need multiple more licenses, and should about double the amount of RAM I have in the system compared to what is in it now to accomplish this successfully.
    Or I could dump a grand into Windows Server 2019, and pray it allows me to manage things better than Win 10 Pro does.

    The thing is though, there should be a way with Unity to bind it to a network adapter. I know this is possible in the dev kit, so it should also be possible in the client. If it's configured that way by the devs, and they share what the startup argument or config line needs to be for it.
    So as a result, I come to ask the developer if there is an option which hasn't been shared, that could be shared. Or for them to implement it if there is none.

    But it seems no one is serious about helping those of us who maintain dedicated servers.
    Which doesn't really surprise me that much given the lack of responses to my last thread, or the Alpha-not-Alpha release.
     
    #10
    zaphodikus likes this.
  11. zaphodikus

    zaphodikus Captain

    Joined:
    Oct 1, 2016
    Messages:
    471
    Likes Received:
    227
    Probably more a case of people being busy with other priorities. I am sure nitrado don't have 1 machine per server, or do they host on unix/linux - does it let you run dedicated on linux/. Because that would be a walk in the park if Docker-containers could do it and then run LSW and Docker on top of LSW . Can we host on linux?
     
    #11
  12. SylenThunder

    SylenThunder Captain

    Joined:
    Jul 30, 2016
    Messages:
    219
    Likes Received:
    138
    No, there is no Linux dedi support yet. They say it is planned, but the way they have been handling things lately, I'm not getting my hopes up. It would really open things up.
     
    #12
    zaphodikus likes this.
  13. Khaleg

    Khaleg Commander

    Joined:
    Nov 5, 2020
    Messages:
    103
    Likes Received:
    117
    Ok understood, it is not possible configure a specific listening IP for the dedicated server, sorry, it was so evident that this should be supported that I did not understood the problem well.

    So, just a crazy idea, that I do not know if would work. That if you write a script that...:

    1.- Checks in which IP and port the dedicated server is listening
    I think that you can use the command "netstat -b" for this, or the equivalent in PowerShell:
    "get-process -name <name dedicated server process>"
    store the process ID
    "get-nettcpconnection -ownprocess <process ID for Empyrion dedicated server>"
    store the IP and Port​
    2.- Add a proxy forwarding at operating system level, to redirect the traffic incoming to the configured fixed IP and port to the dynamic and arbitrary IP that the dedicated server uses
    With the information from point 1, you would add a proxy forwarding in Windows
    "netsh interface portproxy add v4tov4 listenport=<fixed known incomming port> listenaddress=<fixed known incomming IP> connectport=<port in which the dedicated server is really listening (this that you obtain in point 1)> connectaddress=<real IP in which the dedicated server is listening (this that you obtain in point 1)>"​

    * Of course, the mentioned commands must be executed without quotes and probably you will have to deal with firewall rules too, that it is possible too.

    Probably you need a script that, in dynamic way, removes and adds the proxy forwarding so this script should be executed after the dedicated server and each time that is launched.

    Now it is your time to investigate and experiment with this, unfortunately I have no dedicated server to test this by myself ;-)
     
    #13
  14. zaphodikus

    zaphodikus Captain

    Joined:
    Oct 1, 2016
    Messages:
    471
    Likes Received:
    227
    The trouble with the "port-tracking" approach of storing this info, is that it won't work in reality. The server may simply cycle it's resources and bind to another listening socket later - besides, if the engine decides a socket is not patent, it may kill and restart the listener after being idle, so unlikely to guarantee success.
     
    #14

Share This Page