cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2313
Views
30
Helpful
27
Replies

OSPF issue

mahesh-gohil
Level 1
Level 1

Dear netpro

i am having one issue with one of my customer running OSPF as PE-CE.

he is advt. me one pool 10.219.1.96/28 from PE1 .

But when I do trace from PE4 it goes to PE3---CE3---PE2---CE1.

Infact it should go directly to PE1-CE1

He is not advt this pool from CE3. When we change redistribution metric to 15 at PE1 to MPBGP problem get resolved .

But this seems to be temporary solution and I am seeking another solution to this issue.

Some output might be useful (Also attached diagram)

PE1#sh ip route vrf CE-M 10.219.1.96

Routing Table: CE-M

Routing entry for 10.219.1.96/28

Known via "ospf 4", distance 110, metric 20

Tag 125, type extern 2, forward metric 1

Redistributing via bgp 1234

Advertised by bgp 1234 match internal external 1 & 2

Last update from 10.254.225.74 on GigabitEthernet2/0/0.187, 03:51:52 ago

Routing Descriptor Blocks:

* 10.254.225.74, from 10.254.225.78, 03:51:52 ago, via GigabitEthernet2/0/0.187

Route metric is 20, traffic share count is 1

Route tag 125

PE4#sh ip route vrf CE-M 10.219.1.96

Routing entry for 10.219.1.96/28

Known via "bgp 1234", distance 200, metric 20, type internal

Redistributing via ospf 6

Advertised by ospf 6 subnets

Last update from 202.123.47.228 10:21:41 ago

Routing Descriptor Blocks:

* PE3 (Default-IP-Routing-Table), from RR, 10:21:41 ago

Route metric is 20, traffic share count is 1

AS Hops 0

PE3#sh ip route vrf CE-M 10.219.1.96

Routing entry for 10.219.1.96/28

Known via "ospf 6", distance 110, metric 20

Tag 125, type extern 2, forward metric 5

Redistributing via bgp xxxx

Advertised by bgp 1234 match internal external 1 & 2

Last update from 10.254.224.110 on GigabitEthernet8/1.318, 04:02:22 ago

Routing Descriptor Blocks:

* 10.254.224.110, from 10.254.225.78, 04:02:22 ago, via GigabitEthernet8/1.318

Route metric is 20, traffic share count is 1

Route tag 125

Regards

mahesh

1 Accepted Solution

Accepted Solutions

Mahesh,

I had provided the sample config in a previous post. This need to be done on the router where the route (10.219.1.96/28) gets redistributed into OSPF.

Please refer to the following post for the configuration sample:

http://forums.cisco.com/eforum/servlet/NetProf?page=netprof&forum=Service%20Providers&topic=MPLS&topicID=.ee8558c&CommCmd=MB%3Fcmd%3Dpass_through%26location%3Doutline%40^1%40%40.2cd2496b/13#selected_message

Regards

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México

View solution in original post

27 Replies 27

Mohamed Sobair
Level 7
Level 7

Mahesh,

This is normal, PE4 learns Network 10.219.1.96 from PE3 & PE1, PE4 performs normal BGP best path selection process:

1- The higest Wieght

2- The highest local preference.

3- The Shortest AS-Path.

4- Lowest Origin Code.

5- Lowest med Value

6- prefer the ebgp learned route over the ibgp learned route.

So, if all becomes eually the same, The tie breaker would be the (Lowest Med value).

Why? The OSPF cost is copied into the BGP MED attribute, if you check it you will find that the OSPF learned Networl has cost of 20, and typically being copied into the BGP Med , the result is the same, when you modify the OSPF Cost to lower than 20, The BGP prefer the Lower Med path.

However, In most of the cases, Modifying the OSPF cost is not recommended since it could result in a routing loop, I would therfor recommend to modify the VPNv4 session's local preference for this Network rather than modifying the OSPF Cost.

HTH

Mohamed

Mohamed,

