Skip to content

Instantly share code, notes, and snippets.

@fcaldarelli
Last active March 21, 2019 11:13
Show Gist options
  • Save fcaldarelli/9467a8fbca0d9610c03acdcf51f1c934 to your computer and use it in GitHub Desktop.
Save fcaldarelli/9467a8fbca0d9610c03acdcf51f1c934 to your computer and use it in GitHub Desktop.
iptables -t nat -A POSTROUTING -s 172.16.0.0/24 -j SNAT --to 1.2.3.4
echo 'net.ipv4.ip_forward=1' >> /etc/sysctl.conf
sysctl --system
# sudo route add -host host_to_reach gw
sudo route add -host 1.2.3.4 172.16.0.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment