How to set the network adapter for server multiplayer

Hi,

I am currently trying to run a packaged dedicated server on a Windows Server 2012 R2 machine that has multiple network adapters.

The server seems to pick the network adapter based on its metric, but I am trying to find a way to get to to use a specific network adapter using a config file or something similar.

Does anyone know if there is a way to do this?

Thanks

This would be really great to answer and document. This seems like basic requirements for a server. If I host in a cloud provider, it generally has multiple NICs and specific adapters that need to be bound to.

It looks like in IpNetDriver, it obtains “all bindable addresses” and just listens on all of them which is… not ideal to say the least.

The edit button is not working today on the Unreal Engine forums no matter what device I log into.

As I investigate into how unreal is resolving the adapters to bind to, I did notice a “MULTIHOME=” commandline argument it seems to check for. It looks like it dates back to OG Unreal. I think this may be it.

the Netdrivers calls ISocketSubsystem::GetLocalBindAddresses() which then grabs all the networkadapters, except if “MultihomeAddress” is found. It will only look if the commandline is present.

You specify MULTIHOME=x.x.x.x and it queries the SocketSubsystem for the platform you’re running on, ie Unix used BSD. But it has to be an IP that is visible to the local adapters, and once it matches, it will use only that adapter to bind. Unfortunate this isn’t documented more thoroughly.

1 Like

Thank you so much for this! I ran into this issue earlier in the year and has NO idea what to do. Haven’t tested this yet, but it sounds promising. Did you end up having luck with this or run into any other issues?

where do you specify that?
I’m guessing x.x.x.x would be the local address of the preferred network interface we’d want to use, right?

Command line when booting the server only I believe.

It’s used in a few places within the engine, one place for example is SocketSubsystem.cpp where it just does an FParse on the commandline looking for the MULTIHOME= prefix. It’s unfortunately not a config var or anything like that.

1 Like

thank you so much for your fast reply. I packaged the project so I could run it with command line arguments and I ran it from the cmd like this:
LyraGame.exe -MULTIHOME=172.27.224.133
where the IP is my machine’s IP on this VPN, I changed it to the IP of my colleague, both IPs that I can ping and we still don’t see each other . made sure the VPN is working fine, but still can’t seem to seen anyone on that interface.

This would be used not to specify their IP, but rather a local ip address if you had multiple NICs on a single computer. I’m unfamiliar with your VPN setup, but you may want to try the local ip of either the VPN “adapter” installed on your machine or simply omitting it entirely should work. If not, you may also likely have port blocking/firewall on the VPN so further diagnostics would be required with your IT department. The actual port on unreal engine needs to be exposed through the VPN, and you also need your firewall to allow connections on both sides for that specific port and possibly app

My VPN config is not standard so this may be the issue.
The specified IP is the local address of the VPN adapter, have checked all ports and communications with something like glasswire. I’m guessing it’s a VPN config issue, because with my VPN turned on and the local address “injected” as recommended, I can still see the game session on my LAN and not on my VPN. I was looking for a way to force UE to only use a certain adapter for debugging purposes, but it seems like the VPN config is the issue for now.
Thank you kindly for the assistance provided and for the good advice.

1 Like