Remove/find invalid iptables entries?

I’ve tried to install a firewall such as ufw on my Xen Debian VPS, however it just would not start up no matter what I had done, so I had looked for a more suited firewall, arno-iptables-firewall.

Unfortunately, when I start it up it lists about fifty iptables warnings:

/sbin/iptables: (1) iptables: No chain/target/match by that name.
/sbin/iptables: (1) iptables: No chain/target/match by that name.
/sbin/iptables: (1) iptables: No chain/target/match by that name.
/sbin/iptables: (1) iptables: No chain/target/match by that name.
/sbin/iptables: (1) iptables: No chain/target/match by that name.
(and thirty or so more)

I am not entirely sure where they come from, however the firewall functions flawlessly for what I need to use it for.

My question is: how do I remove the offending entries so it does not bother me when I restart them? is there a way to do this without rebuilding the list?

And also: If I were to flush the list, would things be fine networking wise once I install the firewall again, or will I remove essential entries left by the system beforehand? I am not entirely sure where the entries came in to my system.

Answer

  1. Do an iptables -nL --line to see the rules. Check the line numbers.

  2. Delete the ones causing the issue using iptables [-t table] -D <chain> <line no>

Attribution
Source : Link , Question Author : Alexander , Answer Author : Khaled

Leave a Comment