Last active
August 29, 2015 14:04
-
-
Save ericsaboia/aa3d863591dff54a45dc to your computer and use it in GitHub Desktop.
iptables.sh
This file contains hidden or 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 -X | |
sudo iptables -I INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT | |
sudo iptables -A INPUT -p icmp -j ACCEPT # allow ping | |
sudo iptables -A INPUT -p tcp --dport 22 -j ACCEPT # allow SSH | |
sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT # allow HTTP | |
sudo iptables -I INPUT -i lo -j ACCEPT # allow local | |
sudo iptables -A INPUT -j DROP # drop everything else |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment