firewall: Add proper logging prefix for conntrack INVALID hits

Fixes: #12778

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
This commit is contained in:
Peter Müller
2022-02-17 20:16:02 +00:00
parent 53378856a8
commit 5ca74566b3

View File

@@ -121,9 +121,13 @@ iptables_init() {
iptables -A FORWARD -p tcp -j BADTCP
# Connection tracking chains
iptables -N CTINVALID
iptables -A CTINVALID -m limit --limit 10/second -j LOG --log-prefix "DROP_CTINVALID "
iptables -A CTINVALID -j DROP -m comment --comment "DROP_CTINVALID"
iptables -N CONNTRACK
iptables -A CONNTRACK -m conntrack --ctstate ESTABLISHED -j ACCEPT
iptables -A CONNTRACK -m conntrack --ctstate INVALID -j LOG_DROP
iptables -A CONNTRACK -m conntrack --ctstate INVALID -j CTINVALID
iptables -A CONNTRACK -p icmp -m conntrack --ctstate RELATED -j ACCEPT
# Restore any connection marks