The maximum load-balancing command configures the maximum number of equal-cost routes for load balancing.
The undo maximum load-balancing command restores the default value.
By default, the maximum number of equal-cost routes is 1, indicating that load balancing is not implemented.
maximum load-balancing [ ebgp | ibgp ] number [ ecmp-nexthop-changed ]
undo maximum load-balancing [ ebgp | ibgp ]
Parameter | Description | Value |
---|---|---|
ebgp |
Indicates that only EBGP routes implement load balancing. |
- |
ibgp |
Indicates that only IBGP routes implement load balancing. |
- |
number |
Specifies the maximum number of equal-cost routes in the BGP routing table. |
BGP: The value is an integer that ranges from 1 to 8 on the S5720I-SI, S5720S-SI, S5720-SI, S5735-S, S5735S-S, S5735-S-I, S5730S-EI, S5730-SI, S6720S-SI, or S6720-SI. The value ranges from 1 to 16 on the S5720-EI, S5720-HI, S5730-HI, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6720-EI, S6720-HI, S6720S-EI, S6730-H, S6730S-H, S6730-S, or S6730S-S. BGP4+: The value is an integer that ranges from . |
ecmp-nexthop-changed |
Configures a BGP device to change the next-hop addresses of only the routes that participate in load balancing to its address. |
- |
ecmp-nexthop-changed is valid only in the BGP view, BGP IPv4 unicast address family view, BGP-VPN instance IPv4 address family view, BGP IPv6 unicast address family view and BGP-VPN instance IPv6 address family view.
BGP view, BGP-IPv4 unicast address family view, BGP-IPv4 multicast address family view, BGP-VPN instance IPv4 address family view, BGP-IPv6 unicast address family view, BGP-VPN instance IPv6 address family view
Usage Scenario
After BGP load balancing is configured, BGP routes that meet the following conditions and have the same AS_Path attribute will become equal-cost routes and implement load balancing:
PrefVal values are the same.
Local_Pref attributes are the same.
All BGP routes are aggregated or non-aggregated routes.
Lengths of the AS_path attributes are the same.
Origin types (IGP, EGP, or Incomplete) are the same.
Multi_Exit Discriminator (MED) values are the same.
All BGP routes are EBGP or IBGP routes.
The IGP metric values within an AS are the same.
Configuring BGP load balancing better utilizes network resources.
After the maximum load-balancing ebgp number command is run, only EBGP routes take part in load balancing. After the maximum load-balancing ibgp number command is run, only IBGP routes take part in load balancing. If [ ebgp | ibgp ] is not set, both EBGP routes and IBGP routes take part in load balancing, and the number of EBGP routes involved in load balancing is the same as that of IBGP routes involved in load balancing.
If you run the maximum load-balancing number command, the device changes the next-hop addresses of the routes to be advertised to a local address no matter whether the routes are used for load balancing. However, in RR or BGP confederation scenarios, the device does not change the next-hop addresses of non-local routes to be advertised to a local address.
If you run the maximum load-balancing { ebgp | ibgp } number command, the device does not change the next-hop addresses of the routes to be advertised to a local address no matter whether the routes are used for load balancing.
If you run the maximum load-balancing [ ebgp | ibgp ] number ecmp-nexthop-changed command, the device changes the next-hop addresses of the routes to be advertised to a local address only when the routes are used for load balancing.
Configuration Impact
If the maximum load-balancing command is run for multiple times, the latest configuration overrides the previous one.
Precautions
The maximum load-balancing number command cannot be configured together with the maximum load-balancing ebgp number or maximum load-balancing ibgp number command.