Router Behind NAT

Hello everyone, I have few self hosted services on a local server that's connected to the internet though a 5G router (which usually is behind NAT) and can't get a real public IP to create a DNS record or a DDNS... what is the best way to do that?
12 Replies
zegevlier
zegevlier2w ago
Cloudflare tunnels would be a good solution for this
zegevlier
zegevlier2w ago
Cloudflare Docs
Cloudflare Tunnel · Cloudflare Zero Trust docs
Cloudflare Tunnel provides you with a secure way to connect your resources to Cloudflare without a publicly routable IP address. With Tunnel, you do not send traffic to an external IP — instead, a lightweight daemon in your infrastructure (cloudflared) creates outbound-only connections to Cloudflare's global network. Cloudflare Tunnel can conn...
zegevlier
zegevlier2w ago
You run a piece of software on your local server, that connects out to Cloudflare, then any requests that come in go through that tunnel, meaning you don't need to open any ports on your network.
database
databaseOP2w ago
I reallly appreciate your fast reply.. of course... I'm running one right now but I get this annoying message when my server is down or unreachable:
No description
zegevlier
zegevlier2w ago
Right, if the tunnel is down it wont be able to forward the request. Could you elebaorate on your question? Are you confused why you're seeing the message? Or are you asking if it's possible to change the message?
database
databaseOP2w ago
I'm asking for a way to change the message and also if it's a common way to serve a service for public on CloudFlare Tunnel or is it like unprofessional way to do so?
zegevlier
zegevlier2w ago
I believe (though I haven't verified) you should be able to change this error page with custom error and challange pages: https://developers.cloudflare.com/support/more-dashboard-apps/cloudflare-custom-pages/configuring-custom-pages-error-and-challenge/ Note that this does require at least a Pro subscription.
Cloudflare Docs
Configuring Custom Pages (Error and Challenge) · Cloudflare Suppor...
Cloudflare uses a wide range of error codes to identify issues in handling request traffic. By default, these error pages mention Cloudflare; however, custom error pages help you provide a consistent brand experience for your users.
zegevlier
zegevlier2w ago
Plenty of professional sites use CF tunnels to host their website, that shouldn't be an issue. Hosting from home is a bit risky if you are doing anything serious. It's much more likely for your power or internet to go out at your home than at a datacenter. That being said, for personal project it's totally fine in my opinion. Note that if you're hosting a static site, or using a Javascript framework, Pages/workers assets allow you to host those on Cloudflare directly, for free.
database
databaseOP2w ago
You're the best... thank you very much, I'm actually using Flask as backend, But it's just a family website nothing very serious... the data are very valuable but only for me and my family members... so self-hosting in my home lab is best option for me... thank you again for your help and response
zegevlier
zegevlier2w ago
No worries, happy to help!
database
databaseOP2w ago
there's a little small question in #off-topic can you kindly take a look if you have an idea? https://discord.com/channels/595317990191398933/812577823599755274/1356751737599561911
shackbill
shackbill6d ago
hello all..i am new to this channel and not very well versed on the zero trust tunnel BUT i created one several months back for a service i am running at my home and im behind CGNAT. It worked perfect for about 4 months then i was checking on it one day when i couldnt access it from anohter device and a message said i needed to change NS. Which i did. I also made sure DNS records were good. Now i cant connect to the server. an NSLookup resolvs to cloudflare and the status says healty uptime 55 minutes. oh yea, i did renew the token and uninstall/reran the service on my win11 box. Any ideas why i am not getting a connection is there something with DNS i may have overlooked? thanks in advance

Did you find this page helpful?