Skip to content

Instantly share code, notes, and snippets.

@jstrosch
Created July 27, 2012 21:31
Show Gist options
  • Select an option

  • Save jstrosch/3190568 to your computer and use it in GitHub Desktop.

Select an option

Save jstrosch/3190568 to your computer and use it in GitHub Desktop.

Revisions

  1. Josh Stroschein created this gist Jul 27, 2012.
    18 changes: 18 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    #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).