This is a very simple question, that I cannot seem to implement the way I assume it should be.
I have a router (C), talking to two other routers(A-B) VIA OSPF. Both of the routers can be (and advertise) default gateways. One is the main gateway, the other is a backup.
How do I set OSPF to only use one of the two gateways, unless the main one is not available, then it will failover onto the second gateway.
ROUTER A (Gateway1)--------ROUTER C---------ROUTER B (Gateway2)
Normally I want to accept default gateways from Router A and B. But I only want to use Gateway1. I only want Gateway2 active if Gateway1 is not reachable.
I ASSUME I do this with setting routing distance. The problem I am having, is how do I set routing distance for OSPF routes, coming from a specific interface?
I ASSUME that setting Cost in the OSPF>INTERFACE menu of the interface facing Router B, to a high number (150) would fix the problem. But no matter what I set this value for, it always sets the Distance to 110.
What parameter controls the Distance of a route coming in on OSPF for one particular interface? Or can I accomplish this with filters? I don’t see how I can match an interface in the filters.
Or would I normally set this parameter on Router B?
That is what I did, and it didn’t seem to make any difference.
I set the cost on the interface facing the backup router higher (Example 200)
compared to the lower cost on the interface to the main gateway (Example 10)
It still takes the default gateway for the backup router.
I should draw a better diagram. Perhaps this is also an issue.
GATEWAY1(A) ------ ROUTER C ------ ROUTER D ------- ROUTER E ------- ROUTER F ------ ROUTER G ------ GATEWAY2(B)
I am now working on router G
I want ALL routers to use the default Gateway1 (A) and not Gateway2 (B) unless the chain breaks (Example, cut between E and F)
Yes I realize this is not “efficient” but it is how it needs to work.
What router would I set this cost?
I try on router G to set the interface towards B to 200 and the interface to A to 10… It still takes the gateway from B.
Do I need to make any more cost adjustments on other routers?