IP Forwarding

This is what I did to get ip forwarding working :

iptables --table nat --delete-chain
iptables --table nat --append POSTROUTING --out-interface ppp0 -j MASQUERADE
iptables --append FORWARD --in-interface eth0 -j ACCEPT
/etc/init.d/iptables save

Now enable ip forwading, this makes the change NOW, but will not stay after a reboot.

echo 1 > /proc/sys/net/ipv4/ip_forward

Edit /etc/sysctl.conf and change this line :

# Controls IP packet forwarding
net.ipv4.ip_forward = 1