python-iptables
python-iptables copied to clipboard
clean rules from builtin chain with flush error.
this is not working.
for chain in self.table.chains:
if chain.is_builtin():
chain.flush()
Can you elaborate? Any error messages you get?
No error. Looks everything works fine. but the all rules still exist.
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!