Skip to content

Instantly share code, notes, and snippets.

@sdoro
Created October 1, 2014 15:19
Show Gist options
  • Save sdoro/dba1d3636ed475021645 to your computer and use it in GitHub Desktop.
Save sdoro/dba1d3636ed475021645 to your computer and use it in GitHub Desktop.
How to: Linux flush or remove all iptables rules
#
# thanks to: http://www.cyberciti.biz/tips/linux-iptables-how-to-flush-all-rules.html
#
echo "Stopping firewall and allowing everyone..."
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment