Skip to content

Instantly share code, notes, and snippets.

@wastrachan
Last active February 17, 2019 18:38
Show Gist options
  • Save wastrachan/d4ae3c417670d9137bb0f290bb16e1e0 to your computer and use it in GitHub Desktop.
Save wastrachan/d4ae3c417670d9137bb0f290bb16e1e0 to your computer and use it in GitHub Desktop.
IPTables Base Rules
# Generated by iptables-save v1.6.0
*filter
:INPUT DROP [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -i lo -j ACCEPT
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m conntrack --ctstate NEW,ESTABLISHED -m tcp --dport 41864 -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 0 -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 53 -j ACCEPT
-A INPUT -p udp -m udp --dport 53 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
-A OUTPUT -o lo -j ACCEPT
-A OUTPUT -m conntrack --ctstate ESTABLISHED -j ACCEPT
-A OUTPUT -p tcp -m tcp --sport 41864 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
COMMIT
# Completed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment