3 # Run this script as root ("sudo ./setup-nat-ubuntu"). It has been tested on Ubunru 8.04.
5 /sbin
/iptables
--table nat
--append POSTROUTING
--out-interface eth10
-j MASQUERADE
6 /sbin
/iptables
--append FORWARD
--in-interface tun0
-j ACCEPT
7 /sbin
/iptables
--append FORWARD
--in-interface tap0
-j ACCEPT
9 /sbin
/sysctl
-w net.ipv4.conf.default.forwarding
=1
10 /sbin
/sysctl
-w net.ipv4.conf.all.forwarding
=1
12 /sbin
/sysctl
-w net.ipv4.ip_forward
=1
14 echo 1 > /proc
/sys
/net
/ipv
4/ip_forward