I have a router with 2 gateways on 2 seperate interfaces. Both gateways are mikrotik also. I created 2 /30 networks so the router can talke to each gateway on a seperate subnet and seperate ethernet port. Load balancing between the 2 works perfectly and failover also works. But I really need one route to be the default route and the other to be a backup route if the first goes away but I’m having trouble understanding how to do this. I figured out that I need to copy each OSPF interface so that they are not dynamic, then I can adjust properties like cost and priority, but I’m confused as to what to put in there.
For example ospf is on ether1 and ether2. Ether1is more preferred.
In ospf interface settings leave cost to 10 for ether1 and set larger cost number for ether2, for example 20. this will work only if routes are distributed as type1.
Do I need to change cost on all 3 routers or just the one that is load balancing to the other 2? And so I understand it what is the significance on the numbers? Does 10 or 20 have to be used or does it just need to be higher?
Higher means lower priority.
Cost should be adjusted on routers from which you receive the route.
i’ve tried every combination of cost and priority I can think of and it seems to be random as to which one it chooses. Some times it balances and some times it chooses one or the other. To make this complicated the 2 gateway routers are also receiving their default routes from other ospf instances on other routers further down the chain. So path 1 (which I want prefered) is going through 2 routers before hitting final gateway and path 2 (which I want secondary) only goes through 1 router before hitting final gateway. So path 2 is closer and it seems to choose that path most often, but path 1 which is further has more bandwidth available. So do I need to change cost on any of the other routers for this to work correctly?
Well, I had all routers running 4.17 so I updated them to 5.0. Huge mistake! OSPF chaos is what that was. So I put all the RB1000s back to 4.17 and the one router in question on 4.2. 4.2 happened because I didnt have a serial cable so I swapped it with a router I had in the truck. Guess what, the routes now work as expected. Explain that?
Thank you this solved my issue i had. L2tp was reconnecting constantly and after ajusting cost the connection was stable. My network layout is as this…
AP1 → AP2 -->AP3 -->AP1
So that when link A is down then link B can take over.
Cheers