Skip to content

Instantly share code, notes, and snippets.

@garytan
Created February 16, 2017 12:43
Show Gist options
  • Save garytan/df93e4aa15423bbb7fe9fc5c4c49aaca to your computer and use it in GitHub Desktop.
Save garytan/df93e4aa15423bbb7fe9fc5c4c49aaca to your computer and use it in GitHub Desktop.
// Default
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
// ACCEPT
iptables -A INPUT -i ens33 -s 192.168.1.0/24 -j ACCEPT
// STATEFUL
iptables -A INPUT -i ens33 -m state --state ESTABLISHED,RELATED -j ACCEPT
// ONLY ONE PORT
iptables -A INPUT -i ens33 -p tcp --dport 80 -j ACCEPT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment