Change the Weight Added to Received BGP4 Routes

The device adds weight to routes that are received from BGP neighbors. In the BGP4 path-selection algorithm, routes with larger weights have preference over routes with smaller weights.

About this task

You can change the weight of routes that are received from a specified BGP neighbor.

Procedure

  1. Access global configuration mode.
    device# configure terminal
  2. Access BGP configuration mode.
    device(config)# router bgp
  3. Specify the autonomous system in which your device resides.
    device(config-bgp-router)# local-as 1000
  4. Access address-family IPv4 unicast configuration mode.
    device(config-bgp-router)# address-family ipv4 unicast
  5. Specify the neighbor and the weight that you want to add to routes that are received from that neighbor.
    device(config-bgp-ipv4u)# neighbor 10.11.12.13 weight 100
    This example shows the neighbor command, the IP address of the neighbor, the weight keyword, and the weight value of 100.

Example

This example summarizes the commands in this procedure.
device# configure terminal
device(config)# router bgp
device(config-bgp-router)# local-as 1000
device(config-bgp-router)# address-family ipv4 unicast
device(config-bgp-ipv4u)# neighbor 10.11.12.13 weight 100