Now that you understand how BGP establishes sessions and exchanges routes, you must master something critical for the CCNP ENCOR exam:
How BGP decides which path to install when multiple paths exist.
BGP is a policy-based routing protocol.
That means:
You, as the network engineer, can influence path selection.BGP Best-Path Algorithm
When a router receives multiple paths toward the same destination, it runs the BGP Best-Path Algorithm.
This Best-Path Algorithm allows us to influence the routing behavior of BGP.Over the next three lessons, you walk through the attributes in the exact order BGP evaluates them:
Weight
Local Preference
Locally Originated
AS-PATH
Origin
MED
eBGP over iBGP
Router ID
Answer the question below
What type of routing protocol is BGP?
Until now, every prefix had a single path.
In real-world environments, this is rarely the case.
Routers often receive multiple paths to the same destination.When that happens, BGP must decide:
Which path should be installed in the routing table?
Figure 1 – Two AS advertise prefix
In this topology:
AS 200 advertises
209.165.200.224/27AS 300 advertises
209.165.200.224/27R1 receives both advertisements
You are on R1.
Your job is to determine which path will be selected, using the Weight attribute.What is Weight?
Weight is a Cisco proprietary attribute that is local to the router. It is not advertised to neighbors and is the first attribute evaluated in the BGP decision process.
You can configure R1 to assign a weight to routes received from a specific neighbor. When that neighbor sends a prefix, the prefix arrives with the weight you defined.

Figure 2 – BGP Weight Attribute
The default values to remember are:
0 for routes learned from a neighbor
32768 for routes locally originated by the router
The Weight range goes from 0 to 65535.
Highest Weight wins.
Answer the question below
R1 receives 209.165.200.224/27 from AS 200 (Weight 500) and AS 300 (default Weight). Which path wins?
Configuring Weight on R1
To configure Weight, you create a route-map that defines the action to apply.

Figure 3 – Setting BGP Weight
The route-map is named
AS200, and its action is to set a weight value of 100.
Since there is nomatchclause, the route-map applies to all routes received from the targeted neighbor.R1# conf t Enter configuration commands, one per line. R1(config)# route-map AS200 permit 10 R1(config-route-map)# set weight 100 R1(config-route-map)# exitThen on R1, you enter the BGP process for AS 100 and apply this route-map inbound to the neighbor in AS 200.
R1(config)# router bgp 100 R1(config-router)# neighbor 10.0.11.2 route-map AS200 in R1(config-router)# endVerifying the Result
Now verify the BGP table:
40 % Complete: you’re making great progress
Ready to pass your CCNP exam?