Skip to content

Instantly share code, notes, and snippets.

@QuentinMoss
Last active December 4, 2015 02:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save QuentinMoss/4c1678492a8df5a9d393 to your computer and use it in GitHub Desktop.
Save QuentinMoss/4c1678492a8df5a9d393 to your computer and use it in GitHub Desktop.
iptables default drop policy
# sample configuration for iptables service
# you can edit this manually or use system-config-firewall
# please do not ask us to add additional ports/services to this default configuration
*filter
:INPUT DROP [17:1530]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [133:17662]
-A INPUT -p tcp -m comment –comment SSH -m tcp –dport 1122 -j ACCEPT
-A INPUT -i lo -j ACCEPT
# Rule 1 allows incoming ping. Rule 2 allows all related, or established traffic back to the server. ping, dns resolv, etc
-A INPUT -p icmp –icmp-type echo-request -j ACCEPT
-A INPUT -m conntrack –ctstate RELATED,ESTABLISHED -j ACCEPT
COMMIT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment