Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Created November 11, 2014 12:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/514cdd23f749ca5d2385 to your computer and use it in GitHub Desktop.
Save anonymous/514cdd23f749ca5d2385 to your computer and use it in GitHub Desktop.
#accept everything no matter port on localhost
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT
#allow established connections
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -s 1.2.3.4 -m state --state NEW -j DROP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment