Valid connection issues when dropping invalid packets in firewall
Posted: Thu Mar 17, 2016 10:10 pm
Hello,
I have 2 routers CRS125-24G with RouterOS 6.33.3 so 24 one uplink and 23 ports as a switch on each device.
I found out weird thing when routing between networks. I have two networks Device A - 192.168.10.0/24 and Device B - 192.168.100.0/24.
There is a a static route on Router A which routes trafic from 10.0/24 to 100.0/24 over router B:
I found out, that when I have firewall rule which drops invalid packets of invalid connections I have problem also with valid ones. Here is that rule
When it is enabled and ssh from 192.168.10.18 to 192.168.100.10 it takes 7 seconds to connect. When I disable this rule, connection to ssh server is immediate.
I can see following dropped packets in the log if dropping of invalid packets is enabled:
I did packets trace and I see many retransmissions and duplicate packets. It is weird that connection is initiated at the end and all further packets in same connection is without latencies. I have connection tracking enabled and I can see connection in connection tracking table.
It seems to me that valid packets are falsely matched by that rule. What could be the reason for such behaviour? Is it a bug, or some misconfiguration on my side?
I have 2 routers CRS125-24G with RouterOS 6.33.3 so 24 one uplink and 23 ports as a switch on each device.
I found out weird thing when routing between networks. I have two networks Device A - 192.168.10.0/24 and Device B - 192.168.100.0/24.
Code: Select all
(SSH Client 192.168.10.18) ------ (192.168.10.1 Router A) ------------ (192.168.10.11 Router B 192.168.100.1) ---- (SSH Server 192.168.100.10)
Code: Select all
Flags: X - disabled, A - active, D - dynamic, C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme, B - blackhole, U - unreachable, P - prohibit
# DST-ADDRESS PREF-SRC GATEWAY DISTANCE
8 A S 192.168.100.0/24 192.168.10.11 1
Code: Select all
9 ;;; drop invalid connection
chain=forward action=drop connection-state=invalid log=yes log-prefix="INVALID"
I can see following dropped packets in the log if dropping of invalid packets is enabled:
Code: Select all
20:31:49 firewall,info INVALID forward: in:bridge out:bridge, src-mac c4:85:08:dd:94:42, proto TCP (ACK), 192.168.10.18:46888->192.168.100.10:22, len 52
20:31:49 firewall,info INVALID forward: in:bridge out:bridge, src-mac c4:85:08:dd:94:42, proto TCP (ACK,PSH), 192.168.10.18:46888->192.168.100.10:22, len 95
20:31:50 firewall,info INVALID forward: in:bridge out:bridge, src-mac c4:85:08:dd:94:42, proto TCP (ACK,PSH), 192.168.10.18:46888->192.168.100.10:22, len 95
20:31:50 firewall,info INVALID forward: in:bridge out:bridge, src-mac c4:85:08:dd:94:42, proto TCP (ACK,PSH), 192.168.10.18:46888->192.168.100.10:22, len 95
20:31:50 firewall,info INVALID forward: in:bridge out:bridge, src-mac c4:85:08:dd:94:42, proto TCP (ACK,PSH), 192.168.10.18:46888->192.168.100.10:22, len 95
20:31:50 firewall,info INVALID forward: in:bridge out:bridge, src-mac c4:85:08:dd:94:42, proto TCP (ACK), 192.168.10.18:46888->192.168.100.10:22, len 52
20:31:51 firewall,info INVALID forward: in:bridge out:bridge, src-mac c4:85:08:dd:94:42, proto TCP (ACK,PSH), 192.168.10.18:46888->192.168.100.10:22, len 95
20:31:52 firewall,info INVALID forward: in:bridge out:bridge, src-mac c4:85:08:dd:94:42, proto TCP (ACK), 192.168.10.18:46888->192.168.100.10:22, len 52
20:31:53 firewall,info INVALID forward: in:bridge out:bridge, src-mac c4:85:08:dd:94:42, proto TCP (ACK,PSH), 192.168.10.18:46888->192.168.100.10:22, len 95
It seems to me that valid packets are falsely matched by that rule. What could be the reason for such behaviour? Is it a bug, or some misconfiguration on my side?