Help need :) How to delete all rules in chain ?

Aleksandar Milivojevic amilivojevic at
Tue Sep 28 22:14:05 CEST 2004

Abylai Ospan wrote:
> Hello, all !
> May be this question in FAQ but I can't find it ;-( I have 3 (or more)
> identical rules in one (for example - INPUT) chain.
> If I do command:
> iptables -D FORWARD -s -d -j ACCEPT 
> the first rule is deleted only. Is there any command line option to
> remove all identical rules in one chain ?

No such options.  But nothing prevents you from doing it in loop:

while iptables -D FORWARD insert options here -j ACCEPT 2>/dev/null
    : # do nothing

Just don't call me script kiddie ;-)

Aleksandar Milivojevic <amilivojevic at>    Pollard Banknote Limited
Systems Administrator                           1499 Buffalo Place
Tel: (204) 474-2323 ext 276                     Winnipeg, MB  R3T 1L7

More information about the netfilter mailing list