remove duplicate rules

Oleg A. Arkhangelsky sysoleg at
Sat Nov 26 13:55:08 CET 2005

Hello amit,

Saturday, November 26, 2005, 3:39:14 PM, you wrote:

ap> same iptables.  I want to stop this , if the same rule exists the iptables
ap> should give some error or should add the same rule again .
ap> Please help me .

    I think you should manually check the existence of possible
    duplicate before adding rule. Also you can do somethig like:

    iptables -D INPUT -d -i eth1 -j DROP
    iptables -A INPUT -d -i eth1 -j DROP

    Then you will never get duplicates.
    But the first way is more correct.

Best regards,

More information about the netfilter mailing list