Last active
August 29, 2015 14:02
-
-
Save nobuh/30a768eef66ecd5183b0 to your computer and use it in GitHub Desktop.
/etc/sysconfig/iptables basic template
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
*filter | |
# deny all inbound | |
:INPUT DROP [0:0] | |
:FORWARD DROP [0:0] | |
# accept all outbound | |
:OUTPUT ACCEPT [0:0] | |
# accept already connected sessions | |
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT | |
# accept all loopback | |
-A INPUT -i lo -j ACCEPT | |
# accept http port from anywhere | |
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT | |
# accept ssh port from anywhere | |
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT | |
# deny from specific IP address | |
-A INPUT -m state --state NEW -s 1.2.3.4 -j DROP | |
COMMIT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment