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

BGP best path selection algorithm question

Hi all,

I was reading this page:

And i'm wondering why step 7 exist (Prefer eBGP over iBGP paths) since when a router receive the same route via EBGP and IBGP, the administrative distance will break the tie (IBGP = 200, EBGP = 20) from the very start of the process, even before entering that BGP selection algorithm process.

Under what circumstance the step 7 will be used?

Best Regards,

Hall of Fame Super Silver

Re: BGP best path selection algorithm question


Actually the Administrative Distance is applied to routes only as the routing protocol passes them to the process that builds the IP routing table. BGP has no concept of AD as it goes through the best path selection process. This is why step 7 exists.



Hall of Fame Super Silver

Re: BGP best path selection algorithm question

Hello Martin,

as Rick says BGP has its own BGP table where all the paths are stored, the BGP selection is applied to this table and here the AD plays no role.

After BGP comes up with a best path to a prefix the process that mantains the routing table will label it with AD=20 or AD=200 depending if the path is external (comes from an eBGP session) or internal (comes from an iBGP session).

Hope to help


Re: BGP best path selection algorithm question

Hi Martin,

A small addition to the previous posts:

The BGP path selection process gives preference to the EBGP routes over IBGP routes in the 7th step for the following reason:

Given the fact that the previous 6 steps produced the same results for 2 (or more) routes toward the same prefix:

if you can reach a prefix over an EBGP learned route and over an IBGP learned route, which do you think is the shortest path to the destination?

Of course, the EBGP learned route is.

In case of an IBGP learned route, for a packet there is at least 1 additional hop to go within the same AS to reach an edge BGP router.



CreatePlease to create content