NAT loopback problems on a Linksys WRT1900ACS

I have an apache web server that I want to use from the LAN and from the WAN on the same url. I have everything working fine from the WAN after setting up port forward on port 80 HTTP, but nothing on the LAN can access the same domain and access the apache server despite NAT loopback being enabled on the port forward rule.

Anything else I need to do on the router to make this work (it used to work flawlessly on my ISP's router previously (a ZyXEL 8702N)? I really don't want to have to edit the hosts file on each computer on the LAN (or change DNS replies) for this to work.

Firmware v.: LEDE Reboot 17.01.4 r3560-79f57e422d / LuCI lede-17.01 branch (git-17.290.79498-d3f0685)

First, NAT loopback on OpenWrt only relates to the host in the rule (i.e. the Apache server). Loopback should work from that IP address. For what you desire, you'll have to configure complex redirects to accomplish the task using NAT.

They read as such:

config redirect
	option target 'DNAT'
	option proto 'tcp'
	option dest_ip ''
	option src_ip ''
	option src 'wan'
	option dest 'lan'
	option src_dport '80'
	option dest_port '80'
	option name 'REDIRECT_Web_LAN'

(LAN is the destination zone, even if your web server is in another zone, the redirect changes the destination IP form Public to Private.)

  • The other solution is to make a local DNS entry for the domain using the LAN IP address.

Thanks alot! That worked perfectly (after a close/open of my browser)!
If you post somehow to thank you (bitcoin, PayPal, etc other) I'd love to buy you a beer (or something equivalent).

Could I have found this out myself somehow? I googled a lot before creating an account and asking, but maybe my Google-fu failed me today? Is there some blatantly easy to find guide on this that I missed? I only found lots of bug reports etc. that seemingly got worked out when the original poster found his own error.

Feel free to mark the relevant post as the solution.

Not really...this perhaps:

Otherwise, I just suggest a general iptables tutorial...

I sent you a link in Private's not needed; but if you do, I'll simply find a way to put more study into OpenWrt (or take a short break)! :wink:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.