Skip to content

Instantly share code, notes, and snippets.

@JackDesBwa
Last active May 31, 2016 18:40
Show Gist options
  • Save JackDesBwa/b229cdce9a0bcf15383184560c78d398 to your computer and use it in GitHub Desktop.
Save JackDesBwa/b229cdce9a0bcf15383184560c78d398 to your computer and use it in GitHub Desktop.
Script to configure simple masquerade
#!/bin/sh
if [ _$1 == _ ]
then
echo "Usage: $0 <output_if>"
exit 1
fi
sysctl -w net.ipv4.ip_forward=1
iptables -t nat -A POSTROUTING -o $1 -j MASQUERADE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment