Skip to content

Instantly share code, notes, and snippets.

@guerrerocarlos
Created May 20, 2013 04:42
Show Gist options
  • Save guerrerocarlos/5610465 to your computer and use it in GitHub Desktop.
Save guerrerocarlos/5610465 to your computer and use it in GitHub Desktop.
Enable VPS internet sharing by VPN
sudo iptables -t nat -F POSTROUTING
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo iptables-save | sudo tee /etc/iptables.sav
iptables-restore < /etc/iptables.sav
sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
add to /etc/sysctl.conf:
net.ipv4.ip_forward=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment