Jump to content

Hosting minecraft server through vpn?

slop_me

I host a minecraft server at home it runs on ubuntu 18. I'm trying to pass all the traffic through another server so I don't have to use my home ip with the minecraft server. I have a Vultr server to pass all the traffic through I can't find any documentation of someone else doing this online so I'm kinda dead in the water right now. If anyone has documentation that would be useful a link would be greatly appreciated thank you for taking the time to read.

Link to comment
Share on other sites

Link to post
Share on other sites

12 minutes ago, slop_me said:

I host a minecraft server at home it runs on ubuntu 18. I'm trying to pass all the traffic through another server so I don't have to use my home ip with the minecraft server. I have a Vultr server to pass all the traffic through I can't find any documentation of someone else doing this online so I'm kinda dead in the water right now. If anyone has documentation that would be useful a link would be greatly appreciated thank you for taking the time to read.

I think "Networking" would be a better place to post this

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, OddGreyFox211 said:

I think "Networking" would be a better place to post this

I shall post it there I don't see a way to move or delete this thread.

Link to comment
Share on other sites

Link to post
Share on other sites

17 minutes ago, slop_me said:

I host a minecraft server at home it runs on ubuntu 18. I'm trying to pass all the traffic through another server so I don't have to use my home ip with the minecraft server. I have a Vultr server to pass all the traffic through I can't find any documentation of someone else doing this online so I'm kinda dead in the water right now. If anyone has documentation that would be useful a link would be greatly appreciated thank you for taking the time to read.

and what you're looking for is port forwarding I belief. Mind you I have no clue about network stuff though

Link to comment
Share on other sites

Link to post
Share on other sites

why not just use a DNS service so your users type in a name?

Good luck, Have fun, Build PC, and have a last gen console for use once a year. I should answer most of the time between 9 to 3 PST

NightHawk 3.0: R7 5700x @, B550A vision D, H105, 2x32gb Oloy 3600, Sapphire RX 6700XT  Nitro+, Corsair RM750X, 500 gb 850 evo, 2tb rocket and 5tb Toshiba x300, 2x 6TB WD Black W10 all in a 750D airflow.
GF PC: (nighthawk 2.0): R7 2700x, B450m vision D, 4x8gb Geli 2933, Strix GTX970, CX650M RGB, Obsidian 350D

Skunkworks: R5 3500U, 16gb, 500gb Adata XPG 6000 lite, Vega 8. HP probook G455R G6 Ubuntu 20. LTS

Condor (MC server): 6600K, z170m plus, 16gb corsair vengeance LPX, samsung 750 evo, EVGA BR 450.

Spirt  (NAS) ASUS Z9PR-D12, 2x E5 2620V2, 8x4gb, 24 3tb HDD. F80 800gb cache, trueNAS, 2x12disk raid Z3 stripped

PSU Tier List      Motherboard Tier List     SSD Tier List     How to get PC parts cheap    HP probook 445R G6 review

 

"Stupidity is like trying to find a limit of a constant. You are never truly smart in something, just less stupid."

Camera Gear: X-S10, 16-80 F4, 60D, 24-105 F4, 50mm F1.4, Helios44-m, 2 Cos-11D lavs

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, GDRRiley said:

why not just use a DNS service so your users type in a name?

I do have a dns. I just still don't want the dns pointed at my home ip

Link to comment
Share on other sites

Link to post
Share on other sites

In theory this should work. Pritunl would allow everyone connected to the VPN to access the minecraft server via the IP assigned by the VPN.

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, Slottr said:

-Merged-

 

Please only post once

Thank you was trying to delete the other one :)

 

Link to comment
Share on other sites

Link to post
Share on other sites

Link to comment
Share on other sites

Link to post
Share on other sites

25 minutes ago, Windows7ge said:

Are you running into a particular problem or are you just not sure how to set it up?

I think it's more of setting it up I have connected my home minecraft server to the pritunl and opened up the ports required for the server on the vultr server but it just says connection refused so I'm not sure where to go from here

Link to comment
Share on other sites

Link to post
Share on other sites

Are trying to connect to the VPS via it's IP or are you joining the VPN hosted on the VPS? If you're just connecting directly to the VPS it doesn't know what to do with your incoming connection.

 

One option you can try doing and this may work is enabling Inter-Client Communication on the VPS:

 

1288660064_Screenshotfrom2020-05-2621-46-25.png.181ed5ada3ecbc4b389fbb4154f084a3.png

 

Also enable Allow Multiple Clients. Join the VPN then try connecting to the Minecraft server using the IP assigned by Pritunl.

 

I've not hosted a minecraft server in a long time. You may have to tell the server to broadcast on the VPN network and to listen for incoming connections if it doesn't broadcast on all available interfaces by default.

 

I have confidence this should work if your goal was just to access it from outside your house via it's IP and setting up a Static Route but this is definitely a little different. It should still be possible though.

