Routing Configuration Guide for Cisco 8000 Series Routers, Cisco IOS XR Release

PDF

Configure BGP with weights

Want to summarize with AI?

Log in

Teaches you how to apply bandwidth-based route policies in BGP and verify weight-driven UCMP distribution in CEF.


Configure BGP weighted ECMP using DMZ Link Bandwidth so that the router can use multiple eBGP paths in parallel and prefer traffic sharing based on link bandwidth values.

Procedure

1.

Create route policies for inbound bandwidth communities and for outbound traffic pass-through.

Example:

Router(config)# route-policy BW1
Router(config-rpl)# set extcommunity bandwidth (2906:45750000)
Router(config-rpl)# end-policy
Router(config)# exit

Router(config)# route-policy BW2
Router(config-rpl)# set extcommunity bandwidth (2906:47250000)
Router(config-rpl)# end-policy
Router(config)# exit

Router(config)# route-policy pass-all
Router(config-rpl)# pass
Router(config-rpl)# end-policy
Router(config)# exit
2.

Enter BGP configuration mode and enable multipath bestpath behavior.

Example:

Router(config)# router bgp 1
Router(config-bgp)# bgp bestpath as-path multipath-relax
Router(config-bgp)# address-family ipv4 unicast
Router(config-bgp-af)# maximum-paths eibgp 64
Router(config-bgp-af)# exit
3.

Configure each neighbor with eBGP, enable multipath, and assign inbound and outbound route policies.

Example:

Router(config-bgp-af)# neighbor 1.0.0.2
Router(config-bgp-nbr)# remote-as 2
Router(config-bgp-nbr)# ebgp-multihop 255
Router(config-bgp-nbr)# dmz-link-bandwidth
Router(config-bgp-nbr)# address-family ipv4 unicast
Router(config-bgp-nbr-af)# multipath
Router(config-bgp-nbr-af)# route-policy BW1 in
Router(config-bgp-nbr-af)# route-policy pass-all out
Router(config-bgp-nbr-af)# exit
Router(config-bgp-nbr-af)# neighbor 2.0.0.2
Router(config-bgp-nbr)# remote-as 2
Router(config-bgp-nbr)# ebgp-multihop 255
Router(config-bgp-nbr)# dmz-link-bandwidth
Router(config-bgp-nbr)# address-family ipv4 unicast
Router(config-bgp-nbr-af)# multipath
Router(config-bgp-nbr-af)# route-policy BW2 in
Router(config-bgp-nbr-af)# route-policy pass-all out
4.

Verify that the traffic is load-shared proportionally to the configured bandwidth weights.

  1. Check the CEF entry to verify correct values.

    Example:

    Via 1.0.0.2: set extcommunity bandwidth (2906:45750000) – Weight = 45750000/125=366000 (125 ratio because baud)

    Via 2.0.0.2: set extcommunity bandwidth (2906:47250000) – Weight = 47250000/125=378000

    GCD is 6, so norm_weight = 61 and 63. Though 61 + 63 > 64.

  2. Check the normalized weight values to confirm calculations.

    Example:

    GCD of weights 61 and 63 is 1.

    Normalised Weight = (Path weight/Total weight) * Maximum bucket size.

    The maximum bucket size value is 64. Total weight = 61+63 = 124.

    norm_weight1 = (61/124) * 64 = 31, norm_weight2 = (63/124) * 64 = 32

  3. Run the show cef command to verify that CEF normalized weights are derived from the configured DMZ bandwidth communities.

    Confirm CEF output reflects final normalized values.

    Confirm both next hops are installed for load sharing.

    Example:

    Router# show cef vrf default ipv4 97.0.0.0 detail
    97.0.0.0/24, version 1965, internal 0x5000001 0x0 (ptr 0x71bcb620) [1], 0x0 (0x0), 0x0 (0x0)
     Updated Oct 16 08:15:02.958
     Prefix Len 24, traffic index 0, precedence n/a, priority 4
      gateway array (0x72a5e2f8) reference count 10, flags 0x2010, source rib (7), 0 backups
                    [1 type 3 flags 0x48441 (0x71b02cd0) ext 0x0 (0x0)]
      LW-LDI[type=0, refc=0, ptr=0x0, sh-ldi=0x0]
      gateway array update type-time 1 Oct 16 08:15:02.958
     LDI Update time Oct 16 08:15:02.959
    
    
        Weight distribution:
        slot 0, weight 366000, normalized_weight 31
        slot 1, weight 378000, normalized_weight 32
    
    
      Level 1 - Load distribution: 0 1 0 1 0 1 0
    
    1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1
      [0] via 1.0.0.2/32, recursive
      [1] via 2.0.0.2/32, recursive
    

The router learns multipath routes from both neighbors and tags them with different bandwidth extended communities. It can install up to 64 e/iBGP multipaths. Traffic shares proportionally—about 31:32—across the two paths, instead of equal distribution.