BGP Path Attributes 1 – Weight

“WEIGHT” is Cisco Proprietary Attribute and it’s not included in the BGP updates. Weight can be set between 0-65535 (default value is 0) and higher value is more preferable. Weight is used within individual router, means its locally significant. When BGP choosing best path, Weight is considered first above all the other attributes.

BGP router set the weight to 0 on learned routes from peers and 32768 for locally generated routes.

In the below design and configuration output, all routes are configured with minimum configuration and we will focus on INBL and INTERNET routers to understand weight attribute in more detail.

So the INBL (AS-7090) and INTERNET (AS-8090) router is peering with ISP1 (AS-8070) and ISP2 (AS-9090) routers.BGP Attributes 1 - Weight - Design.001INTERNET router advertising two loopback interfaces (4.2.2.2 and 8.8.8.8) and two connected interfaces (30.1.80.0 and 30.1.90.0) using network command.

ISP1, ISP2 and INBL routers advertising connected interfaces using redistribute connected command

BGP Attributes 1 - Weight - Config.001

As per below output from INBL router, notice the selected routes which shows details about Weight attribute. As networks 4.2.2.2/32, 8.8.8.8/32, 30.1.80.0/30, 30.1.90.0/30 are learned from BGP peers, so Weight is set to 0 and networks 10.1.70.0/30, 20.1.90.0/30 and 192.168.1.0 are locally generated, so Weight is set to 32768.

Check the asterisk and caret symbol following every route; (*) symbol denotes valid route and (>) symbol denotes best route which is installed in routing table.

BGP Weight Attribute - Show ip bgp

As BGP considers Weight Attribute first, networks 4.2.2.2 and 8.8.8.8 are reachable via 20.1.90.2 means from ISP2.

To verify, check trace from INBL router.

INBL#traceroute 4.2.2.2 source loopback1
Type escape sequence to abort.
Tracing the route to 4.2.2.2
VRF info: (vrf in name/id, vrf out name/id)

  1 20.1.90.2 56 msec 56 msec 52 msec
  2 30.1.90.1 [AS 9090] 52 msec 52 msec 56 msec

Now we will change the default value from 0 to 100 for all routes.

BGP Attribute 1 - Weight - ChangedAfter configuration on INBL router, Weight has been changed to 100 on all learned routes from peers. Now we will check trace output again.

INBL#trace 4.2.2.2 source loopback1
Type escape sequence to abort.
Tracing the route to 4.2.2.2
VRF info: (vrf in name/id, vrf out name/id)

 1 10.1.70.2 32 msec 52 msec 52 msec
 2 30.1.80.1 [AS 8070] 68 msec 48 msec 52 msec

In the above configuration, we have changed the Weight for all routes. Now we will use ISP1 (20.1.90.2) to reach only 4.2.2.2/32 and 8.8.8.8/32 networks.

Configuration as below:

Route-Map-BGP Weight Attribute.001

Now check below output, as Weight has been changed for network 4.2.2.2/32 and 8.8.8.8/32 to 200 and traffic is routing towards 20.1.90.2 (ISP1).

BGP Attributes - Weight - Route-Map

HTH!

#DV

Advertisements

3 thoughts on “BGP Path Attributes 1 – Weight

Leave a Reply

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

WordPress.com Logo

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

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s