BGP attributes: Weight


Facts about BGP weight attribute

  1. Cisco proprietary. Only available for Cisco routers, this attribute is not included in BGP update message.
  2. Because it is not included in update message, this attribute is only locally significant to one router.
  3. Because it is locally significant and only the configured router knows the weight, it is only viable for a Cisco router with more than one link peering to different BGP neighbors.
  4. This attribute is used to influence OUTBOUND traffic from the configured Cisco router. Higher weight is preferred.
  5. Weight attribute is the first attribute for Cisco router to “consider” for best BGP paths.
  6. Weight is applied to the inbound BGP routing updates in order to influence the OUTBOUND traffic.

Original BGP before weight is configured

R1#sh ip bgp | b Net
Network Next Hop Metric LocPrf Weight Path
*> 0 32768 i
* 0 2 i
*> 0 0 2 i
* 0 0 2 i
*> 0 2 i
*> 0 32768 i
*> 0 32768 i


So to reach and R1 will use R2, it is sensible for R1 to reach via R2 since this prefix is a directly connected network for R2. however is best reach via R3; this prefix is a directly connected network of R3.

Influence outbound traffic using weight on a neighbor

R1(config)#router bgp 1
R1(config-router)#neighbor weight 500

So what happens?


-_-” duh…. this is not what I want… I want via R2 and via R3. So applying weight on neighbors is not viable in this requirement.

Use route-map for more granularity on selecting outbound path with weight

R1(config)#access-list 33 permit
R1(config)#route-map R1->33 permit 10
R1(config-route-map)#match ip address 33
R1(config-route-map)#set weight 500
R1(config-route-map)#route-map R1->33 permit 20
R1(config-route-map)#set weight 0
R1(config-route-map)#router bgp 1
R1(config-router)#neighbor route-map R3->33 in


Using route-map is more granular, base on prefix i can choose which path to reach by using route-map with weight attribute.


2 thoughts on “BGP attributes: Weight

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s