Setup for LAN-only games without bridging

Need help configuring your VPN? Just post here and you'll get that help.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
guillerolle
OpenVpn Newbie
Posts: 4
Joined: Sun May 07, 2017 1:31 pm

Setup for LAN-only games without bridging

Post by guillerolle » Tue Nov 05, 2019 2:12 am

Hello there. I've been using my 'tun' interface home OpenVPN server for connecting to my home network from the outside. The setup worked good enough for accessing my shares via the VPN and also allowing the clients to communicate with each other via IP (for games mainly).

The thing is the other day I wanted to play Need For Speed Underground 2 which only supports LAN lobby and couldn't connect computers via IP. The game didn't show up on the other computers so searching the internet I read that I needed to setup a 'tap' interface, but I don't want bridging my ethernet connection. I just want to access my lan shares, allow clients to communicate with each other, and now, LAN broadcasting for games.

After tweaking the configuration several times I could setup a 'tap' interface server and the match did show up in the lobby. However, it was unable to join. I tried several other games (like Age Of Empires) and the result was exactly the same.

I couldn't find any information and decided to test lowering the metric for the route '0.0.0.0 0.0.0.0 vpn_gateway' to make it lower than the real LAN metric. And it worked, the games now connect flawlessly. However, I have another problem now; it is that by lowering that metric, my computer seems confused about which gateway to use for other stuff (for example, surfing the internet). I don't want bridging to solve this. I want the clients to keep going online with their own networks.

Is this possible while making LAN games usable at the same time? It's been hard to find something good for this on the internet.

The server is a Debian machine. VPN ip: 10.8.0.1
The clients for these tests are a Windows 7 and a Windows 10 but I also use Linux clients. They are able to connect each other via ip, but not by lan broadcast.

Thanks for your help!

Server config:
server config file

;local a.b.c.d
port 1194
proto udp
#dev tun
dev tap

ca /etc/openvpn/easy-rsa/keys/ca.crt
cert /etc/openvpn/easy-rsa/keys/server.crt
key /etc/openvpn/easy-rsa/keys/server.key # this file should be kept secret

dh /etc/openvpn/easy-rsa/keys/dh2048.pem

topology subnet

mode server
tls-server

push "topology subnet"
ifconfig 10.8.0.1 255.255.255.0
ifconfig-pool 10.8.0.100 10.8.0.200 255.255.255.0
push "route-gateway 10.8.0.1"
#route-gateway 10.8.0.2
#ip-win32 dynamic
#dchp-option


#server-bridge
#server-bridge 10.8.0.1 255.255.255.0 10.8.0.100 10.8.0.200
#ifconfig 10.8.0.1 255.255.255.0
push "route 0.0.0.0 0.0.0.0 vpn_gateway 20"
#server 10.8.0.0 255.255.255.0
#ifconfig-pool 10.8.0.100 10.8.0.200
ifconfig-pool-persist ipp.txt

client-config-dir ccd
#push "dhcp-option WINS 10.8.0.1"
#push "dhcp-option NBT 2"
#push "dhcp-option DNS 10.8.0.1"

#route 10.8.0.0 255.255.255.0
#route 0.0.0.0 0.0.0.0 vpn_gateway 50

#route 0.0.0.0 255.255.255.0 10.8.0.1
#push "route 10.8.0.1"

#server-bridge 10.8.0.1 255.255.255.0 10.8.0.10 10.8.0.100

client-to-client

keepalive 10 120

#comp-lzo

persist-key
persist-tun

status openvpn-status.log

verb 3

management localhost 7505
script-security 3
#learn-address /var/lib/openvpn/learn-address.sh


sndbuf 393216
rcvbuf 393216

push "sndbuf 393216"
push "rcvbuf 393216"

tun-mtu 1400
mssfix 1360




Client config: (removed remote with public address). Both clients use the same config except for cert and key fields.
client config file

client

dev tap
#dev tun

proto udp

remote 192.168.0.11 1194

resolv-retry infinite

nobind

persist-key
persist-tun

ca "ca.crt"
cert "pcGui.crt"
key "pcGui.key"

#ip-win32 dynamic
#dhcp-option DNS 10.8.0.1

#dhcp-option WINS 10.8.0.1
#dhcp-option NBT 2

ns-cert-type server

#comp-lzo

verb 3

inkinse
OpenVpn Newbie
Posts: 2
Joined: Sat Jul 31, 2021 8:50 pm

Re: Setup for LAN-only games without bridging

Post by inkinse » Sat Jul 31, 2021 8:51 pm

I realize the original post is a few years old, but I ran into the same problem. I can make a VPN connection. AoE makes network requests to the other system, but the remote games don't show up. Did you resolve it?

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: Setup for LAN-only games without bridging

Post by TinCanTech » Sat Jul 31, 2021 9:55 pm

The problem is that games all do things differently, so there is no single answer.

Post Reply