Created
August 11, 2018 14:32
-
-
Save joenorton8014/cd2c195fda2fe6115a0bcc852841d047 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
echo "IP forwarding state:" | |
sysctl net.ipv4.ip_forward | |
echo 1 > /proc/sys/net/ipv4/ip_forward | |
echo "Current IP forwarding state is:" | |
sysctl net.ipv4.ip_forward | |
echo "Enabling nat: " | |
iptables -A FORWARD -o eth0 -i eth1 -s 192.168.56.0/24 -m conntrack --ctstate NEW -j ACCEPT | |
iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT | |
iptables -t nat -F POSTROUTING | |
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment