cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3646
Views
2
Helpful
23
Replies

OSPF path selection

Donia
Level 1
Level 1

Hello 

I have a problem that i am receiving prefix on a router with ospf from 2 direction ( primary/ backup ) devices and it should be preferred using metric in the redistribution statement as below

the problem that the metric isn't seen in the router and load balancing is done and i don't know why it is happening

R3#sh ip route ospf | s 10.0.0.0 
10.0.0.0/8 is variably subnetted, 34 subnets, 8 masks
O E2 10.0.0.0/8 [110/2] via R1, 05:20:52, GigabitEthernet2/0/0
                          [110/2] via R2, 7w0d, GigabitEthernet1/0/0

 

R1 configuration 

 

router ospf 1

summary-address 10.0.0.0 255.0.0.0
summary-address 172.16.0.0 255.240.0.0
summary-address 192.168.0.0 255.255.0.0 

redistribute bgp AS metric 200 subnets route-map TO-OSPF

route-map TO-OSPF permit 10
match ip address prefix-list TO-OSPF

ip prefix-list TO-OSPF seq 5 permit 10.0.0.0/8 le 32
ip prefix-list TO-OSPF seq 10 permit 172.16.0.0/12 le 32
ip prefix-list TO-OSPF seq 15 permit 192.168.0.0/16 le 32


R2 Configuration:

 

router ospf 1

summary-address 10.0.0.0 255.0.0.0
summary-address 172.16.0.0 255.240.0.0
summary-address 192.168.0.0 255.255.0.0

redistribute bgp AS metric 100 subnets route-map TO-OSPF

route-map TO-OSPF permit 10
match ip address prefix-list TO-OSPF

ip prefix-list TO-OSPF seq 5 permit 10.0.0.0/8 le 32
ip prefix-list TO-OSPF seq 10 permit 172.16.0.0/12 le 32
ip prefix-list TO-OSPF seq 15 permit 192.168.0.0/16 le 32


from the above configuration R3 should prefer route from R2  which has metric 100 but it isn't the result i got from R3

however if i check another subnet like 192.168.0.0

 

R3#sh ip route ospf | s 192.168.0.0

O E2 192.168.0.0/16 [110/100] via R2, 6w6d, GigabitEthernet1/0/0

can anyone tell me why the metric is changed on subnet 10.0.0.0 however it is ok for subnet 192.168.0.0

 

 

23 Replies 23

Hi @Donia  ,

The fact that you are seeing the metric 2 instead of the metric 100 or 200 for the 10/8 summary route is due to the fact that you are redistributing from multiple sources (bgp and ospf 2). The lower metric coming from ospf 2 is used instead of the metric 100/200 from the

redistribute bgp

statements.

Regards,

Regards,
Harold Ritter, CCIE #4168 (EI, SP)

yes i tried to check another prefixes that should be learnt from the other ospf Process and found the same behavior that load balancing is done so i will need to make change on the redistribute ospf 2 to take the same metric as

redistribute bgp

 

Hi,

there will not be LSA for subset routes in OSPF DB of process 1, because you do summarization (you have only summary route LSA in DB).

route-map NETWORKS doesn't have 10.0.0.0/8 as an entry but other 10.x.x.x/18 le 32

So, it is possible that routes from this route-map is considered in summarization. Check routes in OSPF process 2 rib:

show ip ospf 2 rib | inc 10.

 

HTH,
Please rate and mark as an accepted solution if you have found any of the information provided useful.

you network like below 
the R2 and R3 have eBGP to R4
R4 inject 10.0.0.0/8 le 32 into R2 and R3 
R2 and R3 redistribute it into OSPF  
then you summary the 10.0.0.0/8 le 32 to 10.0.0.0/8  ?
am I right ?
Screenshot (471).png

Routing Bit Set on this LSA in topology Base with MTID 0 <<- all route external dont have this bit 
can you confirm that and still use the topology 

these routes should be external but 10.0.0.0/8 seems to have a problem due to the other redistribute ospf 2 as i checked another prefix inside ospf 2  in the route map Network and found it in R3 seen from 2 paths ( the same behavior 10.0.0.0/8)

if you checked again 192.168.0.0/16  ( sh ip ospf database 192.168.0.0 ) that i sent it before MTID =0 and it has the same metric 100 which i have added to all

redistribute bgp route

 

OSPF2 !!
where is OSPF2. I see only one OSPF which is OSPF 1?
can you more elaborate ?

I already try config and it right 
the eBGP advertise the 5.0.0.0/16 and the

OSPF redistribute bgp 

and set metric to 200
and result is 
5.0.0.0/8 with metric 200
I think there is something else here

Screenshot (494).pngScreenshot (495).pngScreenshot (496).png

you share this before all 10.x.x.x is learn from eBGP 
so the summary use it as seed of summary address 
the metric is all same equal 0 



O 10.0.0.0/8 is a summary, 3d17h, Null0

B 10.0.152.158/32 [20/0] via PE, 02:03:33
B 10.2.0.0/16 [20/0] via PE, 02:03:33
B 10.1.153.152/30 [20/0] via PE, 02:03:33
B 10.1.153.232/30 [20/0] via PE, 02:03:33
B 10.1.54.152/30 [20/0] via PE, 02:03:33
B 10.1.54.232/30 [20/0] via PE, 02:03:33



so only remove summary and add it again 
if you can 
thanks