Link to comment
Share on other sites

Link to post
Share on other sites

33 minutes ago, Windows7ge said:

Are trying to connect to the VPS via it's IP or are you joining the VPN hosted on the VPS? If you're just connecting directly to the VPS it doesn't know what to do with your incoming connection.

 

One option you can try doing and this may work is enabling Inter-Client Communication on the VPS:

 

1288660064_Screenshotfrom2020-05-2621-46-25.png.181ed5ada3ecbc4b389fbb4154f084a3.png

 

Also enable Allow Multiple Clients. Join the VPN then try connecting to the Minecraft server using the IP assigned by Pritunl.

 

I've not hosted a minecraft server in a long time. You may have to tell the server to broadcast on the VPN network and to listen for incoming connections if it doesn't broadcast on all available interfaces by default.

 

I have confidence this should work if your goal was just to access it from outside your house via it's IP and setting up a Static Route but this is definitely a little different. It should still be possible though.

I have tried everything you have said and even triple checked that my Vultr server was listening on port 25565 but it still refuses connection with everything setup as you have suggested above

Link to comment
Share on other sites

Link to post
Share on other sites

I have made some sort of progress I can connect to the MC server if I connect both my home pc to the VPN and the server to the VPN. Which now makes me extra confused why I can't connect when I'm on my home network all the ports are open to the internet.

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, slop_me said:

I have made some sort of progress I can connect to the MC server if I connect both my home pc to the VPN and the server to the VPN. Which now makes me extra confused why I can't connect when I'm on my home network all the ports are open to the internet.

When you attempt to connect while on your home network are you connecting to the MC server using your Public IP?

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, Windows7ge said:

When you attempt to connect while on your home network are you connecting to the MC server using your Public IP?

I'm trying to connect to the mc server using the Vultr public ip.

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, slop_me said:

I'm trying to connect to the mc server using the Vultr public ip.

Well, the reason would be nothing is linking the two processes together. There is no route to the MC server IP except over the VPN. If you aren't connected to the VPN the VPS can't link your requests to the MC server.

 

An analogy might be imagine two people in the same building but in different rooms and the hallway is the VPN. The two processes can't talk to one another without it.

 

As I mentioned before if you were hosting the VPS on your home network you could configure a static route to your MC server. This way it wouldn't have to run the VPN Client. It may be possible to link the VPS VPN to a VPN on your LAN (Site-to-Site) but Pritunl I believe charges you for that right.

Link to comment
Share on other sites

Link to post
Share on other sites

14 minutes ago, Windows7ge said:

Well, the reason would be nothing is linking the two processes together. There is no route to the MC server IP except over the VPN. If you aren't connected to the VPN the VPS can't link your requests to the MC server.

 

An analogy might be imagine two people in the same building but in different rooms and the hallway is the VPN. The two processes can't talk to one another without it.

 

As I mentioned before if you were hosting the VPS on your home network you could configure a static route to your MC server. This way it wouldn't have to run the VPN Client. It may be possible to link the VPS VPN to a VPN on your LAN (Site-to-Site) but Pritunl I believe charges you for that right.

Hmmm... This is turning into way more hassle than I expected lol. Now I just need to find someway to make the vps talk to the vpn at least that's what I got from what you said. I also don't think pritunl charges for anything as far as I thought they were completely free

I don't even need to do this by vpn that's not a requirement so if anyone has a better way of doing this I would be more than willing to try suggestions at this point lol going on 6 hours of trying different things now

Link to comment
Share on other sites

Link to post
Share on other sites

4 minutes ago, slop_me said:

Hmmm... This is turning into way more hassle than I expected lol. Now I just need to find someway to make the vps talk to the vpn at least that's what I got from what you said. I also don't think pritunl charges for anything as far as I thought they were completely free

Well. The immediate problem would be that there's no route going between the VPN network and the Public IP of the VPS. You can configure Static Routes but I don't know if it would allow connections going into the VPN or if it would only allow connections going out.

 

They have a subscription plan you can sign up for. It unlocks more features of the VPN service such as linking multiple VPN servers (Site-to-Site).

Link to comment
Share on other sites

Link to post
Share on other sites

6 minutes ago, Windows7ge said:

Well. The immediate problem would be that there's no route going between the VPN network and the Public IP of the VPS. You can configure Static Routes but I don't know if it would allow connections going into the VPN or if it would only allow connections going out.

 

They have a subscription plan you can sign up for. It unlocks more features of the VPN service such as linking multiple VPN servers (Site-to-Site).

Ah okay I didn't know they had a subscription. Do you know of any other way other than a VPN that I could pass the Minecraft server through the VPS? I'm not to familar with how I would configure static routs going to and from the VPN. I'll admit that's probably above me

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, slop_me said:

Ah okay. Do you know of any other way other than a VPN that I could pass the Minecraft server through the VPS? I'm not to familar with how I would configure static routs going to and from the VPN. I'll admit that's probably above me

