14

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?

1
  • 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
    Sep 14, 2011 at 0:58

2 Answers 2

15

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.

10
  • 1
    Awesome! 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
    Jul 11, 2014 at 0:57
  • 2
    The 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
    Jul 11, 2014 at 9:53
  • 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
    Sep 12, 2017 at 3:01
  • @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
    Sep 12, 2017 at 12:06
  • @speakr I tried all possible ways, including disabling automatic metric in all interfaces.
    – Alex G
    Sep 12, 2017 at 15:51
-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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .