My mikrotik router is learning two default routes from two cisco routers via iBGP. My ip prefix x/16 is divided into two subnets, say x1/17 & x2/17. I have announced x/16 & x1/17 via provider1 and x/16 & x2/17 via provider2 via eBGP with providers. This way I have maintained load balancing & failover with two providers.
On mikrotik I have done policy routing to point x1/17 to cisco1 & x2/17 to cisco2. This way load is balanced but not fault tolerrent. For example if fiber link to provider1 goes down x1/17 prefix falls into trouble. x1/17 is still reachable from internet via provider2 but my mikrotik always sends the outgoing traffic of x1/17 to cisco1. I want the mikrotik router send the prefix x1/17 to cisco2 in case of link breakage with provider1.
How to have a load balancing with failover via iBGP in mikrotik router? I have public IPs & public ASN. nw.pdf (15.3 KB)
Assuming you are filtering out (or not receiving) default route fro your two providers, you can use multiple default routes with different distances - set the lower distance for the preferred outbound source and set check gateway=yes. This way of the preferred gateway for that particular /17 becomes unavailable it will use the default route with the higher distance.
It takes about thirty seconds to changeover, so maybe there are better ways.
Two cisco routers speak eBGP with upstream provider and learns default route. These two default routes, from each cisco router, is passed to mikrotik router via iBGP among them. Now mikrotik router has two default routes. Now I want to route one /17 via cisco1 and another /17 via cisco2. In addition if fiber link to one of the upstream provider goes down mikrotik will have only one default route. In such case whole prefix /16 should go through another uplink provider whose fiber link is fine.
Any suggestion, plz???
This is possible to do in cisco router using route-map features & changing bgp attributes.