I want to ban already established connections.
Default iptables rules generated by firewalld
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED,DNAT -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -j INPUT_direct
How to insert rule before -j ACCEPT
?
Or how to move INPUT_direct to top?
Or how to remove conntrack rule?
You can insert an iptables rule with iptables -I parameter So if you specify
iptables -I INPUT -j INPUT_direct
this rule will be inserted to to top.If you specify it with a row numer:
iptables -I INPUT 2 -j INPUT_direct
it will be inserted as rule in line 2.In order to move the rule:
iptables -D INPUT -j INPUT_direct
iptables -I INPUT -j INPUT_direct
As workaround I inserted rule in
raw
(or mangle) table:This chain is before INPUT and as i have no FORWARD on this machine - it solves my problem.