echo 0 > /proc/sys/net/ipv4/conf/all/rp_filter LANIP=<your internal network addresses> LAN=<your internal network interface> SRCPPP=`ifconfig ppp0 | grep inet | gawk '{ print $2 }' | cut -f 2 -d ":"` GWPPP=`ifconfig ppp0 | grep inet | gawk '{ print $3 }' | cut -f 2 -d ":"` for x in 80 443 do $IPT -t nat -A PREROUTING -s $LANIP -i $LAN -p tcp -m tcp --dport $x -j ACCEPT $IPT -A FORWARD -s $LANIP -i $LAN -p tcp -m tcp --dport $x -j ACCEPT $IPT -t nat -A POSTROUTING -s $LANIP -p tcp --dport $x -j SNAT --to-source $SRCPPP $IPT -t mangle -A POSTROUTING -p tcp --dport $x -j ROUTE --gw $GWPPP --continue done |