Last active
August 11, 2018 00:14
-
-
Save mcrmonkey/9080e0b5e87ce291df0596fa04248cfe to your computer and use it in GitHub Desktop.
do nat stuff quickly
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
#!/bin/bash | |
echo -ne "\n\n\n Your interfaces: \n\n" | |
ip link sh | |
echo -ne "\n---------------------\n\n" | |
echo -ne "\n Enter interface name:\n" | |
read -r -p "Internet Interface: " INET | |
read -r -p "Private Interface: " PNET | |
echo " /sbin/iptables -t nat -A POSTROUTING -o $INET -j MASQUERADE" | |
echo " /sbin/iptables -A FORWARD -i $INET -o $PNET -m state --state RELATED,ESTABLISHED -j ACCEPT" | |
echo " /sbin/iptables -A FORWARD -i $PNET -o $INET -j ACCEPT" | |
echo 1 > /proc/sys/net/ipv4/ip_forward |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment