BGP uses an algorithm called (“BGP Best Path Selection”) to identify the best path and place it in the routing table of a router so traffic will be forwarded using that path. Depending of the situation, we can influence how BGP chooses a path to a particular destination by using path attributes. The very first criterion BGP will use is called “Weight.”
Key features to know:
Weight is a Cisco Proprietary feature
It is a significant value; it stays within the same AS. It is not relayed in the BGP updates
The higher a value, the better. ( value range from 0 to 65000. Default “0”)
Influence the choice of an incoming route (Outbound routes)
Let’s take a look at this example:
In this example the network (192.168.2.0/24) is advertised to my edge router “IPVCLOUD-3” by both ISP-1-A and ISP-1-B which are under the same AS (300) This might be a typical “Dual-Home” scenario where router “IPVCLOUD-3 has two links to the internet connected to a single ISP.
BGP on router “IPVCLOUD-3″ is choosing network 126.96.36.199 as the best path for inbound updates. Because there is no filter nor path attributes applied, BGP uses the lower Router-ID which is 188.8.131.52. Note: Check that BGP does not even check AP_PATH to pick the shortest because network 192.168.2.0 is coming from on AS (300) for the sake of this simple lab. Therefore, the lowest router-id will be the path that BGP will be select.
We can verify that the best route for that subnet is route #2 because of the router-id.
Let’s use the “AP weight” to force BGP to use 184.108.40.206 as the best path to advertise 192.168.2.0 network.
The simplest configuration is to go under the BGP router process and assigned a weigh value to the neighbor we want BGP to use as the best path. After that we need to clear the BGP process, otherwise BGP will not update the change.
How do we know BGP choose 220.127.116.11 instead of 18.104.22.168?
Do you see the little “arrow” next to the “asterisk”? That is a BGP indication that it is using next-hop 22.214.171.124 for the best path to receive updates.
There are many situation in which we can apply weight to influence BGP. For example, using prefix-list or route-maps in different situations. I will cover more of this soon.