Skip to content

Instantly share code, notes, and snippets.

@fnzv
Created February 21, 2018 10:10
Show Gist options
  • Save fnzv/36a9bcb2e8203212a1a8761d3cc9b3cb to your computer and use it in GitHub Desktop.
Save fnzv/36a9bcb2e8203212a1a8761d3cc9b3cb to your computer and use it in GitHub Desktop.
clean-fw-ipt
*filter
-A INPUT -i lo -j ACCEPT
-A INPUT ! -i lo -d 127.0.0.0/8 -j REJECT
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A OUTPUT -j ACCEPT
-A INPUT -p tcp --dport 80 -j ACCEPT
-A INPUT -p tcp --dport 443 -j ACCEPT
-A INPUT -p tcp -m state --state NEW --dport 22 -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT
-A INPUT -m limit --limit 5/min -j LOG --log-prefix "iptables denied: " --log-level 7
-A INPUT -j REJECT
-A FORWARD -j REJECT
COMMIT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment