Код: Выделить всё
#!/bin/sh
# up interface
ifconfig eth0 down
ifconfig eth0 172.16.0.20/24 up
ifconfig eth1 down
ifconfig eth1 172.16.100.20/23 up
# rules iptables
iptables -F
iptables -t nat -A POSTROUTING -s 172.16.0.0/16 ! -d 172.16.0.0/16 -j MASQUERADE
iptables -t mangle -A FORWARD -p tcp -m tcp --tcp-flags RST,SYN SYN -j TCPMSS --clamp-mss-to-pmtu
# enable forward
echo 1 > /proc/sys/net/ipv4/ip_forward
exit 0