Created
December 19, 2012 00:50
-
-
Save anonymous/4333477 to your computer and use it in GitHub Desktop.
Firewall rules for iptables with ssh and OpenVPN forwarding.
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
sudo iptables -F | |
sudo iptables -I INPUT 1 -i tun0 -j ACCEPT | |
sudo iptables -I INPUT 1 -i lo -j ACCEPT | |
sudo iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT | |
sudo iptables -A INPUT -p tcp --dport ssh -j ACCEPT | |
sudo iptables -A INPUT -j DROP | |
sudo iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT | |
sudo iptables -A FORWARD -i tun0 -j ACCEPT | |
iptables -A POSTROUTING -s 10.201.1.0/24 -o eth0 -j MASQUERADE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment