For anything that has a state table (RouterOS does), the state table trumps anything else. I don’t think there’s an RFC on that, but it’s just the sensible thing to do.
That’s what I thought, agreed, it makes sense, just wondered about Mikrotik in particular, and if anyone had ‘defined’ the desired behavior. Thanks for the reply!
NAT works only with new connections. if connection is already ‘established’ - it won’t be affected by NAT rules. so if the router saw packet from client2 to server - packets returning from server and having the same ports won’t be NATted
the easiest way to remember it is to always think of a connection as 4 components: a src-ip, src-port, dst-ip, dst-port. No two separate connections will ever have the same components.
Besides this, in RouterOS (and other stateful router/firewalls), the router assumes that a packet with swapped src-*** and dst-*** is a return packet, and treats it as part of the original connection.