Skip to content

Instantly share code, notes, and snippets.

@andr1an
Forked from jstrosch/gist:3190568
Created November 20, 2018 09:21
Show Gist options
  • Save andr1an/8a80a9da0b008e645649b6f8d59383ae to your computer and use it in GitHub Desktop.
Save andr1an/8a80a9da0b008e645649b6f8d59383ae to your computer and use it in GitHub Desktop.
iptables - delete all rules/chains
#view current chains
$ iptables -L
#remove/flush all rules & delete chains
$ 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 OUTPUT ACCEPT
$ iptables -P FORWARD ACCEPT
-F : Deleting (flushing) all the rules.
-X : Delete chain.
-t table_name : Select table (called nat or mangle) and delete/flush rules.
-P : Set the default policy (such as DROP, REJECT, or ACCEPT).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment