Load balancing with dual ISP

Hello,

I’ve done load balancing with dual ISP connections by using mangle rules in firewall (marking connections as conn1 and conn2 with pcc (both addresses and ports:2/0 & 2/1) and subsequently using route marking as route1 and route2 respectively). Sending route1 traffic through ISP1 and route2 traffic through ISP2. The setup is working fine as expected with both ISPs up and running and in case any one of them goes down.

I want to understand when one ISP (let’s say ISP1) is down how the connections are marked and routed through the working ISP2. As per the pcc config what happens to connections getting marked with conn1 and routing mark as route1 if I’m sending route1 traffic through the ISP1 which is down.

The answer is easy. When one ISP (eg. ISP1) gets down the corresponding routing entry is marked as unreachable and so the routing table “ISP1” is empty.
Next the routing table “main” takes over the routing, where only the routing entry of the “online” ISP (eg. ISP2) is reachable, so the traffic goes over this entry, regardless how the routing mark may look like :wink:

hey
Thanks for quick reply.

Do you mean that if the route1 is unreachable, the packets will use main routing table?
But how these packets are routed through the main routing table if the packets are marked with conn1 and supposed to use default route to ISP1 in route1 table? MikroTik does not automatically fall back to the main routing table if the custom table is empty (what I understand)

As I already mentioned, the routing mark is ignored if there´s no second routing entry.
How should the router take a routing decission when there´s no alternative? :wink:
If this is not desired you can create a “black hole” routing entry in the corresponding routing table with a higher distance, so the traffic would be deleted if the original routing entry is not available.