For the very first time i tried to selfhost a static site (lighttpd + duckdns) but I’ve failed… Is it even possible to selfhost a static site from “router 2” while i’m behind two routers? “Router 1” is from ISP and i have no possibility to change any settings except subnet, standard gateway, dhcp on/off and DMZ. -> no port forwarding. "Router 2 is Asus with port-forwarding available and i’m using an OpenVPN configuration on it (if that matters). DuckDNS could see the external ip from R2, but i couldn’t access it.
Selfhosting static site behind two routers?
Submitted 1 year ago by pythia@lemmy.dbzer0.com to selfhosted@lemmy.world
Comments
pythia@lemmy.dbzer0.com 1 year ago
[deleted]uranibaba@lemmy.world 1 year ago
You want DMZ. I have the same setup. DMZ will make router 1 consider router 2 to be WAN and not behind firewall.
fishynoob@infosec.pub 1 year ago
Yes, but DMZ is a better solution if you want to let Router 2 handle your network
possiblylinux127@lemmy.zip 1 year ago
You don’t want two routers as that creates a double NAT
Setup a service and them install Tailscale/Netbird on your devices. The reason double NAT is bad is that it can break NAT traversal used to allow you to directly remote access a device away from home.
Xanza@lemm.ee 1 year ago
DuckDNS is just unreliable, I’ve found. Try HurricaneElectric; dns.he.net
couch1potato@lemmy.dbzer0.com 1 year ago
I’m actually behind 3 routers and still hosting stuff to the internet. My house is behind cgnat, I have two isp routers, which both connect to a pfsense router (ip of which is in tge dmz of each isp router).
My pfsense router and a free vps hosted at oracle are both connected via tailscale. Pfsense router advertises specific subnet addresses to the tailnet. VPS uses caddy to reverse proxy to those subnet addresses to expose them to the internet.
Jason2357@lemmy.ca 1 year ago
Either DMZ on the first router, or bridge mode on the second.
BrightCandle@lemmy.world 1 year ago
The DMZ for the ISPs router forward to the second router, then everything that hits your outside IP will be forwarded to router 2. Then on Router 2 you open the ports for your service and forward to the internal machine. That should all work fine.
pythia@lemmy.dbzer0.com 1 year ago
Thank you, will try. I was afraid of DMZ …
just_another_person@lemmy.world 1 year ago
You’re going to get double NAT’d if you don’t have a proper passthrough. Is there a specific reason you have two routers setup like this?
Onomatopoeia@lemmy.cafe 1 year ago
Probably because the ISP modem/router has limited capability.
I’ve done 2 routers like this for years (out of laziness more than anything) because cable modem router suck from a capability standpoint.
just_another_person@lemmy.world 1 year ago
The actual cable modem can run in passthrough mode though. Look up the model and find the docs. Should be a quick and easy change, or your ISP at least should able to change it. It would be absurd if not.
perishthethought@lemm.ee 1 year ago
Hey, I’m doing this now, using DuckDNS. But I had to forward a port thru Router 1, as you call it. That’s your problem.
Maybe Tailscale would help you? (I’ve not used it though)
Or, instead of allowing port 80/443 traffic in, what I have is a random port used by my Wireguard VPN opened only. But I have to connect thru that when I’m not at home. I. E. only I can access my web server.
markstos@lemmy.world 1 year ago
Yes. DMZ on router 1 exposes router 2 IP to internet.
badlotus@discuss.online 1 year ago
This right here. Since you can’t really configure the ISP router, DMZ mode is the way to go. Just make sure you’re not connecting anything else directly to your ISP router or it will be exposed to the internet along with your router.
aspoleczny@lemmy.world 1 year ago
I use cloudflare tunnel for this purpose. No open ports, no dealing with ISP, no exposing my IP.
starshipwinepineapple@programming.dev 1 year ago
I would use cloudflare pages (or any forge ‘pages’ feature) before using tunnels for a static website
yournamehere@lemm.ee 1 year ago
yet some people might want less america in their setup and try to avoid services like that.
aspoleczny@lemmy.world 1 year ago
Understandable. It’s compromise I’m ok with, so that’s why I mentioned this method.
retro@infosec.pub 1 year ago
While this is true, the reader is really the only one that can choose for themselves and Cloudflare is a valid option, even if it isn’t the most purist method available.