Hi,
I’ve been having some issues whereby DNS will stop working periodically (most notably, webpages will stop loading for a short period of time). My config is as follows:
Green Client ↔ Orange Pihole (ipfire libvirt VM) ↔ IPFire ↔ Internet
Clients point to Pihole, Pihole forwards upstream to IPfire, and then IPFire points to Cloudflare (TLS).
I see on the firewall logs, that sometimes the DNS TCP session between Pihole and IPfire is being dropped due to DROP_CTINVALID. (101.1 is IPfire, 101.2 is Pihole) I have inbound rules permitting DNS traffic from Pihole to the Orange FW interface.
These look to occur around the time the TCP connection in the tracking page expires. I tried increasing TIME_WAIT from 2 minutes to 5 minutes, but it didnt stop it occuring, just less often.
Pihole looks to keep retransmitting as it doesnt realise the TCP connection is being blocked.
Mar 3 17:06:13 ipfire kernel: DROP_CTINVALID IN=orange0 OUT= MAC=02:3b:48:cf:a4:eb:52:54:00:e8:bb:20:08:00 SRC=192.168.101.2 DST=192.168.101.1 LEN=52 TOS=0x00 PREC=0x00 TTL=64 ID=39555 DF PROTO=TCP SPT=41474 DPT=53 WINDOW=501 RES=0x00 ACK FIN URGP=0
Mar 3 17:06:15 ipfire kernel: DROP_CTINVALID IN=orange0 OUT= MAC=02:3b:48:cf:a4:eb:52:54:00:e8:bb:20:08:00 SRC=192.168.101.2 DST=192.168.101.1 LEN=52 TOS=0x00 PREC=0x00 TTL=64 ID=39556 DF PROTO=TCP SPT=41474 DPT=53 WINDOW=501 RES=0x00 ACK FIN URGP=0
Mar 3 17:06:19 ipfire kernel: DROP_CTINVALID IN=orange0 OUT= MAC=02:3b:48:cf:a4:eb:52:54:00:e8:bb:20:08:00 SRC=192.168.101.2 DST=192.168.101.1 LEN=52 TOS=0x00 PREC=0x00 TTL=64 ID=39557 DF PROTO=TCP SPT=41474 DPT=53 WINDOW=501 RES=0x00 ACK FIN URGP=0
Mar 3 17:06:25 ipfire kernel: DROP_CTINVALID IN=orange0 OUT= MAC=02:3b:48:cf:a4:eb:52:54:00:e8:bb:20:08:00 SRC=192.168.101.2 DST=192.168.101.1 LEN=52 TOS=0x00 PREC=0x00 TTL=64 ID=39558 DF PROTO=TCP SPT=41474 DPT=53 WINDOW=501 RES=0x00 ACK FIN URGP=0
Mar 3 17:06:39 ipfire kernel: DROP_CTINVALID IN=orange0 OUT= MAC=02:3b:48:cf:a4:eb:52:54:00:e8:bb:20:08:00 SRC=192.168.101.2 DST=192.168.101.1 LEN=52 TOS=0x00 PREC=0x00 TTL=64 ID=39559 DF PROTO=TCP SPT=41474 DPT=53 WINDOW=501 RES=0x00 ACK FIN URGP=0
Mar 3 17:07:05 ipfire kernel: DROP_CTINVALID IN=orange0 OUT= MAC=02:3b:48:cf:a4:eb:52:54:00:e8:bb:20:08:00 SRC=192.168.101.2 DST=192.168.101.1 LEN=52 TOS=0x00 PREC=0x00 TTL=64 ID=39560 DF PROTO=TCP SPT=41474 DPT=53 WINDOW=501 RES=0x00 ACK FIN URGP=0
Anyone assist with what might be causing this? Does DNS over TCP hold the socket open, but not send keepalives, so eventually the firewall is closing the connection?
Is there a fix for this behaviour, e.g. permanently allow the connections without tracking them in the firewall?
I tried Google as to whether Pihole/dnsmasq can configure TCP session timelimits or keepalives but I’ve not yet found a solution.