Jump to content

VPN Tunneled for Docker Issue


Recommended Posts

So I recently set up an Oracle Free VPS+PiVPN to run as a proxy for some game servers (and for learning purposes) and I've got it semi-working!
I can see the dockers I've set to use the Wireguard custom network display the VPS IP, as well as the Palworld server being able to fully spin up. The only issue I have is I can't connect to the server. I'm not sure what I'm looking for or what I'm missing, so any help would be appreciated!

When I load up the game, it just spins and tells me it can't connect, but the server is running and everything. Any help would be appreciated! I'm not sure what files/logs I need to supply, but I'll gladly supply any and all that I can!
 

Link to comment

you need to route the traffic on the specified ports from the VPS to the vpn ip of the connected client.

Heres an example:

PreUp = iptables -t nat -A PREROUTING -i enp0s6 -p udp --dport 7777 -j DNAT --to-destination 10.123.0.2:7777
PostDown = iptables -t nat -D PREROUTING -i enp0s6 -p udp --dport 7777 -j DNAT --to-destination 10.123.0.2:7777
PreUp = iptables -t nat -A PREROUTING -i enp0s6 -p udp --dport 7778 -j DNAT --to-destination 10.123.0.2:7778
PostDown = iptables -t nat -D PREROUTING -i enp0s6 -p udp --dport 7778 -j DNAT --to-destination 10.123.0.2:7778
PreUp = iptables -t nat -A PREROUTING -i enp0s6 -p udp --dport 27015 -j DNAT --to-destination 10.123.0.2:27015
PostDown = iptables -t nat -D PREROUTING -i enp0s6 -p udp --dport 27015 -j DNAT --to-destination 10.123.0.2:27015

While you can nat all outgoing traffic, hitting the server with a request on 27015 on udp will give you no response because the VPS has nothing running that would answer on that port. Thats why you need to route all incoming traffic to the vpn client.


Just as a FYI on Oracle Cloud. For some reason and i honestly have no clue to why that is, if you try to use this method to connect 2 machines to 1 server under Ubuntu for example, it just breaks and will only forwards traffic to one and only one of the clients, no matter what ip you give as destination for that given port. Weird and odd bug. You can get that usecase working under Redhat/Oracle OS.

Edited by Mainfrezzer
  • Thanks 1
Link to comment
9 hours ago, Mainfrezzer said:

you need to route the traffic on the specified ports from the VPS to the vpn ip of the connected client.

Heres an example:

PreUp = iptables -t nat -A PREROUTING -i enp0s6 -p udp --dport 7777 -j DNAT --to-destination 10.123.0.2:7777
PostDown = iptables -t nat -D PREROUTING -i enp0s6 -p udp --dport 7777 -j DNAT --to-destination 10.123.0.2:7777
PreUp = iptables -t nat -A PREROUTING -i enp0s6 -p udp --dport 7778 -j DNAT --to-destination 10.123.0.2:7778
PostDown = iptables -t nat -D PREROUTING -i enp0s6 -p udp --dport 7778 -j DNAT --to-destination 10.123.0.2:7778
PreUp = iptables -t nat -A PREROUTING -i enp0s6 -p udp --dport 27015 -j DNAT --to-destination 10.123.0.2:27015
PostDown = iptables -t nat -D PREROUTING -i enp0s6 -p udp --dport 27015 -j DNAT --to-destination 10.123.0.2:27015

 

Now I gotta figure out how all this works lol. I do appreciate the tip, I'm sure I'll get it. This just seems a bit more complicated than the plug'n'play a buddy said it would be lol

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...