r/HomeNetworking • u/Laxarus • Oct 05 '20
Advice Bypass CGNAT, options?
I am behind CGNAT and it is a nightmare. My ISP doesn't offer dynamic public ip even if you pay. You either get static ip or cgnat. So, you cannot remote connect to your home network easily without a relay service like plex relay or synology relay.
Of course, relay services are not available for all your gear. In addition to that, the connection speed suffers because there is an extra route there.
No https too as you cannot get a valid cert without a fixed ip.
Anyway,
I have a VPS server rented and managed to set up a OpenVPN server on the VPS to redirect the select traffic to my home server. But, setting this up was not easy and connection is not very good. VPS server is located on the other side of the world. But, VPS is expensive and I am planning to cancel my subscription. Hell, it is costing me more than ISP static ip plans. However, it is more secure and manageable. If I get static ip from my ISP, it is fixed. Changing this static ip is impossibly hard with my ISP. So, I am afraid of getting it.
What are the other options that can bypass CGNAT? Any ideas, suggestions are welcome.
I read somewhere that ipv6 tunneling can handle that but couldn't validate it. Is it possible? How to set it up?
Edit1:
Thank you everyone for the suggestions so far
Below is the current list:
- ZeroTier
- Tailscale
- Get Static ip from ISP : I don't feel safe enough. But I will look through cloudflare proxying.
- Wireguard : My router doesn't support it. I can set this up on pi and redirect traffic from pi but I am always against overcomplicating the home network.
- switch to a VPN with static IP. : I have two years of subscription left for my vpn.ac provider. I will consider this when my vpn subscription expires.
- cheap VPS with ovpn or ssh tunneling : always an option.
Edit2:
First of all, thank you everyone for giving your suggestions. It was very helpful. Another question came to my mind. How would the below setup work?
Get VPS
Install OpenVPN Server on the VPS
Install nginx proxy manager on the VPS
Register a domain name
connect your router to OpenVPN server as a client and allow incoming connections from the VPN.
Use nginx proxy manager and cloudflare CGN with your domain name to set-up reverse proxy with a single port on the VPS.
for example, If your router vpn ip address is 10.0.0.2
point nginx to 10.0.0.2:port1 for a service, 10.0.0.2:port2 for another service etc...
On your router, handle these incoming connections by routing them to local ip addresses for these services (TUN to LAN port forwarding).
Now, here is the question how will this set up handle https?
More details:
if your domain name is homeserver.org
you arranged the a1.homeserver.org to go to a Synology server https webui which is normally on some local ip with port 5001.
Can this throw a ssl error on the browser?
27
u/MinnisotaDigger Oct 05 '20
You basically got it. VPS is the best way. Open VPN is a bit tough on some cheaper VPS’s. I actually use ssh tunneling mostly, works out of the box.
7
u/mrpink57 Mega Noob Oct 05 '20
Does your ISP offer ipv6 options?
3
u/secousa Oct 05 '20
reverse ssh tunnel towards your VPS. Nginx on vps for any endpoint that needs ssl...basically terminate ssl at vps then pipe traffic home. One tunnel per local port you want to open
ngrok is an option as well, first one is preferred though
2
u/GuilhermeFreire Oct 05 '20
I use ZeroTier to bypass CgNAT. It is not the same, but it works.
A few things to consider: in my case using ZeroTier directly on my NAS gave me a huge performance increment. I was using a RPi 4 to do a iptables translation to expose my whole home network to my Zerotier network, but in this way the performance was really slow. I even tried to spun a ubuntu VM to do the same thing but performance kept slow. But installing zerotier on each client gave me this performance advantage.
But as you said, not everything can have a SDN client attached, so I still have the RPi and also have a VM that I can RDP into and use anywhere as if I were in my home network.
For now it is working fine
19
u/CornFTW Oct 05 '20
You should give this ago;
https://www.zerotier.com/
I use it to stream Plex and to connect to my NAS when I'm away, it's free for home use works really well, I had a similar setup to you, and found zerotier worked so much better
11
u/Oujii Oct 05 '20
Try to get a VPS closer to you and use Wireguard instead of OpenVPN. You can look for cheap VPS here: LowEndSpirit and LowEndTalk
8
u/ModernVape Oct 05 '20
Who is you ISP ? CGNAT without providing ipv6 is insane.
1
u/minektur Oct 05 '20
If you're looking for a cheap vpn provider, I could recommend these guys:
https://vmhaus.com/
Their starting plan works out to $3/month.
I've been with them quite a while, and have had zero trouble with my two vms (london, LA). If I needed another I would definitely go with them.
Also you said:
I'm not sure that this is exactly what you mean. I think that what you mean is:
"I don't have a fixed public IP address, therefore I can not set up a hostname in DNS for connecting to my back end services, therefore I can't install an https cert on my back end and have it validate."
Right? Pardon if I'm putting words in your mouth. In this case, look at step 2 there - There are plenty of dynamic dns services around that will continually update your dns record to match whatever is currently serving as your public IP. And you can get some dyndns services that allow txt records so you can do dns validation. Not sure if you can get an ACME cert with dyndns, so you might end up having to pay $7/year to someone like namecheap for the cert.
1
u/12_nick_12 Oct 05 '20
I would get a cheap VPS in the same country (VULTR/Digital Ocean have VPSes pretty much everywhere). I would look into WireGuard instead of OpenVPN.
1
u/Alecthar Oct 05 '20
I really don't understand why you're concerned about security with regard to a static IP. If it's about activity being traceable back to your IP, I have some bad news for you about anonymity and the internet.
If it's about having a consistent IP that.might be subject to attacks of some kind, really it's not meaningfully superior to have a dynamic IP. The same good security practices are necessary on your part regardless. Don't convince yourself that you can get away with a less tightly secured network just because your IP address changes occasionally.
3
u/joshuaBarbosa Oct 05 '20
From my basic knowledge, I know you cannot do anything about this.
I hope someone has an answer so I could also benefit from it!
3
u/conorlburns Oct 05 '20
Wireguard tunnel to a vps is awesome - I can push a full gigabit through it without any problems
1
u/GetVladimir Oct 05 '20
Don’t know if this will help, but you can try subscribing to Cloudflare WARP+ and get an IPv6 via WireGuard.
It wouldn’t be easy to setup, as basically your router would need to support WireGuard (very few do).
The best solution would be to get a better ISP
1
u/knightcrusader Oct 05 '20
I used to be behind a NAT from my ISP before my current setup, so I had a system worked out on how to do it - but then fiber optic rolled out and now I have a public IP so I never had a chance to do it.
I was just going to spend $5 a month on a DigitalOcean droplet, set up an OpenVPN from my router to the droplet, and then route/port forward stuff from the droplet back to my network through the VPN when I needed to get in.
1
u/Duterturd_ Oct 05 '20
If its just web services, you can try cloudflare’s argo tunnel.
1
u/Rodo20 Oct 05 '20
Either buy a vpn with dedicated ip and port forwarding. Or host a vpn on a vps.
In my opinion it's the easyest way :). I have ran server with vpn myself and it have worked as expected.
1
u/dmxwidget Oct 05 '20
My isp was similar.
$10/month for a static IP.
The process was surprisingly simple for me. They just had to set it up on their end.
Personally, I like having the static IP more.
1
u/Gintoki98 Jan 26 '22
Bypass CGNAT
Omega easy with VPS (there is a free solution if you sell your soul to oracle)
0
u/[deleted] Oct 05 '20
[deleted] — view deleted comment
0
u/[deleted] Oct 05 '20
[deleted] — view deleted comment