Admins eHow

August 27, 2009

How to clear all iptables rules

Filed under: CentOS,Debian,General,Security — Tags: , , , — admin @ 2:08 pm

In order to flush all iptables rules , Run the following commands :

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
  • http://r0x.lamzo.com vaL

    If your default policy is DROP make sure to change the INPUT FORWARD and OUTPUT policy before the -F or you will be locked.

  • ian moone

    good point, vaL

  • Beetle

    You forgot the ‘raw’ table

    iptables -t raw -F
    iptables -t raw -X

Powered by WordPress