2009-05-11 09:01:54 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Run this script as root ("sudo ./setup-nat-ubuntu"). It has been tested on Ubunru 8.04.
|
|
|
|
|
2009-05-12 19:24:04 +02:00
|
|
|
/sbin/iptables --table nat --append POSTROUTING --out-interface eth10 -j MASQUERADE
|
2009-05-11 09:01:54 +02:00
|
|
|
/sbin/iptables --append FORWARD --in-interface tun0 -j ACCEPT
|
2009-05-12 19:24:04 +02:00
|
|
|
/sbin/iptables --append FORWARD --in-interface tap0 -j ACCEPT
|
2009-05-11 09:01:54 +02:00
|
|
|
|
|
|
|
/sbin/sysctl -w net.ipv4.conf.default.forwarding=1
|
|
|
|
/sbin/sysctl -w net.ipv4.conf.all.forwarding=1
|
|
|
|
|
|
|
|
/sbin/sysctl -w net.ipv4.ip_forward=1
|
|
|
|
|
|
|
|
echo 1 > /proc/sys/net/ipv4/ip_forward
|
|
|
|
|