cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
563
Views
3
Helpful
11
Replies

Route selection between OSPF processes

cosmingrosu
Level 1
Level 1

I have a situation in a lab topology and I can't seem to figure out how things work:

cosmingrosu_2-1727453669574.png

 

 

So redistribution is configured between OSPF process 1 and 2 on both R1 and R2. Filtering using route tags is in place in such a way that no network will be redistributed back into the process it originated from.
Now there are two questions that I can't seem answer:
1. R1 learns about 150.0.0.8/30 from two places:
- from OSPF process 2 as an internal prefix.
- from OSPF process 1 as an external prefix, because it is redistributed by R2.
#show ip route shows that the internal prefix is installed into the RIB. My question is how does R1 take this decision? As far as I know, between two OSPF processes, only the AD matters, which is the same. No other protocol-specific route selection rule such as internal > external or cost has any effect, so why does R1 installs into the RIB the internal prefix instead of the external.

2. If I redistribute the 10.4.4.0/24 network from EIGRP into OSPF process 2 on R3, a loop occurs on both R1 and R2. They both redistribute the external network from process 2 as an external network into process 1, and both will keep replacing the route into the RIB. For instance, R1 keeps overwriting the route learned from R3 with the route learned from R2, then back to R3, then back to R2 and so on and so forth. My question is: why this happens? If there is a mechanism that the router uses to decide on a path over the other when the AD is the same, as it did at point 1, why  doesn't it work here as well?

11 Replies 11

Thank you for the document, I did have a quick look through it and as it is explained:
"[...]Now, in each router, the internal network learned via one process competes against the external network of another process. As previously mentioned, there is no preference rule between different processes; therefore, the result would be indeterministic, as both processes have the same administrative distance."

So this confirms my initial assumption that only the AD is used as preference between processes, but regarding the routers' behaviours I am still confused.

distance ospf external 200

Add above under ONE ospf process

This will make EX of prefix have AD 200 less prefer compare to O or O IA which have AD 110

MHM

Hello


@MHM Cisco World wrote:
distance ospf external 200


Hello @MHM Cisco World 
The lower administrative distance of any route should be taken into consideration before any routing process utilizes its own best path selection process -so based on default external seed metrics - ospf 110 will supersede eigrp external 170.

As for redistribution between two ospf process they will have the same seed metric by default and setting the distance command  to be lower then the other will indeed make the router prefer one domain over another for external routes however it will still not negate the possibility of loops due to the dual redistribution, you need filter be it by prefix-list of the route you not want to be advertised back into the ospf domain they originated from or by the more elegant way of route-tags as I previously shown, which can be used also between two ospf process.

example2
route-map ospf1-to-ospf2 deny 10

match tag 2
route-map ospf1-to-ospf2 permit 100
set tag 1

route-map ospf2-to-ospf1 deny 10
match tag 1
route-map ospf2-to-ospf1 permit 100
set tag 2

router ospf 1
redistribute ospf 2  route-map ospf2-to-ospf1 subnets

router ospf 2
redistribute ospf 1  route-map ospf1-to-ospf2 subnets


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

I dont lab it' but I will lab and share reuslt here.

Thanks @paul driver 

Have a nice weekend 

MHM

Hello
1- OSPF will ALWAYS choose internal over external routes
In this instance R1 is receiving a type 1 LSA and a type 5 external LSA
as such the type 1 lsa O route is preferred 

2- you have mutual redistribution points so itou need to make sure redistribution of those route do not get re- advertised back into either routing process
this can be accomplished route route- tags
Example
Route-map ospf-into-eigrp deny 
Match tag 90
Route-map ospf-into-eigrp permit 100 
set tag 110

Route-map eigrp-into-ospf deny 
Match tag 110
Route-map eigrp-into-ospf permit 100 
set tag 90

router ospf x
redistribute eigrp x route-map eigrp-into-ospf subnets

router eigrp x
redistribute ospf x route-map ospf-into-eigrp metric 10000 100 255 1 1500


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

I run lab friend 

Screenshot (770).png

- from OSPF process 2 as an internal prefix. <<- there is no internal, it external since we redistribute from one ospf process to other 
- from OSPF process 1 as an external prefix, because it is redistributed by R2.

@paul driver below how we use AD to control traffic 
in R1 we can see it prefer path via R2 not path via direct connect R3 for LO 3.3.3.3
when I change AD in R2 the R1 prefer the correct path via R3

Screenshot (773).pngScreenshot (774).pngScreenshot (775).png

Hello @MHM Cisco World 
Continue with your lab and add an additional redistribution point - even better refer to that document you posted and test based on that  you'll see  the requirement for either prefix or route-tag filtering


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

Friend 

When I adjust R2 ospf external AD

R1 have two path

One via R3 direct connect and other via R2 

If R1-R3 link down still R1 can use path via R2.

What you suggest is using tag that make R1 never have path via R2 as redundancy. 

That why I suggest using AD 

Many thanks 

MHM

any update 

MHM

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello @cosmingrosu ,

1) two OSPF processes work as "ships in the nigh" each process has its own LS DB and they are in competition in providing prefixes to the IP daemon that mantains the routing table. OSPF route type are not checked by IP daemon only AD and metric. If the internal prefix has lower OSPF metric this is why it is installed.  Tuning the external AD in one process can help.

2) if both R1 and R2 are ASBR between OSPF1 and OSPF 2 and you are performing mutual redistribution at two points you need to use route-tags as explained by @paul driver 

Hope to help

Giuseppe

 

Review Cisco Networking for a $25 gift card