LAN Gaming through a remote VPS with multiple clients

This forum is for general conversation and user-user networking.

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

Post Reply
Luvitrix
OpenVpn Newbie
Posts: 3
Joined: Sun Jun 16, 2019 3:16 pm

LAN Gaming through a remote VPS with multiple clients

Post by Luvitrix » Thu Apr 14, 2022 11:36 am

I am trying to get this to work:
Have an OpenVPN-Server running on an VPS. The VPS has no LAN that it is connected to, it just has an ethernet interface directly connected to the internet. Crappy illustration here:
Image
No I want multiple clients from different locations to connect to the VPS-OpenVPN-Server in order to have them all connected to player LAN Games.
No most of the tutorials explain that what I am looking for is bridging. But in my case there is no LAN on the VPS side that I could bridge. All I want is to connect Clients through the VPS.


So I read through dozens of articles online and yet did not manage to achive my goal. Yet this article describes more or less the same thing I am trying to do:
viewtopic.php?f=6&t=17898&p=48179&hilit ... vps#p48179
But by now I unfortunately did not manage to get it to work for me.

So here is my Server-Configuration:

Code: Select all

remote-cert-tls client

port 1194
proto udp4
dev tap

server 10.200.0.0 255.255.255.0

persist-key
persist-tun

keepalive 10 120

dh /etc/openvpn/dh.pem
ca /etc/openvpn/ca.crt
cert /etc/openvpn/openvpn_server.crt
key /etc/openvpn/openvpn_server.key

user nobody
group nogroup

cipher AES-256-GCM
auth SHA256
tls-crypt /etc/openvpn/ta.key

push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 208.67.222.222"
push "dhcp-option DNS 208.67.220.220"

verb 3
daemon

log /var/log/openvpn.log
status /var/log/openvpn/openvpn-status.log
ifconfig-pool-persist /var/log/openvpn/ipp.txt

Here is my Client-Config:

Code: Select all

client

dev tap

proto udp4

remote MyServersRemoteAddress 1194

resolv-retry infinite

nobind

persist-key
persist-tun

ca ca.crt
cert client_1.crt
key client_1.key

remote-cert-tls server

tls-crypt ta.key

cipher AES-256-GCM
auth SHA256

verb 3

Things that already work fine:
  • I can connect with two different PCs to the VPS' OpenVPN.
  • PC_1 is assigned to 10.200.0.2 and PC_2 is assigned to 10.200.0.3.
  • PC_1 and PC_2 can ping 10.200.0.1 without problems.
  • They can also ping each other without problems.
But If I launch a LAN Game with PC_1 then PC_2 cannot join and vice versa.
If I disconnect PC_1 and PC_2 from the VPS-OpenVPN (PC_1 and PC_2 are actually physically in the same room in the same LAN) then they can join each others games without problems.

Therefore I conclude that something is still not working properly with my VPN as joining the games works fine without the VPN.
(Of course the overall goal is to play with people that do not have their PC in the same room but for now that is my test-setup).

What could I do to investigate this further? I feel like there is no need for bridging here but I might be wrong. I appreciate any help!

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

Re: LAN Gaming through a remote VPS with multiple clients

Post by TinCanTech » Thu Apr 14, 2022 12:24 pm

Luvitrix wrote:
Thu Apr 14, 2022 11:36 am
What could I do to investigate this further?
Use a packet sniffer to see the difference between the two types of traffic.

Luvitrix
OpenVpn Newbie
Posts: 3
Joined: Sun Jun 16, 2019 3:16 pm

Re: LAN Gaming through a remote VPS with multiple clients

Post by Luvitrix » Fri Apr 15, 2022 11:29 am

Okay so I did several things now:

First I monitored the traffic with Wireshark. I saw that some packet were not sent when connected to the VPN or that they were send on the 192.168.X.X network instead of my VPN network. So I concluded, that my system had choosen to send the traffic not to the broadcast address of my VPN.

I changed the metric of the TAP Adapter with

Code: Select all

netsh int ip set int <name_of_your_openvpn_connection> metric=5
That way the metric for my VPN Route 10.200.0.0 was lower than any other route.

Then I had to change the type of my network from public to private by using the powershell:

Code: Select all

Set-NetConnectionProfile -InterfaceAlias 'OpenVPN TAP-Windows6' -NetworkCategory 'Public'
After that I can now successfully join Warcraft III LAN Games.

Before I was trying with Far Cry 2 which now allows me to see LAN games but I cannot join them (Ping 9999).
But I do see that hosts in far cry successfully transmit broadcast messages through the VPN. I have no clue why it is not working for far cry 2.
But since it works with Warcraft III I think it is some far cry 2 specific issue that keeps me from playing it via the VPN. Any ideas here where else I could look for?

Anyways, I am already really happy to see that Warcraft III works without problems. That really means, that bridging is NOT necessary for playing LAN Games if you just want to connect several clients with the use of one central VPS hosting OpenVPN.

Luvitrix
OpenVpn Newbie
Posts: 3
Joined: Sun Jun 16, 2019 3:16 pm

Re: LAN Gaming through a remote VPS with multiple clients

Post by Luvitrix » Fri Apr 15, 2022 11:42 am

In case anybody ever comes across the same issue/requirement here is a list of links that were helpful for me (from the very beginning till the working final result):

The main tutorial on how to setup the VPN with all the certificates and stuff (though it explains it for tun, most of it can be used for the tap-setup):
https://www.digitalocean.com/community/ ... u-18-04-de

The Easy-RSA-Stuff:
https://community.openvpn.net/openvpn/w ... nVPN-Howto

In general awesome tutorial:
https://ctaas.de/OpenVPN_Server_Ubuntu_howto.htm

Metric issue:
https://superuser.com/questions/335263/ ... games-work

parsajr
OpenVpn Newbie
Posts: 1
Joined: Sun Jan 12, 2025 2:00 pm

Re: LAN Gaming through a remote VPS with multiple clients

Post by parsajr » Sun Jan 12, 2025 7:07 pm

Hey, I just wanted to see if you found any solutions for that 'Far Cry 2' problem. I was expecting the same issue as yours. Some games are working, but some games, like FIFA 11, show a timeout error.
I tried everything, like manipulating the interface metrics value and...

Post Reply