Hitting a portforward from the inside

On my home network I run OpenWrt (19.07.2 r10947-65030d81f3 / LuCI openwrt-19.07 branch git-20.105.64099-eeba108). Hardware is an apu2
On the inside I have a few networks (using vlans, but that should matter for now)

One net is a DMZ where I have a public accessible webserver, so a portforward is made to forward port 80 and 443 to that. Everything is fine so far, web is reachable from the world. A public DNS server points a record to my webserver.

Next, I have my internal network with desktop computers and such. From this network I would like to access my webserver, using the public DNS record which result in a public IP address.

So traffic should go from pc, to openwrt, through the port forward rules, and then back in to hit the webserver.

Can this be done? Any pointer to an example I can read up on?

Either rebind public IP with private one on your local DNS server, or create separate redirects for each source sone.

2 Likes