It is actually normal to see the BGP MED being set as the ospf cost. This is how IOS is implemented.

Regards

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México

Harold Ritter
Cisco Employee
Cisco Employee

Mahesh,

10.219.1.96/28 is being seen as an E2, which means that the metric is seen as 20 by the RR for the path coming from PE1, PE2 and PE3. Given that the IGP metric to these PEs is probably the same, the selection is probably based on lowest RID.

Try changing the default from E2 to E1. Note that either the path through PE2 -> CE1 or PE1 -> CE1 will be choosen if they have equal cost.

Regards

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México

Harold, I saw your posts when I tried to post this, but I was trying to explain what was going on and I could not help myself from posting after writing all this :-) I didn't change anything I had written using information on your posts though.

Not a problem Maria. It is always good to have more than more perspective on a given situation.

Regards

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México

marikakis
Level 7
Level 7

Hello,

Ok, this is a hard scenario to comprehend, but I think I am beginning to understand the problem.

When you trace, the packets are forwarded usually in the opposite direction of the route propagation. If you have a look at the diagram you posted (which is very helpful to visualize things and I have to congratulate you on drawing it), you will see what's happening with the route when it first comes from CE1.

CE1 advertises route to both PE1 and PE2. PE2 sends network to CE3, which sends it to PE3. So, PE3 has an OSPF path to the network and so does PE1. 2 routes reach your RR and RR chooses the route via PE3 and passes it to PE4.

If you have followed all this path, you will see that the basic problem is the following: the metric information is lost when you redistribute at various points. When you redistribute from OSPF into MP-BGP, PE uses OSPF metric to set the BGP MED. When PE redistributes routes back from BGP into OSPF, the PE uses MED to set the OSPF metric. When you use default-metric or metric option in redistribute command, this behavior is overridden, because you directly reset the metric.

Local preference might be better than manipulating metrics and MEDs, but you may also consider the following: when you redistribute, you could try not re-setting the metrics. This way you will be able to propagate a metric that reflects the fact that the alternative backup path is less preferred. I think you need to also have a metric-type 1 (external type 1 routes) in OSPF to achieve this metric propagation end-to-end, but honestly this case was so hard for me, I think my head is going to explode right now and I can't decide if it is actually needed (have a look at the "forward metric"'s of the OSPF routes at PE1 and PE3, those are different but the forward metric is not considered in external type 2 routes).

