Sorry if this has been discussed before - but I have been trying for hours with various options to connect to a proxy server, I have put the following in my jffs/scripts/firewall-start file:
Some other entries in that file work fine so I know that the script is executing properly.
I was expecting when I go to check my IP that it would be the same as the proxy - but it's not, what am I doing wrong? thanks.
Code:
PROXY_IP=87.246.54.12
PROXY_PORT=3128
LAN_IP=`nvram get lan_ipaddr`
LAN_NET=$LAN_IP/`nvram get lan_netmask`
/usr/sbin/iptables -t nat -A PREROUTING -i br0 -s $LAN_NET -d $LAN_NET -p tcp --dport 80 -j ACCEPT
/usr/sbin/iptables -t nat -A PREROUTING -i br0 -s ! $PROXY_IP -p tcp --dport 80 -j DNAT --to $PROXY_IP:$PROXY_PORT
/usr/sbin/iptables -t nat -I POSTROUTING -o br0 -s $LAN_NET -d $PROXY_IP -p tcp -j SNAT --to $LAN_IP
/usr/sbin/iptables -I FORWARD -i br0 -o br0 -s $LAN_NET -d $PROXY_IP -p tcp --dport $PROXY_PORT -j ACCEPT
Some other entries in that file work fine so I know that the script is executing properly.
I was expecting when I go to check my IP that it would be the same as the proxy - but it's not, what am I doing wrong? thanks.