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

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.

BGP Path selection

Below is the output for a WAN router peering with provider external Ebgp and also have iBGP peering as well.

Based on the output below i am assuming that best path is the internal ibgp peer since it looks like the provider (ebgp AS 3854) is doing AS Prepending ( sending Community: 2856:10 2856:104 5400:3001 5400:3002 5400:3300 to us).  So by design bgp will look at lower AS-Path instead and will choose the internal. Without the prepending, then the ebgp will be the prefered of course.

(Site 1)
bgprouter1#sh ip bgp
BGP routing table entry for, version 142343011
Paths: (3 available, best #3, table Default-IP-Routing-Table)
  Not advertised to any peer
  3854 5400 5769 from (
      Origin IGP, metric 10, localpref 100, valid, external
      Community: 2856:10 2856:104 5400:3001 5400:3002 5400:3300
   1478 5769  (This via another ibgp nei) (metric 3) from (
      Origin IGP, metric 4294967294, localpref 100, valid, internal, best


Hall of Fame Super Silver

Re: BGP Path selection

Hello Francisco,

the two AS paths are:

3854 5400 5769

1478 5769

shortest AS path wins so second path is best as it could be expected rightmost AS number is the same (this is the prefix owner)

>> Community: 2856:10 2856:104 5400:3001 5400:3002 5400:3300

this is not part of AS path and so it cannot be seen as AS path prepending, these are just multiple BGP communites applied to the route by this ISP

Hope to help


Cisco will donate $1 to  the Red Cross Haiti fund for every rated post!