I have my Pritunl server setup in a Client-to-Site configuration. It does appear the server can ping devices on the VPN. This means it should be possible for the VPS to connect to the MC server.

 

What you need is something to forward your request to your MC VPN IP from the Public IP of the VPS.

 

Unfortunately I don't know what to achieve that. You basically need the VPS to behave like a router. This would enable people not connected to the VPN to access the MC server on the VPN.

Link to comment
Share on other sites

Link to post
Share on other sites

11 minutes ago, Windows7ge said:

I have my Pritunl server setup in a Client-to-Site configuration. It does appear the server can ping devices on the VPN. This means it should be possible for the VPS to connect to the MC server.

 

What you need is something to forward your request to your MC VPN IP from the Public IP of the VPS.

 

Unfortunately I don't know what to achieve that. You basically need the VPS to behave like a router. This would enable people not connected to the VPN to access the MC server on the VPN.

Greatly appreciate all the help I will have to pick up this tomorrow it's getting rather late and I'm just going to end up bashing my head on my keyboard if I keep up on this in the late hours

Link to comment
Share on other sites

Link to post
Share on other sites

I don't think you need a VPN to do this, if I'm recalling correctly.

 

On the VPS I think you should be able to port forward from its public IP address to your home IP address.  Anyone connecting only sees the VPS IP.

I'm not sure this is 100% leak proof, but then I'm not sure the VPN is either.

Either way I think you need to enable ip forwarding on the VPS, or it can't NAT the packets to make them appear to come from a different IP.

Router:  Intel N100 (pfSense) WiFi6: Zyxel NWA210AX (1.7Gbit peak at 160Mhz)
WiFi5: Ubiquiti NanoHD OpenWRT (~500Mbit at 80Mhz) Switches: Netgear MS510TXUP, MS510TXPP, GS110EMX
ISPs: Zen Full Fibre 900 (~930Mbit down, 115Mbit up) + Three 5G (~800Mbit down, 115Mbit up)
Upgrading Laptop/Desktop CNVIo WiFi 5 cards to PCIe WiFi6e/7

Link to comment
Share on other sites

Link to post
Share on other sites

20 minutes ago, Alex Atkin UK said:

I don't think you need a VPN to do this, if I'm recalling correctly.

 

On the VPS I think you should be able to port forward from its public IP address to your home IP address.  Anyone connecting only sees the VPS IP.

I'm not sure this is 100% leak proof, but then I'm not sure the VPN is either.

Either way I think you need to enable ip forwarding on the VPS, or it can't NAT the packets to make them appear to come from a different IP.

Could you possibly provide documentation on how this is done greatly appreciated if you could :D ? I'm going to be blunt I'm not too sure how to word that into google lol

Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, slop_me said:

Could you possibly provide documentation on how this is done greatly appreciated if you could :D ? I'm going to be blunt I'm not too sure how to word that into google lol

If the VPS is Linux based I think its something like this:

sysctl net.ipv4.ip_forward=1

server_ip="x.x.x.x"
home_ip="y.y.y.y"
server_port=25565
home_port=25565


iptables -A PREROUTING  -t nat -p tcp -m tcp -d $server_ip --dport $server_port -j DNAT --to-destination $home_ip:$home_port
iptables -A PREROUTING  -t nat -p udp -m udp -d $server_ip --dport $server_port -j DNAT --to-destination $home_ip:$home_port
iptables -A FORWARD -m state -p tcp -d $home_ip --dport $home_port --state NEW,ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -m state -p udp -d $home_ip --dport $home_port --state NEW,ESTABLISHED,RELATED -j ACCEPT
iptables -A POSTROUTING -t nat -p tcp -m tcp -s $home_ip --sport $home_port -j SNAT --to-source $server_ip
iptables -A POSTROUTING -t nat -p udp -m udp -s $home_ip --sport $home_port -j SNAT --to-source $server_ip

Where obviously you need to specify your VPS server and home IP addresses instead of the x.x.x.x and y.y.y.y.

 

If I still had my Minecraft server installed I would have tested it.

 

Obviously you still need to have the port forwarded via your router at home too to your local server to let the redirected traffic in, that's "the catch" in that its still accessible from the Internet on your home IP if someone knows it.

Router:  Intel N100 (pfSense) WiFi6: Zyxel NWA210AX (1.7Gbit peak at 160Mhz)
WiFi5: Ubiquiti NanoHD OpenWRT (~500Mbit at 80Mhz) Switches: Netgear MS510TXUP, MS510TXPP, GS110EMX
ISPs: Zen Full Fibre 900 (~930Mbit down, 115Mbit up) + Three 5G (~800Mbit down, 115Mbit up)
Upgrading Laptop/Desktop CNVIo WiFi 5 cards to PCIe WiFi6e/7

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×