sudo echo "Remove any previous NAT setup"
sudo iptables --flush
sudo iptables --table nat --flush
sudo iptables --delete-chain
sudo iptables --table nat --delete-chain
sudo echo "Setup NAT to forward packets from usb0 <---> eth0"
sudo iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
sudo iptables --append FORWARD --in-interface usb0 -j ACCEPT
sudo echo "Enable packet forwarding in the kernel"
sudo su
echo 1 >> /proc/sys/net/ipv4/ip_forward
exit