Problem playing games using OpenVPN that use broadcast packets. Other games work, hosts can ping each other

12

11

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:

  1. 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)

  2. 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 like 10.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?

Coder

Posted 2011-09-14T00:37:55.617

Reputation: 445

Are you able to select which network interface is used in the game? It sounds like the game is defaulting to the wired interface, and instead you need it to use the VPN interface. – Zoredache – 2011-09-14T00:58:06.997

Answers

11

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.

speakr

Posted 2011-09-14T00:37:55.617

Reputation: 3 379

1Awesome! The first part of your answer solved all our problems. Although I did not understand what exactly I was doing. route print gave me a metric of 286 while your command changed it to 261. How does this concur with metric=5 ? – AmShaegar – 2014-07-11T00:57:22.420

2The metric is used to prioritze routes when similar route exist. I don't know exactly why Windows doesn't take the given value for the metric, but I noticed that using a low metric like metric=5 creates a route that has the lowest metric if other similar routes exist. Therefore the new route will be prioritized for UPD broadcasts. – speakr – 2014-07-11T09:53:32.510

netsh int ip set int MyTap metric=5 doesn't have any effect for Windows 7 32-bit. route print still shows the old metric 265 – Alex G – 2017-09-12T03:01:25.877

@AlexG Did you try setting lower values? I also added a link regarding the Automatic Metric option for network interfaces in Windows, maybe disabling that helps. Besides, I don't think you should already downvote my answer if we couldn't even discuss the problem you seem to have with Win7 x86. – speakr – 2017-09-12T12:06:11.260

@speakr I tried all possible ways, including disabling automatic metric in all interfaces. – Alex G – 2017-09-12T15:51:08.827

@AlexG Well.. I just set up a Win7 x86 VM, installed OpenVPN and tried to follow my instructions – and lowering the metric works perfectly. As soon as I started my OpenVPN connection, the interface got metric 276 compared to metric 266 of my default LAN interface. I ran the netsh command with metric=5 and now my OpenVPN interface has metric 261 while my default interface still has 266, so it will be prioritized now. I guess you should look into your setup again and probably remove your downvote as my answer obviously already helped people with this problem. ;) – speakr – 2017-09-13T15:39:37.277

@speakr: This solution doesn't work for my old game "Monopoly 3". I confirmed the TAP interface metrics went lower than the LAN interface, but it's still doesn't work. Could you help me with that? – Alex G – 2017-09-13T17:17:52.173

@AlexG Can you confirm that Monopoly 3 also uses UDP broadcasts? I think it's probably best to ask a separate question for this game, maybe even on https://gaming.stackexchange.com/.

– speakr – 2017-09-14T10:17:52.483

Does playing games which need network broadcasts require use of TAP devices? I ask this, because my TUN device in macOS doesn't seem to allow setting broadcast address. – xrisk – 2018-04-17T17:24:56.793

@Rishav Yes, you need TAP devices to propagate broadcasts. – speakr – 2018-04-17T21:14:09.560

-1

There are two metrics, the interface metric and the gateway metric. For IPv4, the real metric is the sum of both.

One or both may be configured as automatic. If you want an exact value, you must especify both.

You can do it with the mouse, configuring the advanced properties of the interface IPv4 protocol.

Antonio

Posted 2011-09-14T00:37:55.617

Reputation: 1