Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

OSPF Route Selection

Hi- I have situation where I will be running OSPF and will be recieving routes on one interface redistributed from BGP so these will be OSPF External Type 2 routes - on another interface I will be recieving routes in OSPF so these will be "intra area".

My question is how I do have the external E2 routes installed in preference to the intra area ones ? Ie the external routes are to be preferred while the intra area ones are back up.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: OSPF Route Selection

Rick,

Although OSPF has a single AD for all three kinds of route by default, you can specify different ADs for the different route types. That is what confused me in the first place. But if OSPF arbitrates a priori between O/IA/E, then it is to no avail except in arbitrating between routes from different OSPF processes, as pointed out by Etienne.

Kevin Dorrell

Luxembourg

21 REPLIES

Re: OSPF Route Selection

In the router ospf section:

distance ospf external 109

That would give the external routes an AD of 109 as opposed to the other routes 110.

http://www.cisco.com/en/US/products/sw/iosswrel/ps5187/products_command_reference_chapter09186a008017d027.html#wp1039454

If you have more than one re-disribution point, though, check that this is not going to cause any routing loops.

Kevin Dorrell

Luxembourg

New Member

Re: OSPF Route Selection

hello

does this really work? distance is used to prefer routes from different processes, not from the same process

Etienne

Re: OSPF Route Selection

Yes AFAIK it should work. Can someone correct me if I am wrong please? (Although I am aware that the link says "A common reason to use the distance ospf command is when you have multiple OSPF processes ... " Or does the OSPF process arbitrate between the routes before they make it to the AD arbitration?)

Just as EIGRP has a different AD for internal and external routes (90 and 170 respectively), so (I believe) OSPF can be configured to have different ADs on each of the three types of route.

I can feel a lab session imminent!

Kevin Dorrell

Luxembourg

Hall of Fame Super Blue

Re: OSPF Route Selection

Hi

It certainly works with EIGRP as we have had to temporarily use Kevin's solution, with EIGRP, in our own environment to get us over an integration problem.

As far as i know AD is used to prefer routes from different routing protocols but where a routing protocol has different AD's within it, eg OSFP/EIGRP/BGP it is used there as well.

Jon

Hall of Fame Super Silver

Re: OSPF Route Selection

Unfortunately I do not think it can be done to have OSPF redistributed routes preferred to OSPF internal routes. OSPF has its own preference for routes which is spelled out in the RFCs and OSPF prefers intra-area routes more than inter-area routes and inter-area routes more than external. I do not believe that there is any way to get AD to change this behavior.

HTH

Rick

Re: OSPF Route Selection

OK, thank you for that correction Rick.

So, if I understand correctly, OSPF first pre-selects which route it is going to present as a candidate for the forwarding table on the basis of O/IA/E, and without reference to any AD configuration. It then presents that route to the AD arbitration process with the AD=110 or otherwise as configured.

So its behavior is rather different from EIGRP, which does allow you to change the relative priorities of the internal / external routes, if I understand it correctly.

Is that a correct behavioural model?

Kevin Dorrell

Luxembourg

Hall of Fame Super Silver

Re: OSPF Route Selection

Kevin

I believe that your model is correct.

And note that while EIGRP has separate AD for internal and external routes, OSPF has only a single AD for both kinds of routes.

HTH

Rick

Re: OSPF Route Selection

Rick,

Although OSPF has a single AD for all three kinds of route by default, you can specify different ADs for the different route types. That is what confused me in the first place. But if OSPF arbitrates a priori between O/IA/E, then it is to no avail except in arbitrating between routes from different OSPF processes, as pointed out by Etienne.

Kevin Dorrell

Luxembourg

Re: OSPF Route Selection

Is it possiblel to change the metric type of OSPF route using route map or something?

as we can change it in BGP (origin code) in order to influance the selection of the routes? so the same thing is possible in ospf???

regards

Devang

Hall of Fame Super Silver

Re: OSPF Route Selection

Devang

What you are suggesting is to change the LSA type advertised by OSPF. I do not believe that there is anything in any route map that would allow you to change the LSA type.

If you think about it, it would be extremely difficult to assure the integrity of the network topology map if some router other than the one that generated the LSA was able to change the LSA type.

HTH

Rick

Re: OSPF Route Selection

Rick,

so as per your reply AD is only one way to fulfil the requirement right!!!

regards

Devang

Re: OSPF Route Selection

Apparently not. It is not possible to use AD to arbitrate between intra-area routes, inter-area routes, and external routes.

Re: OSPF Route Selection

I tried it out in the lab just for my own edification, and of course you are right: the arbitration between [O | IA | E] takes precedence over any configured AD differences.

I took three routers on a LAN, and got two of them to source the same prefix, one as a redistrubution and the other as a network statement. In the third router I could see both the Type 5 and the Type 2 in the database, but the Type 2 won. I then set the AD of external routes as 105, but the intra-area route still won with an AD of 110. I then got rid of the intra-area network, and the third router put the external route into the forwarding table with an AD of 105.

So, sorry, the solution I proposed does not work. But I learned a lot in the process, so I'm happy.

Kevin Dorrell

Luxembourg

Re: OSPF Route Selection

Kevin...

so using the AD you can achieved that right!!!

regards

Devang

Re: OSPF Route Selection

No! That's precisely the point! I could not change the OSPF route arbitration by using AD. My original posting was wrong.

Kevin Dorrell

Luxembourg

Hall of Fame Super Silver

Re: OSPF Route Selection

Kevin

I am glad that you worked it out in the lab. That is frequently the best way to find what is really happening. The idea that you suggested is quite logical and appealing. But it is not the way that OSPF works.

HTH

Rick

Re: OSPF Route Selection

Rick,

so what is the final process to get it done i am still in confusion?

regards

Devang

Hall of Fame Super Silver

Re: OSPF Route Selection

Devang

There is not a process that will get an OSPF external route preferred over an internal route. The closest that you could get would be to redistribute the internal routes. Then by controlling which are E1 routes and which are E2 routes you could control which route is preferred.

HTH

Rick

Re: OSPF Route Selection

Rick,

thanks for clerification!!!

regards

Devang

New Member

Re: OSPF Route Selection

Hi all,

Thanks for all your work in clarifying this for me. It is as I expected but sometimes the information is a little cryptic. I will now have in investigate another solution.

Thanks,

Pete

New Member

Re: OSPF Route Selection

hello

to answer your initial question, you should investigate these 2 ideas :

-having 2 OSPF processes (this time playing with AD ;) )

-if you're using MPLS/VPN and you're using OSPF as PE/CE protocol, you should consider the use of sham-links

bye,

Etienne

241
Views
20
Helpful
21
Replies