You might want to have two routers on your network be default gateways, but with one being preferred. You can do this quite easily with ospf.
Example
Let's say we have three routers. Router A is a router connecting to ISP1, Router B is connecting to ISP2, and Router C connects your local networks together. Both Router A and B have static default routes to their neighbor (ISP's) router. If their links go down, the static route will be temporary removed from their routing (forwarding) tables.
You have redundant ISPs with redundant hardware and need to find a way for Router C to failover to another router if one goes down. We can do this with ospf metrics.
We setup OSPF to run on Router A (We prefer this ISP). Router A Configuration
configure terminal
router ospf 100
! Setup the router to run ospf in process 100
log-adjacency-changes
network xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx area 0
! Tell the router to run with your local ethernet interface's IP netblock
default-information originate metric 100
! Announce to other OSPF routers a default route using a metric of 100
Router B Configuration
configure terminal
router ospf 100
! Setup the router to run ospf in process 100
log-adjacency-changes
network xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx area 0
! Tell the router to run with your local ethernet interface's IP netblock
default-information originate metric 110
! Announce to other OSPF routers a default route using a metric of 110
!(110 > 100 so this router has a less desirable default route).
Router C Configuration
configure terminal
router ospf 100
! Setup the router to run ospf in process 100
log-adjacency-changes
network xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx area 0
! Tell the router to run with your local ethernet interface's IP netblock
Now we can check out the routing table for Router C. It should only show one default route, and it is using Router A. If you were to turn off Router A, Router B will take over.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.