Cisco routers OSPF with default routes

I currently have 1 ISP. I have a default route pointed to the ISP and I have OSPF running in my internal network. My internal router is seeing the default route advertise by DEFAULT-INFORMATION ORIGINATE from OSPF on my Internet router. Now I am adding another ISP and use it as the backup, how will I advertise my 2nd default route so that it is seeing as a backup default route.
I have 2 cores running HSRP for gateway redundancy.

My setup:
ISP1<---->R1 (internet router)<---->core1 L3 switch<--->R3 (internet router)<-->ISP2
                                  |------------------core2 L3 switch<---------------|

Thanks
LVL 1
leblancAccountingAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

JustInCaseCommented:
For this case you can use fact that in OSPF E1 route type is preferred over E2 type of external routes. Router that you want to be default route you want to advertise to OSPF as Type 1 (E1) let's say on R1, and then on R3 router you need to advertise default route as Type 2 (E2). Since OSPF prefers E1 external routes to E2, default route on all devices will be set to R1 default route, and R3 will have backup default route.

So, even if E2 metric is better, it will still use route with E1 metric as preferred route.

R1
router ospf 1
default-information originate metric-type 1 metric 100

R3
router ospf 1
default-information originate metric-type 2 metric 50

default route on OSPF routers will be used from R1, and R3 will be backup default route
JustInCaseCommented:
Also, for your default route you should set tracking object with ip sla, so route can be removed from routing table (and router would not advertise itself as ASBR). So other router's default route can be set instead of primary default route.
leblancAccountingAuthor Commented:
Awesome tips. Thanks.
"set tracking object with ip sla, so route can be removed from routing table". How would you do this? I think I can setup the IP SLA to ping 8.8.8.8 from R1, but then how do I configure R1 to remove the default route from the routing table? Thx
HTML5 and CSS3 Fundamentals

Build a website from the ground up by first learning the fundamentals of HTML5 and CSS3, the two popular programming languages used to present content online. HTML deals with fonts, colors, graphics, and hyperlinks, while CSS describes how HTML elements are to be displayed.

JustInCaseCommented:
You can ping 8.8.8.8 in your case (because there can be situation that mpls neighbor is reachable, and internet is down), but also you need to ensure that you always use WAN interface of R1 router for ping , since when default route is removed from routing table ping will work through R3 router and default route will jump back and forth between R1 and R3 router.
If tracking object with ip sla misses enough pings route will be invalid and it will be removed from route table. Here Jody Lemoine created excellent template, you just need to adopt it for your configuration.
leblancAccountingAuthor Commented:
R1
router ospf 1
default-information originate metric-type 1 metric 100

R3
router ospf 1
default-information originate metric-type 2 metric 50

So higher metric is more preferred. Correct? What if I do not include metric-type 1 and 2 in my ospf process.

I setup a lab for this scenario in GNS3 and it does not seem to work correctly. R1 & R3 each has its default route pointed to its ISP1 & ISP2 respectively. After clearing the ospf process, core1 and R3 have the last resort of R1 default route. However, after a few minutes, R3 switches its last resort to ISP2. I am not sure what is going on there.
JustInCaseCommented:
No.
Metric type 1 is preferred over Type 2, if metric type is the same lower metric value is preferred.
I was illustrating that also in this example, if E2 type metric was worse than E1 type it would not be noticed. :)
If you don't include metric-type (then E2 route type is default) then you have situation where some clients may use R1 and other R3 as default gateway. For R3 to use R1 as WAN (and not itself) static route need to have AD higher than OSPF redistributed route AD (200).

And after a few minutes, most likely, something was changed in your network. OSPF is fast protocol it would not wait few minutes to change configuration for no reason. Could be some GNS3 bug, or you reconfigured something on some router that affected configuration....

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Network Analysis

From novice to tech pro — start learning today.