Problem playing games using OpenVPN that use broadcast packets. Other games work, hosts can ping each other
I'm running an OpenVPN server in bridged mode and clients can successfully connect, see shared folder and play LAN games that let you enter the LAN IP address. However I'm unable to play games like Sacred Underworld I believe because it sends out broadcast packets. The game doesn't even show up in the list of games on the client machine.
I'm new to OpenVPN but I think this may be related to either of the following two issues:
I may need a route of some sort to allow the broadcast packets to be handled correctly (though am unsure how to set this up)
My VPN runs on a different subnet than my router. I.e. my home network is
192.168.1.xx
and my VPN uses something like10.0.0.xx
. Is it possible that I need to get my VPN to share the same subnet as my actual network (i.e.192.168.1.xx
)? If so how can I set this up?
Solution 1:
Regarding question 1:
LAN games using (UDP) broadcasts typically choose the network interface which uses the lowest metric for its broadcast route (i.e. ip 255.255.255.255
). Most probably your default network interface (e.g. your NIC) has the lowest metric so the games broadcast e.g. on your 192.168.1.0/24
LAN instead of the VPN. You can check your route table with route -vn
on Linux or route print
on Windows.
To get broadcasts on your VPN, do the following on all OpenVPN clients (not on the server):
Add a new broadcast route (255.255.255.255/32
) on your OpenVPN interface with a lower metric than the one your default network interface uses. If such a route already exists on your OpenVPN interface then just change the metric to be the lowest one.
In Windows the broadcast route already exists so you can just change the global interface metric like this:
netsh int ip set int <name_of_your_openvpn_connection> metric=5
This will prioritize the OpenVPN interface if a connection is established. If you seem to have trouble setting the metric, try disabling the Automatic Metric option for the interface.
In Linux you probably just need to add the corresponding route (add a metric if necessary):
route add -host 255.255.255.255/32 <your_openvpn_device>
This will get games like WarCraft III or Anno 1404 to broadcast to the VPN instead of to the local LAN (successfully tested with a Debian OpenVPN server and several Windows 7 clients).
Regarding question 2:
There are plenty of tutorials (also helper scripts) available on how to setup ethernet bridging in OpenVPN.
Note that you don't need any ethernet bridging at all if you just want to be able to play LAN games over OpenVPN. It is enough to use OpenVPN with tap devices, e.g. to also handle broadcasts or protocols like IPX which are needed for old games.