Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to setup two OSPF Default Routes with one being preferred

General Configuration

How to setup two OSPF Default Routes with one being preferred

by  baddos  Posted    (Edited  )
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.
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top