BGP Weight Attribute is used in Cisco routers. In this post, with the below topology, we will look at why the BGP weight attribute is used, why it BGP weight shouldn't be used, advantages and disadvantages of the BGP weight attribute.
In the above topology, we want to use the left path for the prefixes in AS1, thus we have a higher BGP Local preference value. As the BGP Local preference value is exchanged internally between all IBGP neighbors, both left and right routers in AS65000, use the left exit point, which is Local Pref 100 to reach the prefixes in AS1.
Because on the other link BGP Local preference value is lower, 50. Why in the BGP Weight post, I am explaining BGP Local preference you might be asking. Because with that explanation, you will understand the reason for the BGP Weight attribute better. In the above topology, let's say we set the local preference value higher on the left link for all the prefixes in AS1, thus left link is used for those prefixes.So, if traffic arrives at a right router, it will send the traffic to the left router for the left router's uplink to be used.
But let's say, for the specific prefix, 18.104.22.168/24 subnet, we want to use the right router's uplink if the traffic arrives at the right router.This is done with the BGP Weight attribute. So, the left router for all the prefixes continues to use its uplink, including 192.168.0.0/24, but the right router, only for the 192.168.0.0/24 uses its own uplink, but the rest of the prefixes traffic is still sent to the left router. Because the BGP Weight attribute is local to the router, which means, it is not exchanged between the routers in the IBGP network, the BGP policy with the BGP Weight attribute just stays locally on the router.
Last but not least, as you can understand, BGP Weight attribute can be used for the Output path maniplautaion, also known as BGP Outbound Traffic Engineering.
Orhan Ergun, CCIE/CCDE Trainer, Author of Many Networking Books, Network Design Advisor, and Cisco Champion 2019/2020/2021
He created OrhanErgun.Net 10 years ago and has been serving the IT industry with his renowned and awarded training.
Wrote many books, mostly on Network Design, joined many IETF RFCs, gave Public talks at many Forums, and mentored thousands of his students.
Today, with his carefully selected instructors, OrhanErgun.Net is providing IT courses to tens of thousands of IT engineers.