Skip to content

Instantly share code, notes, and snippets.

@colby
Created August 28, 2015 00:27
Show Gist options
  • Save colby/3d0722cfb8ff275fa49c to your computer and use it in GitHub Desktop.
Save colby/3d0722cfb8ff275fa49c to your computer and use it in GitHub Desktop.
iptables -P FORWARD DROP # we aren't a router
iptables -A INPUT -m state --state INVALID -j DROP # drop bad packets
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT # allow current connections
iptables -A INPUT -i lo -j ACCEPT # allow lo interface
iptables -A INPUT -s 1.2.3.4 -j ACCEPT # allow whom-ever ya want
iptables -P INPUT DROP # drop the rest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment