Skip to content

Instantly share code, notes, and snippets.

@mrdotb
Created November 18, 2018 17:56
Show Gist options
  • Save mrdotb/86764223a75f4ca41dd35691ec2e876d to your computer and use it in GitHub Desktop.
Save mrdotb/86764223a75f4ca41dd35691ec2e876d to your computer and use it in GitHub Desktop.
reset iptables
# IPv6
##
## set default policies to let everything in
ip6tables --policy INPUT ACCEPT;
ip6tables --policy OUTPUT ACCEPT;
ip6tables --policy FORWARD ACCEPT;
##
## start fresh
ip6tables -Z; # zero counters
ip6tables -F; # flush (delete) rules
ip6tables -X; # delete all extra chains
# IPv4
##
## set default policies to let everything in
iptables --policy INPUT ACCEPT;
iptables --policy OUTPUT ACCEPT;
iptables --policy FORWARD ACCEPT;
##
## start fresh
iptables -Z; # zero counters
iptables -F; # flush (delete) rules
iptables -X; # delete all extra chains
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment