I'm trying to redirect all port 80 requests on a single LAN IP to an external squid proxy server outside of my network. For debugging purposes, I'm attempting this from the router level as the application does not have proxy support but does send its requests through port 80.
So far, I've tried plugging this in at the 'run command' box on DDWRT:
YourIP=192.168.1.128 YourPort=80 TargetIP=x.x.x.x TargetPort=23128 iptables -t nat -A PREROUTING --dst $YourIP -p tcp --dport $YourPort -j DNAT --to-destination $TargetIP:$TargetPort iptables -t nat -A POSTROUTING -p tcp --dst $TargetIP --dport $TargetPort -j SNAT --to-source $YourIP iptables -t nat -A OUTPUT --dst $YourIP -p tcp --dport $YourPort -j DNAT --to-destination $TargetIP:$TargetPort
It doesn't seem to do anything, though. Requests are still served through my home internet connection from the specified device. Am I going about this the wrong way? Any help is appreciated. When I run "iptables -t nat -L" I see the following:
DNAT tcp -- anywhere 192.168.1.128 tcp dpt:www to:x.x.x.x:23128