Issue: not all packets are NAT’et on the mikrotik router. It seems like 99.9% of packets are NAT’et.
But the upstream firewall are seeing lots of martian source packets (rp_filter strict)
On our firewall, we are seeing lots of martitian source packets.
From non-mikrotik firewall:
May 30 15:36:06 firewall-1 kernel: [12077613.285312] IPv4: martian source xxx.xxx.xxx.xxx from 192.168.212.158, on dev eth1.128
This means that the Mikrotik did NOT properly NAT all packets. I would say 99.9% of all packets are properly NAT’ed, but many are not.
I have many mikrotiks with this setup - but they are all failing at the same rates - and they have identical nat rules with interface-lists and VLAN.
I can try. But explain please why you think this will help?
Even if packet is “invalid” and accepted by outgoing firewall rule - it should still be NAT’ed - right?
NAT does rely on connection tracking classification. If connection tracking machinery can’t classify packet leaving packet with connection state invalid, also NAT can’t do it’s job properly.
When the Mikrotik connection tracking sees the end of a TCP conversation (FIN → ACK+FIN → ACK) the tracking entry is removed. Any repeated or unsolicited invalid transmissions from a client, e.g. FIN+ACK, RST+ACK or RST will not create a new connection tracking entry so no NAT will be applied. This is not a bug, just normal linux behaviour.
Indeed. And if packet is fasttracked, it skips vast majority of packet flow boxes and skips from connection tracking box output directly to output interface, see fasttrack description. Which means that those surplus packets with connection already closed will still be declared invalid by connection tracking machinery. They won’t be fasttracked because not individual packets are fasttracked, fasttracked is connection (and consequently packets belonging to it).