I also think that the MED is not the reason the route is chosen by RR (I think both routes have a metric of 20 propagated as a BGP MED of 20). I think the algorithm goes further down (I don't know your network in more detail, but it could be something like: closest backbone path to BGP next-hop), and you manage to overcome that by forcing the algorithm to stop at an earlier point and decide based on MEDs.

If I made a mistake, I am sorry, but this is not easy, especially without access to routers to see what's going on.

Kind Regards,

M.

Mohamed Sobair
Level 7
Level 7

Harold & Maria,

I might be misunderstanding some thing here, The original poster claimed that from PE4 thr route to Network 10.x.x.x is not taking the direct path , rather its taking the path toward the RR.

He said when he redistributed the Network from OSPF into BGP with a cost of 15, the path was choosen.

We are talking about PE4 here, PE4 doesnt know about OSPF and its only has 2 IBGP session with both RR and PE1. The route from PE4 was prefered cause it prefered the lowest MED value because the OSPF cost is copied into the BGP MED attribute.

Also, Cisco doesnt recommend changing the OSPF cost cause its copied into the BGP MED, and could result in a routing loop.

The recommendation has been introduced when RIP and OSPF is involved an being redistributed into BGP. Its also clear when Implementing a sham link to correct customer OSPF backdoor link in MPLS-VPN Scenarios.

Hope I clarified my point,

Mohamed

Mohamed,

I do not think the original poster mentioned anything about the packets from PE4 to CE1 going through the RR. From the attached diagram, it seems like the issue is that the packets goes through PE3 in order to get to CE1, which is a suboptimal path.

PE4 only receives one path and it is the one that has already been selected by the RR.

Since all three path received from PE1, PE2 and PE3 have equal MED (copied from the ospf E2 cost) and that the IGP cost from the RR to the 3 PEs is the same, the best path selection on the RR is based on the lowest RID, which seems to be PE3 in this case. Selection of the best path based on RID in this case is not ideal obviously.

One solution is to use an E1 instead of the E2, which would reflect the internal cost to the ASBR. The internal cost would then be reflected to the BGP MED, which would cause the updates from PE1 and PE2 to be equal as they both have a direct link to CE1 (assuming the PE-CE link cost is the same for both links). RR will then select either PE1 or PE2 based on RID.

Regards

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México

Mohamed Sobair
Level 7
Level 7

Hi Harold,

Pls look at the bellow paragraphs:

--""he is advt. me one pool 10.219.1.96/28 from PE1 .

But when I do trace from PE4 it goes to PE3---CE3---PE2---CE1.

Infact it should go directly to PE1-CE1

He is not advt this pool from CE3. When we change redistribution metric to 15 at PE1 to MPBGP problem get resolved ""--

My previous post was based on the above and the output from (sh ip route 10.x Network),He also mentioned a direct path between PE1-CE1 from PE4.

HTH

Mohamed

Mohamed,

This route is being redistributed at all PEs from ospf to BGP. Here's the show ip route from PE3 showing this:

PE3#sh ip route vrf CE-M 10.219.1.96

Routing entry for 10.219.1.96/28

Known via "ospf 6", distance 110, metric 20

Tag 125, type extern 2, forward metric 5

Redistributing via bgp xxxx <++++++++++++ Redistributed

Advertised by bgp 1234 match internal external 1 & 2 <++++++++++++++++++ Advertised

Last update from 10.254.224.110 on GigabitEthernet8/1.318, 04:02:22 ago

Routing Descriptor Blocks:

* 10.254.224.110, from 10.254.225.78, 04:02:22 ago, via GigabitEthernet8/1.318

Route metric is 20, traffic share count is 1

Route tag 125

Regards

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México

Ok guys,

thanks for your reply. What i want is if My prefix 10.219.1.96/28 is advertised form PE2 to CE3 and when it come back to PE3 it should be ignored if down-bit is set.

Now say it is external route so down-bit might not be there (As per my understanding, not sure) so what is the other mechanism so that my PE3 will ignore this route.

Moreover How will I convert external 2 to external 1.

Please let me know for any more clarity and any more output required from my side

Really happy to see valueable input from guys.

Regards

mahesh

Mahesh,

The down bit will only be set if the routes is redistributed from BGP to OSPF, which should not be the case in your scenario as PE3 receives 10.219.1.96/28 via OSPF.

You can convert from external type 2 (default) to external type 1 by adding some reconfiguration on the redistribute command (where 10.219.1.96/28 is redistributed in OSPF for instance):

redistribute metric-type 1

Regards

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México

Mohamed Sobair
Level 7
Level 7

Hi Harold,

I know the route is being redistributed and advertised on PE3. what I mean the Route at PE4 is learned via BGP not OSPF.. (My main concern was PE4).

Mahesh,

The (Down-bit) in the LSA header is supported to prevent routing loop, what it does, it will certainely makes sure the packet are never back to the original router.

You can simply disable the (Down-bit) check, the only way to do this is by configuring (Capability vrf-lite) under the OSPF process at your PE.

Since you have a Multi VRf CE router, you need to disable the Down-bit check at your PE.

In order to have E1 route reflected at the ASBR, you will have to set it as External-type 1 when redistributed on your ASBR PE router.

HTH

Mohamed

Mohamed,

That is the point. PE4 learns the route via BGP but only learns one path as the RR has already decided which path coming from PE1, PE2 and PE3 is the best. The issue currently is that the RR considers all of these paths equals and select the best one based on the RID.

Regards

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: