Self Hosting Behind a CGNAT reddit / selfhosted ---------------------------------------------------------------------- Pweppapig 路 2023-11-04 19:02 Okay so my ISP is behind a CGNAT meaning I can't directly port forward services to expose them to the internet. I also can't use cloudflare tunnels in this case as I would be hosting minecraft servers which do not work with cloudflare tunnels. I read somewhere that we can use the IP of a VPS as an entrypoint and use it with our server's as something like a VPN. How would I go on about doing this? Please give a detailed explanation, I'm very very confused lmao. Thanks! ---------------------------------------------------------------------- Fester113 路 2023-11-04 20:23 Cloudflare tunnels is your answer. https://youtu.be/ZvIdFs3M5ic?si=A82G1auXGqV4hWMD https://youtu.be/eojWaJQvqiw?si=Kd2SaSOol-m2vbHo ---------------------------------------------------------------------- Pweppapig 路 2023-11-04 20:25 Read my thing again 馃槃 I specifically said cloudflare tunnels wont work in this case. ---------------------------------------------------------------------- Pweppapig 路 2023-11-04 20:26 I did find something that might work though. Will try it out tomorrow https://youtu.be/9tDeh9mutmI?si=lBQsQ3_XoXIPjVSh ---------------------------------------------------------------------- Install_GNU_LINUX 路 2023-11-04 20:36 use tailscale. best option imo ---------------------------------------------------------------------- NLJPM 路 2023-11-04 20:48 You can use Tailscale or you can combine Tailscale with a reverse proxy on a VPS. So that the players on your server don't need Tailscale but just connect with your vps ip ---------------------------------------------------------------------- NLJPM 路 2023-11-04 20:51 Maybe ngrok would also work, then you don't need a VPS. I think it's kinda like Cloudflare Tunnels except you can also tunnel your Minecraft server for example ---------------------------------------------------------------------- AdolfZedong 路 2023-11-04 20:56 There are multiple ways to do this. Years ago I used a ssh tunnel to make my minecraft server available using a vps. I actually asked for help [here](https://old.reddit.com/r/selfhosted/comments/gmlk0g/how_do _i_make_minecraft_reachable_using_a/) to solve some issues I had. Since then I switched to using wireguard and nginx. ---------------------------------------------------------------------- northern_lights2 路 2023-11-04 21:03 A pure selfhosted solution might be possible with IPv6, check [https://test-ipv6.com/](https://test-ipv6.com/) to see if it works. You might need to allow inbound traffic in your router config. Ask your ISP if you get 0/10. You can get your friends connect to an IPv6 based wireguard connection, and then assign them IPv4 addresses on [10.0.0.0/8](https://10.0.0.0/8) and have them connect to a local IPv4 address on minecraft. I'd guess minecraft doesn't support IPv6 and would have to be carried over IPv6 in some way. ---------------------------------------------------------------------- Danny-117 路 2023-11-04 21:29 I鈥檇 check out IPv6 any good ISP will support it, if you and your friends all have it then just use it. No port forwarding needed. Just open the port in your firewall ---------------------------------------------------------------------- Znuffie 路 2023-11-04 21:39 > I would be hosting minecraft servers which do not work with cloudflare tunnels. [You don't say?](https://www.cloudflare.com/products/cloudflare- spectrum/minecraft/) ---------------------------------------------------------------------- jeanklann 路 2023-11-04 22:00 I have the exact same problem, and I got it all working with this solution: I've got a VPS Amazon machine (a really cheap machine), and installed Ubuntu server. There are AWS EC2 machines that are free for 12 months, then you can try it for free. On this VPS, I have a fixed IPv4 (Free either on Amazon) After that I installed NGINX to route the traffic from IPv4 to my home IPv6 machine (my ISP gives me IPv6, and no port blocking on IPv6). But it can be do also on a VPN service like OpenVPN or even tailscale (I have tested on tailscale and worked like a charm either). With this configuration you can access your server with no installed software on PC Minecraft players. ---------------------------------------------------------------------- KN4MKB 路 2023-11-04 23:49 Yes you can use a public VPS to get around this. Those saying "tailscale" or xyz version of VPN typically don't realize that sometimes people just want to play Minecraft together. In the real world, you won't have all your friends and their friends download and install a VPN to connect to your network. ---------------------------------------------------------------------- ZaxLofful 路 2023-11-05 00:05 I pay for a really cheap VPS, that I found on the cheap VPS website and then run Firezone. ---------------------------------------------------------------------- certuna 路 2023-11-05 00:11 It鈥檚 no longer 2013, half the world has IPv6 now, it鈥檚 not some exotic thing. ---------------------------------------------------------------------- astutesnoot 路 2023-11-05 00:33 This may be a dumb question, but if you're going to go to the trouble of getting a VPS just for VPN routing, why not just run the Minecraft server on that VPS and take your CGNAT ISP out of the equation entirely? ---------------------------------------------------------------------- KN4MKB 路 2023-11-05 01:48 It's actually about 39-43% world wide, with the US more like 50% and on the decline by 6% since last year. The industry has noticed it's poor implementation and it's losing popularity in environments that don't require it for reasons you mentioned above. Either way, making phone calls to the ISP, tunneling IPv4 over Ipv6 and making hacking hacky fixes to cross your fingers that half your friends can play on your Minecraft server is most certainly not any type of solution. I have it available alongside ipv4, but it's disabled. It's not 2019 anymore where ipv6 is seen as the saving grace and disabling it is demonized. The industry mindset is moving toward accepting that its not the best option for residential users and maybe everyone doesn't need one after all. A lot of comments here tell me people can't secure their ipv4 networks, let alone the nightmare of properly securing an IP 6 environment. ---------------------------------------------------------------------- KN4MKB 路 2023-11-05 02:02 I take it you've never used spectrum to host a Minecraft server for friends. ---------------------------------------------------------------------- KN4MKB 路 2023-11-05 02:07 OP just needs a VPS server with traffic forwarded to an internal host. No need for Tailscale, or any of those other modern day hamachi solutions. Nobody wants to get all of their friends and aliases to install software on their computer just to tailscale in to play on a Minecraft server. ---------------------------------------------------------------------- KN4MKB 路 2023-11-05 02:09 Ipv6 will not work that way with Minecraft. ---------------------------------------------------------------------- KN4MKB 路 2023-11-05 02:09 Minecraft will not work hosted on ipv6. ---------------------------------------------------------------------- KN4MKB 路 2023-11-05 02:13 The difference in cost between a VPS that has resources to run a server and one that just forwards traffic is quite a large gap. If you have networking experience at all(enough to securely self host services) then forwarding traffic from a VPS to an internal host isn't trouble, but a trivial iptables rule or two that should take about 5 minutes after os deployment. ---------------------------------------------------------------------- northern_lights2 路 2023-11-05 02:31 Even if we use IPv6 to just connect wireguard and then use IPv4 for game purposes? ---------------------------------------------------------------------- Znuffie 路 2023-11-05 03:08 That doesn't mean it's not possible. Not economically feasible. Sure. Still possible. ---------------------------------------------------------------------- KN4MKB 路 2023-11-05 03:36 You're basically just creating a tunnel with extra steps. SSH tunneling is built into just about any Linux distro you'd use for Minecraft hosting and Windows 11 as well. You don't need wireguard or ipv6. If you already have a host externally that you'd use for the wireguard input just screw wireguard and ipv6 at that point and just tunnel the traffic I to your internal host with native tools in the OS like ssh and iptables. ---------------------------------------------------------------------- xkcd__386 路 2023-11-05 04:03 I mostly agree with you, but one difference between wireguard to create the tunnel between VPS and home, over ssh, is that you never need to worry about the ssh connection breaking and having to re- establish it a la `autossh`. PS: I am not a gamer, so minecraft for me is just 2 English words stuck together ;-) ---------------------------------------------------------------------- northern_lights2 路 2023-11-05 04:28 * ssh is TCP, wireguard is UDP. Seems minecraft can work with TCP, so it's fine, but wireguard would be better for low latency games. * I agree your solution is cleaner. My solution would additionally require assigning a different IP address to every friend and a server. It would be in config. * Yeah, IPv6 has little support, I was 99% sure minecraft won't support IPv6 before you confirmed it. I doubt OP would have IPv6 at all. And his friends must have IPv6 too. ---------------------------------------------------------------------- Pweppapig 路 2023-11-05 05:29 It's a lot more financially feasible. I could get a small VPS with a good bandwidth and uplink for like 5$'s or something and use that with my home servers. I've already considered colocations and all the other possibilities like trying to get a static IP from my ISP but all of them have downsides and this too has downsides but the others outweigh this. ---------------------------------------------------------------------- Pweppapig 路 2023-11-05 05:35 Alright so I agree with u/KN4MKB. I did a little bit more research into how I can setup a VPN on a VPS and I use it with my local servers to bypass the CGNAT and I stumbled upon this video which explains everything in detail properly. We can do this by using Wireguard, Nginx Proxy manager and a VPS. [Documentation](https://wickedyoda.com/using-wireguard-and-a-vps-to- bypass-isp-port-blocking-and-hide-your-public-ip/) ---------------------------------------------------------------------- Pweppapig 路 2023-11-05 05:38 Tried that too but the problem with that is the IP keeps changing unless I get a paid version and I might as well get a VPS and setup everything myself instead of that. Also this isn't only for Minecraft that was just one of the things I mentioned so that to comments wouldn't be spammed with people asking me to use the cloudflare proxy. ---------------------------------------------------------------------- HorizonTGC 路 2023-11-05 05:54 While many suggest VPN or Tailscale, I don鈥檛 think they are ideal for hosting things like MC severs. You can鈥檛 expect everyone potentially want to play on your server is able and willing to deal with this extra step. I would suggest use a VPS to run a reverse proxy using things like [FRP](https://github.com/fatedier/frp), so anyone, without installing anything special on their device, can enter using the VPS鈥檚 IP. ---------------------------------------------------------------------- hadrabap 路 2023-11-05 07:42 I have two compute resources for free in a cloud, including some network traffic. I use WireGuard to get the cloud LAN into my home LANs. Now, I have direct static IPs everywhere, but before that happened, I used the cloud resource as a VPN gateway to reach my home LANs. Now, I moved the gateway back home because it feels right from the topology point of view. The only cost has been my time spent on setup. 馃檪 Worked/works flawlessly. ---------------------------------------------------------------------- NLJPM 路 2023-11-05 08:05 Yeah that's why he should install Tailscale on his vps with a reverse proxy ---------------------------------------------------------------------- D0mC0m 路 2023-11-05 10:58 This is your way to go: https://github.com/wojtekka/6tunnel ---------------------------------------------------------------------- KN4MKB 路 2023-11-05 12:16 Nice, I'll save that because that's gonna be useful for other things as well. ---------------------------------------------------------------------- operator207 路 2023-11-05 14:29 Where might one get a set of these compute resources for free in a cloud with some network traffic? 馃檪 ---------------------------------------------------------------------- DIBSSB 路 2023-11-05 14:35 Is their cgnat for ipv 6 ? I have ipv 6 address but idk how to use it with niginix reverse proxy manager? ---------------------------------------------------------------------- hadrabap 路 2023-11-05 14:43 Oracle Cloud https://docs.oracle.com/en- us/iaas/Content/FreeTier/freetier_topic-Always_Free_Resources.htm Make sure to choose wisely the home region. Always Free resources can be deployed only there. Next, make sure to convert the trial to pay- as-you-go in time otherwise you lose the account and the e-mail address you used for registration for good. ---------------------------------------------------------------------- junialter 路 2023-11-05 21:08 It does. I haven been hosting a minecraft server since 2012. I don't know about the vanilla server but [paper](https://papermc.io/) works flawlessly with IPv6. ---------------------------------------------------------------------- junialter 路 2023-11-05 21:16 >Minecraft will not work hosted on ipv6 It does, where do you get that from? Sauce? ---------------------------------------------------------------------- KN4MKB 路 2023-11-06 05:24 Even though a quick Google search will get you my answer, I'll post the top result for you. https://www.reddit.com/r/ipv6/comments/ujpl68/minecraft_will_not_be_s upporting_ipv6_in_the/ In case that's not enough, try this out: https://letmegooglethat.com/?q=can+I+host+Minecraft+server+on+ipv6 While we're playing this game, link me to a single instance where anyone has ever been successful binding a Minecraft server to an IPv6 address where others can join outside. ---------------------------------------------------------------------- junialter 路 2023-11-06 10:16 Then how come I run Minecraft with #IPv6? ---------------------------------------------------------------------- junialter 路 2023-11-06 10:38 After your post I really doubted myself but I tested it specifically by entering my server with IPv6 address and here you can see the log of me joining. The address I have obfuscated of course. ``` [11:34:59 INFO]: grobmoe joined the game [11:34:59 INFO]: grobmoe[/[2001:1111:2222:ff:0:0:0:2%0]:47008] logged in with entity id 1560 at ([discordia]10308.13523440949, 69.0, 2735.826911496187) ```