Enable IP forwarding under Ubuntu

To enable ip forwarding from one interface to another you can use following commands:

iptables -A FORWARD -i ppp0 -o eth0 -s 192.168.1.0/24 -m conntrack --ctstate NEW -j ACCEPT
sudo iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
sudo iptables -A POSTROUTING -t nat -j MASQUERADE 
sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"

This code anables ip forwarding from eth0 to ppp0 interface-> ie from local network to private network