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.

kfr
New Member

wrong BGP Path Selection?

Hello,

we have a BGP Router with the full Internt Routing Table, which is connected to an internal BGP Route-Reflector and an Internet Exchange.

In the follwing output i'm wondering why the Router has elected the path via AS 20676, although it`s an internal learned Route and there's another external path:

#show ip bgp 195.160.248.0/22

BGP routing table entry for 195.160.248.0/22, version 369303261

Paths: (5 available, best #4, table default)

  Not advertised to any peer

  8881 34161

    80.81.203.35 (metric 20) from XX.XX.XX.67 (XX.XX.XX.67)

      Origin IGP, metric 90, localpref 90, valid, internal

      Community: 0:174 0:1299 0:3356 0:15169 XXXX:1102 XXXX:1820 XXXX:1999 43252:43252

      Originator: XX.XX.XX.82, Cluster list: 0.0.0.20

  8881 34161

    80.81.192.80 from 80.81.193.157 (80.81.193.157)

      Origin IGP, metric 101, localpref 90, valid, external

      Community: 0:174 0:1299 0:3356 0:6762 0:8391 0:8442 0:9189 0:12329 0:12355 0:12654 0:15169 0:16276 0:20633 0:21263 0:41039 6695:6695 XXXX:1105 XXXX:1810 XXXX:1999

  8881 34161

    80.81.192.80 from 80.81.192.157 (80.81.192.157)

      Origin IGP, metric 101, localpref 90, valid, external

      Community: 0:174 0:1299 0:3356 0:6762 0:8391 0:8442 0:9189 0:12329 0:12355 0:12654 0:15169 0:16276 0:20633 0:21263 0:41039 6695:6695 XXXX:1105 XXXX:1810 XXXX:1999

  20676 34161

    XX.XX.XX.76 (metric 2) from XX.XX.XX.66 (XX.XX.XX.66)

      Origin IGP, metric 0, localpref 90, valid, internal, best

      Community: XXXX:1100 XXXX:1810 XXXX:1999

      Originator: XX.XX.XX.76, Cluster list: 0.0.0.20

  1299 20676 20676 20676 34161

    213.248.73.137 from 213.248.73.137 (80.239.146.37)

      Origin IGP, localpref 80, valid, external

      Community: XXXX:1000 XXXX:1810 XXXX:1999

According to http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a0080094431.shtml,

rules 1-5 cannot be used for an best path selection, because all attributes are equal.

Rule 6 should not be relevant, because the MED are only be compared if the first AS in the path is the same. but in this case the chosen Path over AS20676 has another first AS comparing to the Path over AS8881.

Rule 7 should be the tie-breaker in this case, because the path over AS20676 is an internal route (learned via iBGP from a Route-Reflector).

The result should be, that the external learned path over AS8881 should be chosen and prefered over internal routes!!!

The Router is an 7600/SUP720 with IOS 1.2(33)SRE

Everyone's tags (1)
18 REPLIES

wrong BGP Path Selection?

kfr
New Member

wrong BGP Path Selection?

No, that's not the main point. MEDs are not the problem in this case.

I think the router has chosen the wrong internal (iBGP) Path, although there`s an external (eBGP) path!

P.S. It`s IOS Version 12.2(33)SRE

Gold

wrong BGP Path Selection?

Hi there,

comparing other entries, this is why it is chosen over all others.

> Origin IGP, metric 0, localpref 90, valid, internal, best

its a metric manipulation by ur adjacent AS, not supported in classic BGP though. it'll work if the AS path length is the same for all candidates, which in ur case it is. for better clarification could u post the bgp config (except the neighbor statements) here plz?

Devices usually dont mistake unless we config them to do so

HTH,

Soroush.

Hope it Helps!

Soroush.
kfr
New Member

wrong BGP Path Selection?

Hello,

can you explain your reply? I don't understand, what "metric manipulation by ur adjacent AS" means, because my router should follow the normal BGP Selection Process and we don't have bgp always-compare-med 

configured!?

Because the router is connected to an internet exchange, the whole BGP Config is very long. The path AS20676 is  learnt by another router (we set the local-preference 90 to the neighbor AS20676) and then sent to our 1st BGP Route-Reflector (XX.XX.XX.66) which sends this path to the router from the 1st post.

XX.XX.XX.67 is our 2nd Route-Reflector. Both RRs form a RR-Cluster with Cluster-ID 20

Gold

wrong BGP Path Selection?

sometimes, ISP's under an internal agreement between each other could set a metric value for their routes that advertise to their clients, this way clients will send traffic to certain routes through a certain ISP, in case of multi-homing.

from what I see in that output, if i want to reason behind the current Best path, is [at least] using the bgp deterministic-med command in bgp configuration.

>> could u plz check that?

HTH,


Soroush.

Hope it Helps!

Soroush.
kfr
New Member

wrong BGP Path Selection?

No, we don't use any special bgp commands like bgp always-compare-med or bgp deterministic-med.

That's exactly the problem, because in any circumstances the router should prefer an external Path against an internal path over another AS!?

In my opinion the router must choose the path 8881 34161, because this path is shorter than

1299 20676 20676 20676 34161 and the other pathes are internal !!!

Gold

wrong BGP Path Selection?

Ok then, in this case... the Timing of receiving these entries might be the reason behind the best path selection.

"When BGP receives multiple routes to a particular destination, it lists them in the reverse order that they were received, from the newest to the oldest. BGP then compares the routes in pairs, starting with the newest entry and moving toward the oldest entry (starting at top of the list and moving down)."

it can justify this behavior (from top to bottom we assume 1 to 5):

1 and 2: Same Local perf, AS path, Origin. since they have a same AS_path, the lower MED value [Metric 90] wins!

1 and 3: Just like 1 and 2, entry 1 Wins due to the lower MED value.

1 and 4: Same Local perf, AS path, Origin, both Internal. effective: Lowest IGP Metric to Next hop! [Metric 2], 4 is the winner.

4 and 5: Lower AS PATH. Winner is 4 ! .... 4 is the best path.

HTH,

plz Rate if it helped.

Soroush.

Hope it Helps!

Soroush.
kfr
New Member

wrong BGP Path Selection?

Hmm, this would be an explanation. Where did you found the quoted text?

As a conclusion, i think the bgp deterministic-med would be a good solution to configure...

Gold

Re: wrong BGP Path Selection?

actually it is recommended by cisco to enable deterministic med accross network.

the qouted txt is from here:

http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a0080094925.shtml#examp

dont forget to rate useful posts, for benefit of members of the community!

HTH,


Soroush.

Hope it Helps!

Soroush.
New Member

wrong BGP Path Selection?

Hi there! I see something wrong in configuration what you shared it!

First of all @kfr you are right is should choose external path than Internal and MED ( metric) here is not included in our condition because here Local Perf and Weight are responsible in this condition, MED is responsible if the outside Network comes in to our AS BGP. But here in this case we want to go out from Our AS to outside AS, So MED is not included in our conditions. After that I hope to see this which is in your configuration what you pased it :

#show ip bgp 195.160.248.0/22

BGP routing table entry for 195.160.248.0/22, version 369303261

Paths: (5 available, best #4, table default)

  Not advertised to any peer

 

Look to Not advertise to any peer, to solve this problem you have to make a clear ip bgp * soft (recommended) or clear ip bgp * all then wait a moment to get adevrtised by group. I think after that it will choose external path as Rule says.

or check the bgp neighbor and make shutdown ano no shutdown to the interfaces.

I hope this will be valuable and useful for you.

Regards,

Mohammad Said

Gold

Re: wrong BGP Path Selection?

Hi,

mohammad saeed wrote:

Hi there! I see something wrong in configuration what you shared it!

First of all @kfr you are right is should choose external path than Internal and MED ( metric) here is not included in our condition because here Local Perf and Weight are responsible in this condition, MED is responsible if the outside Network comes in to our AS BGP.

Mohammad, i say u r definitely wrong. could u plz post the reference u used about this MED's responsibility?

HTH,

Soroush.

Hope it Helps!

Soroush.
New Member

wrong BGP Path Selection?

MED use for outside in othere meaning, If you want to Let the outside AS comes to your AS here is you should use MED or AS prepeneded,. But here in this case we want our AS to go out to another AS so MED here it is not working to control the path.

MED give our network specific metric to the outside AS if it is come back. this is common scense in BGP!

to apply metric ( neighbor x.x.x.x route-map xxxx out)

and also look to this scentence in the first of configuration : Not advertised to any peer

which means there is not complete advertising between peers,!!!

may be someone changed the local preference the make Clear command but he didn't wait enough time or there is a problem with connectivity!!

Gold

wrong BGP Path Selection?

MED application has two sides to be considered, to influence and to be influenced by:

* from the upstream AS view, MED gives u the ability to influence path selection of other ASes in certain situations.

* from the downstream AS view, the path with the lower MED could be the best path, depending on ther criterias, here we are the downstream.

but here the MED is not the problem, if u read my previous posts here.

the sentence "Not advertised to any peer" is there because this router is a route reflector client, so it wont advertise this route.

btw, reason behind this selection is cleared, if u read previous posts.

HTH,

Soroush.

Hope it Helps!

Soroush.
Hall of Fame Super Silver

wrong BGP Path Selection?

Hello Soroush,

you have done a very good job on this thread and I agree you have found an answer to the issue presented by the original poster.

The link you have provided is helpful and it deserves a good rating.

Go on this way!

Best Regards

Giuseppe

Gold

wrong BGP Path Selection?

Thank you very much Giuseppe!

have a great weekend.

Regards,

Soroush.

Hope it Helps!

Soroush.
New Member

Re: wrong BGP Path Selection?

I don't think that

refer the path with the lowest multi-exit discriminator (MED).

Note: Be aware of these items:

  • This comparison only occurs if the first (the neighboring) AS is the same in the two paths. Any confederation sub-ASs are ignored.In other words, MEDs are compared only if the first AS in the AS_SEQUENCE is the same for multiple paths. Any preceding AS_CONFED_SEQUENCE is ignored.
  • If bgp always-compare-med is enabled, MEDs are compared for all paths.You must disable this option over the entire AS. Otherwise, routing loops can occur.
  • If bgp bestpath med-confed is enabled, MEDs are compared for all paths that consist only of AS_CONFED_SEQUENCE.These paths originated within the local confederation.
  • THE MED of paths that are received from a neighbor with a MED of 4,294,967,295 is changed before insertion into the BGP table. The MED changes to to 4,294,967,294.
  • Paths received with no MED are assigned a MED of 0, unless you have enabled bgp bestpath med missing-as-worst .If you have enabled bgp bestpath med missing-as-worst , the paths are assigned a MED of 4,294,967,294.
  • The bgp deterministic-med command can also influence this step.Refer to How BGP Routers Use the Multi-Exit Discriminator for Best Path Selection for a demonstration.

and KFR didn't enabled bgp always-compare-med to make MED are prefared!

Also he wants to go to this Network 195.160.248.0/22 and not Downstream! also kfr changed the Local Pref. to go out no come in!! So External metric will not share!! Also this sentence"Not advertised to any peer"  should not appear even in Route reflector router! and I haven't seen this sentence in any scenario even in roue reflector client!

I imitate this scenario and I got the external router prefered the best path.

New Member

Re: wrong BGP Path Selection?

This Link will help you kfr to troubleshoot "Not advertised to any peer"!

http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a00800945ff.shtml

New Member

wrong BGP Path Selection?

Hello,

I think I have an explanation here

P1 Vs P2  - P1 because of low MED ( since next AS is same for both)

P1 VS P3 - P1 because of low MED ( since next AS is same for both)

P1 VS P4 - P1 because of lower metric to next hop

P1 Vs P5 - P1 because P1 is shortest AS PATH

Kindly correct me if Iam wrong.

1090
Views
10
Helpful
18
Replies
CreatePlease to create content