DD-WRT Internal Routing Hack/Fix/Mod
This hack/repair is well documented in the DD-WRT Forums but I’m including it here so I can easily find it for future reference.
I’m pointing a subdomain back to my local network which resolves to a server running apache. This works great outside the network, but internally … no dice. So the following rule needs to be applied to get things working:
Save the following commands to the Firewall Script on the Administration->Commands page to fix loopback.
insmod ipt_mark insmod xt_mark iptables -t mangle -A PREROUTING -i ! `get_wanface` -d `nvram get wan_ipaddr` -j MARK --set-mark 0xd001 iptables -t nat -A POSTROUTING -m mark --mark 0xd001 -j MASQUERADE
UPDATE: NAT loopback is once again working since build 19969. This fix should only be needed for builds between 15760-19969.
Published on May 14, 2012