Skip to content

Instantly share code, notes, and snippets.

@Chavao
Last active October 11, 2015 07:57
Show Gist options
  • Save Chavao/3827080 to your computer and use it in GitHub Desktop.
Save Chavao/3827080 to your computer and use it in GitHub Desktop.
iptables
iptables -F
iptables -X
iptables -N block
iptables -A block -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A block -m state --state NEW ! -i eth0 -j ACCEPT
iptables -A block -p tcp --destination-port 80 -j ACCEPT
iptables -A block -p tcp --destination-port 8080 -j ACCEPT
iptables -A block -p tcp --destination-port 22 -j ACCEPT
iptables -A block -j DROP
iptables -A INPUT -j block
iptables -A FORWARD -j block
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment