I have a switch, and one port on it has different subnet. So disconnected it from bridge, added src-nat, and a route. But when I looked up sniffer, the ping from eth8 192.168.128.10 gets forwarded to eth1 instead of eth5...
And NAT rule is hit when I start ping command. But packet still gets forwarded to eth1.
Tried to disable hardware offloading for these interfaces eth1 eth8 eth5 but no difference.
First tried directly yes, that also did not work. This makes no difference.
Also easier to change bridge port (add or remove) if needed than changing pinned eth interface in multiple places; if reconfiguring needed for example.
As for the rest, two LANs managed by the same router (feel free to call it a WAN if you like) are directly reachable via forwarding,
without any need for NAT whatsoever...
What’s missing is: What do you want to achieve?
If you don't explain that,
it’s just a waste of time trying to correct or interpret something that you might not even need,
or that might turn out to be irrelevant once the right solution is found.
I need 192.168.100.1 external device to see/think/communicate with 192.168.100.100 explicitly. Otherwise external device will refuse connection (not related to this issue). Hence why src-nat used, and that's why router address is 192.168.100.100/24 on bridge2. There is no gateway in bridge2.
If the gateway on ether8 peripheral device is 192.168.128.1,
why would it send the packet to 192.168.128.6 instead?
His not the gateway, and the ether8 device do not know anything about 192.168.100.x
Internally, it doesn't know where it is, so it is normal for it to send the packet to the Gateway's MAC address rather than the RouterBOARD's...
Basically, you have to disable any kind of hardware acceleration and route everything through the CPU
(even packets that don't concern the RouterBOARD) in order to "see" the packets.
But is it worth it?
Ok so the solution was to add:
/ip route
add disabled=no distance=1 dst-address=192.168.100.0/24 gateway=192.168.128.6
routing-table=main scope=30 target-scope=10
to main gateway-router.
Packets was operating at L2 and ignored L3, so first they need to go to gateway where L3 is done, which send packet back and then it can be forwarded (as L3).
Now would be interesting how could I skip this sending back and forth. and do L3 directly on original router/switch ?
Probably need to force L2 dst-mac to 192.168.128.6 router's mac when dst-ip is 192.168.100.1;