BGP Path Attributes - Weight - www.ipcisco.com : www.ipcisco.com
You can Reach Our "CCNA Lab Courses with Packet Tracer" on Udemy.!!!
cisco-packet-tracer-ccna-adventure-1- cisco-packet-tracer-ccna-adventure-2-
Content Protection by DMCA.com

BGP Path Attributes – Weight

Weight attribute is a Cisco proprietary attribute that is the first step in the BGP Best Path selection algorithm. In Cisco devices, BGP firstly check the weight value and prefer the highest weight value. Then BGP Best Path selection continues with Local Preference and so on. If the device is not Cisco, weight is not important for you. You will start directly with Local Preference value to select the BGP Best Path in all other vendor products.

During Weight attribute configuration, different interfaces of the router are assigned different weight values. The interface with the highest Weight value is selected and the traffic goes through this interface. Weight value is local on a router that it is configured and it does not exchanged between routers.

The highest Weight value is selected always as BGP Best Path or Best Route, if there are multiple routes to the same destination.

Weight value can be between 0 and 65535. By default the learned routes has a weight value 0. This default value is 32768 for locally injected routes.

Weight attribute can be assigned in three ways:

• By neighbor command
• By AS-Path Access-Lists
• By Route Maps

Let’s give an example for each of these ways. As a reference topology, we will use the below basic topology:

bgp path attribute, weight

BGP Path Attribute, Weight

Think about that, you will assign Weight value 100 towards a neighbour, Weight value 200 towards other neighbour and Weight value 300 towards another neighbour.

By neighbour command, you can assign these values like below:

RouterA(config)# router bgp 10
RouterA(config-router)# neighbor 10.10.10.10 weight 100
RouterA(config-router)# neighbor 20.20.20.20 weight 200
RouterA(config-router)# neighbor 30.30.30.30 weight 300

Here, the ip addresses is not showed in picture, because this is not our main concentrated point.

By doing this, you are saying to the RouterA that, Best BGP Path is through RouterD. “Go through Router D”.
You can also configure the same properties by using AS-Path Access-Lists. The AS-Path Access-Lists configuration of the same weight configuration is like below:

RouterA(config)# router bgp 10
RouterA(config-router)# neighbour 10.10.10.10 remote-as 10
RouterA(config-router)# neighbour 10.10.10.10 filter-list 1 weight 100
RouterA(config-router)# neighbour 20.20.20.20 remote-as 20
RouterA(config-router)# neighbour 20.20.20.20 filter-list 2 weight 200
RouterA(config-router)# neighbour 30.30.30.30 remote-as 30
RouterA(config-router)# neighbor 30.30.30.30 filter-list 3 weight 300
RouterA(config-router)# exit
RouterA(config)# ip as-path access-list 2 permit ^10$
RouterA(config)# ip as-path access-list 2 permit ^20$
RouterA(config)# ip as-path access-list 3 permit ^30$

Here, we have also used regular expessions. These expressions seems a little complex but it is very useful and easy. Here, ^10$ means start with AS 10 and end with AS 10. So, it means only AS (Autonomous System) 10. This is like this for both ^20$ and ^30$.

The last way of applying Weight, is using Route Maps. The Weight attribute configuration with Route Maps is showned below:

RouterA(config)# router bgp 10
RouterA(config-router)# neighbour 10.10.10.10 remote-as 10
RouterA(config-router)# neighbour 10.10.10.10 route-map WeightConfig in
RouterA(config-router)# neighbour 20.20.20.20 remote-as 20
RouterA(config-router)# neighbour 20.20.20.20 route-map WeightConfig in
RouterA(config-router)# neighbour 30.30.30.30 remote-as 30
RouterA(config-router)# neighbour 30.30.30.30 route-map WeightConfig in 
RouterA(config-router)# exit
RouterA(config)# ip as-path access-list 2 permit ^20$
RouterA(config)# route-map WeightConfig permit 10
RouterA(config-route-map)# match as-path 2
RouterA(config-route-map)# set weight 10
RouterA(config-route-map)# exit
RouterA(config)# route-map WeightConfig permit 20
RouterA(config-route-map)# set weight 20
RouterA(config-route-map)# exit
RouterA(config)# route-map WeightConfig permit 30
RouterA(config-route-map)# set weight 30

With this configuration, we are saying to the router that, set the Weight values 10, 20 and 30 for the specific match. In the Route-Map we are saying, if the neighbour is in AS (Autonomous System) 10, set its Weight value as 100. If the neighbour is in AS 20, then set its weight value as 200. And lastly if the neighbour is in AS 30, then set its Weight as 300.

You can find other BGP Path Attribute Articles below:

BGP Path Attributes – Weight
BGP Path Attributes – Local Preference
BGP Path Attributes – AS Path
BGP Path Attributes – Origin
BGP Path Attributes – MED

Main BGP Article Series :

BGP – Part 1
BGP – Part 2 (BGP Peers, BGP Sessions, BGP Messages)
BGP – Part 3 (IBGP, IBGP Topologies and EBGP)
BGP – Part 4 (BGP Administrative Distance and BGP Path Attributes)
BGP – Part 5 (Packet Tracer BGP Configuration Example)

Youn can join OUR Facebook Group with the below links!!!

You can Reach Our "CCNA Lab Courses with Packet Tracer" on Udemy.!!!
cisco-packet-tracer-ccna-adventure-1- cisco-packet-tracer-ccna-adventure-2-



About the Author
Gokhan Kosem is a telecommunation and network engineer. His ambition to IP networks and end-to-end system installation made him to prepare this web-site. By sharing his experiences about various networking protocols beside different system installation experiences and Cisco, Juniper, Alcatel-Lucent devices configurations, he is aimed to be helpful for his collegues in all over the world. He is currently lives in Istanbul, Turkey.

Leave a Reply


Copy Protected by Chetan's WP-Copyprotect.