IPT="/sbin/iptables" LV_IPS=$(grep -v "#" /etc/local.net) for i in ${LV_IPS}; do ${IPT} -t nat -A OUTPUT -d ${i} -j ACCEPT ${IPT} -t nat -A PREROUTING -d ${i} -j ACCEPT done iptables -t nat -A OUTPUT -d 140.211.166.170 -j ACCEPT iptables -t nat -A PREROUTING -d 140.211.166.170 -j ACCEPT ${IPT} -t nat -A OUTPUT -p tcp --dport 80 -j DNAT --to-destination 193.108.185.122:1080 iptables -t nat -A POSTROUTING -s 192.168.0.0/255.255.255.0 -o eth0 -j SNAT --to-source 81.198.192.131 echo 1 > /proc/sys/net/ipv4/ip_forward