python-iptables icon indicating copy to clipboard operation
python-iptables copied to clipboard

clean rules from builtin chain with flush error.

Open crazy-canux opened this issue 5 years ago • 3 comments

this is not working.

 for chain in self.table.chains:
        if chain.is_builtin():
              chain.flush()

crazy-canux avatar Nov 27 '19 01:11 crazy-canux

Can you elaborate? Any error messages you get?

ldx avatar Nov 27 '19 01:11 ldx

No error. Looks everything works fine. but the all rules still exist.

crazy-canux avatar Nov 27 '19 06:11 crazy-canux

Hi @crazy-canux , Is it possible that you have added your rules with an iptables version that uses nf_tables ? I have come across this issue with recent versions of iptables package and the solution has been to use iptables-legacy instead :)

# iptables --version
iptables v1.8.2 (nf_tables)
# iptables-legacy --version
iptables v1.8.2 (legacy)

Please paste the results of these 4 commands:

# iptables --version
# iptables-legacy --version
# iptables-save
# iptables-legacy-save

Thank you!

jllorente avatar Jan 30 '21 21:01 jllorente