Hi,
for a while now I've been trying to find a good setup in ROS to cover our needs (redundant VPN with policy routing/failover via Multi-WAN, details are not too important). While I have some generally working solution, I would prefer another one, but I'm stumbling about one certain problem again and again.
I will give an example for what I would like to do, and I do on purpose not just post a config, as I intend to show a more abstract picture, not just focus on 1 special config.
Connection from LAN should be routed through one of 2 GRE tunnels, and as different type of traffic should go through different tunnel, use Routing-Marks.
So I do the following: Packet "P" from PC to Router -> mangle Prerouting, mark connection "CON1"-> mangle prerouting, mark routing "RM1" if connection mark = "CON1"
Add route "R1" with routing-mark "RM1", ping check, distance 1 -> gateway1
Add route "R2" with routing-mark "RM1", ping check, distance 2 -> gateway2
Add route "R3" with no routing-mark, ping check, distance 3 -> gateway2
Add route "R4" with no routing-mark, ping check, distance 4 -> gateway1
(Dst-address is always same, gateway is same for R1/R4, and for R2/R3 ... so traffic type with RM1 would be preferably routed via gateway1, all other traffic would preferrably be routed via gateway2)
Now when I look at this:
http://wiki.mikrotik.com/wiki/File:IP_final.png
I would expect the after pre-routing, when the routing decision is done, it would match the route with best match, which should be R1 ... at it matches the dst-address AND the routing mark AND shortest distance.
However, when I then log the packet "P" in forward chain, it will show that the out-interface is gateway2. So it selected "R3". Even worse , if I disable R3 and R4, it will not work at all, which shows to me that the "Routing decision" after "PreRouting" does care about routing marks. And after that point i don't see any chance to force "P" into the correct tunnel.
Am I doing anything wrong, am I misunderstanding something, or this even a bug? Are there better ways to achieve this kind of policy routing?
Thank you in advance for your answers.