Skip to content

Instantly share code, notes, and snippets.

@taylortrimble
Created March 14, 2014 14:29
Show Gist options
  • Save taylortrimble/9548811 to your computer and use it in GitHub Desktop.
Save taylortrimble/9548811 to your computer and use it in GitHub Desktop.
A simple iptables config script, using some tutorial's best practices.
sudo iptables -A INPUT -i lo -j ACCEPT # Local loopback
sudo iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT # Established connections
sudo iptables -A INPUT -p tcp --dport 22 -j ACCEPT # SSH
sudo iptables -A INPUT -p tcp --dport 28600:28699 -j DROP # Block 286XX
sudo iptables -A INPUT -j DROP # Drop everything else
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment