Created
December 4, 2017 19:31
-
-
Save drozdziak1/a94ebdf0a5d51805591b5c32567e37ad to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
IN_IFACE=$1 | |
OUT_IFACE=$2 | |
echo "Setting up $1 -> $2" | |
iptables -t nat -A POSTROUTING -o $OUT_IFACE -j MASQUERADE | |
iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT | |
iptables -A FORWARD -i $IN_IFACE -o $OUT_IFACE -j ACCEPT | |
dhcpd -f -d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment