Last active
August 29, 2015 14:10
-
-
Save ThisIsNotTheUserYouAreLookingFor/2d510a1a1de28e8b2348 to your computer and use it in GitHub Desktop.
general iptables rules
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
#block generic recon | |
iptables -A INPUT -p tcp --tcp-flags ALL NONE -j DROP # null | |
iptables -A INPUT -p tcp ! --syn -m state --state NEW -j DROP #kill syn flood | |
iptables -A INPUT -p tcp --tcp-flags ALL ALL -j DROP # xmas | |
# allow all on localhost | |
iptables -A INPUT -i lo -j ACCEPT | |
#allow web traffic | |
iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT | |
iptables -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT | |
#allow inbound ssh | |
iptables -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT | |
#stateful behavior on input | |
iptables -I INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT | |
iptables -P OUTPUT ACCEPT | |
iptables -P INPUT DROP | |
service iptables save |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment