Category Archives: 3.7.c Explain attributes and best-path selection

3.7.c Explain attributes and best-path selection

BGP assigns the first valid path as the current best path. BGP then compares the best path with the next path in the list, until BGP reaches the end of the list of valid paths. This list provides the rules that are used to determine the best path:

Prefer the path with the highest WEIGHT.

Prefer the path with the highest LOCAL_PREF.

Prefer the path that was locally originated via a network or aggregate BGP subcommand or through redistribution from an IGP.

Prefer the path with the shortest AS_PATH

Prefer the path with the lowest origin type.

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

Prefer eBGP over iBGP paths.

Prefer the path with the lowest IGP metric to the BGP next hop.

When both paths are external, prefer the path that was received first (the oldest one).

Prefer the route that comes from the BGP router with the lowest router ID.

If the originator or router ID is the same for multiple paths, prefer the path with the minimum cluster list length.

Prefer the path that comes from the lowest neighbor address.

Adam, Paul (2014-07-12). All-in-One CCIE V5 Written Exam Guide (Kindle Locations 3910-3921).  . Kindle Edition.

3.7.c Explain attributes and best-path selection

it never goes away… from

  • Highest weight (Cisco-proprietary BGP value)
  • Highest local preference (LOCAL_PREF)
  • Prefer locally originated route.
  • Shortest AS_PATH is preferred.
  • Choose route with lowest origin code. Internal paths are preferred over external paths, and external paths are preferred over paths with an origin of “incomplete”.
  • Lowest multi-exit discriminator (MED)
  • External BGP routes preferred over Internal BGP routes.
  • If no external route, select path with lowest IGP cost to the next-hop router for iBGP.
  • Choose oldest (most stable)
  • Choose lowest BGP RID (Router ID).



3.7.c Explain attributes and best-path selection

R4#sh ip bgp | b Net
Network          Next Hop            Metric LocPrf Weight Path
*>                                0 123 678 ?
*>                                0 123 678 ?
*>                                0 123 678 ?
*>                                0 123 678 ?

r4 learned these networks from the next hop which is in AS 123 which learned them from AS 678 which learned them from some other source (redistribution)

hit it wendell:

 a router can add entries to its BGP table using the network command and route redistribution. Additionally, BGP can use manual route summarization to advertise summary routes to neighboring routers, causing the neighboring routers to learn additional BGP routes. BGP manual summarization with the aggregate-address command differs significantly from using the auto-summary command. It can summarize based on any routes in the BGP table, creating a summary of any prefix length. It does not always suppress the advertisement of the component subnets, although it can be configured to do so.

3.7.c Explain attributes and best-path selection

BGP is a path vector protocol. Among its noteworthy features:

Reliable updates

Triggered updates

Path attributes

Large networks; Internet centric


BGP can often be found in:


Customer networks connected to one or more ISP’s

Service Provider (transit networks)

Large Enterprise network cores


TCP Port 179


BGP is manually configured at both ends of a connection. TCP Port 179 is the session establishment facilitator. Its Finite State Machine indicators are Idle, Connect, Active, OpenSent, OpenConfirm and Established. It defaults to 60 second Keepalive’s for connection maintenance, and can use an MD5 shared secret between peers for security.


Best Path


In processing its routes, BGP has as its primary goal selecting the best path from among the choices made available from its peer establishments. All routes received from peers are retained in memory, however.

Best Path/Route Preference


Exclude route with an unreachable next hop

Weight (highest value, Cisco proprietary)

Local-preference (highest value within AS)

Locally originated (next hop, default weight value 32768 if applicable)

AS-Path (shortest)

Origin code (igp,egp,incomplete(?))

MED (mulri-exit discriminator, lowest value)

EBGP paths before IBGP

IBGP, closest IGP neighbor

EBGP oldest paths (age)

BGP router-id (lowest)


The best valid and reachable routes are propagated to BGP neighbors as well as placed into the IP route table after checking administrative distances


see also: