On a large network, there may be multiple valid BGP routes to the same destination. A switch will select and add the optimal BGP route to its routing table for traffic forwarding and advertises this route to its peers. This, however, will result in uneven load balancing of much traffic. Configuring BGP load balancing can enable the switch to add these multiple equal-cost BGP routes to its routing table, implementing traffic load balancing and reducing network congestion. After BGP load balancing is configured, the switch will still select the optimal route among the multiple routes and advertise only this route to its peers.
Equal-cost BGP routes can be generated for traffic load balancing only when the first eight route attributes described in "BGP Route Selection Policies" are the same. Change load balancing rules by adjusting some configurations, for example, ignoring the comparison of the AS_Path attribute. When adjusting these configurations, ensure that these configurations do not result in routing loops.
If BGP load balancing is configured, the local device changes the next-hop address of routes to its address when advertising routes to IBGP peer groups, regardless of whether the peer next-hop-local command is used.
The system view is displayed.
The BGP view is displayed.
Run ipv4-family { unicast | multicast }
The IPv4 address family view is displayed.
Run ipv6-family [ unicast ]
The IPv6 address family view is displayed.
The maximum number of BGP routes to be used for load balancing is set.
By default, the maximum number of BGP routes to be used for load balancing is 1, indicating that load balancing is not implemented.
On a public network, if the routes to the same destination implement load balancing, the system will determine the optimal route type. If the optimal routes are IBGP routes, only IBGP routes carry out load balancing. If the optimal routes are EBGP routes, only EBGP routes carry out load balancing. This means that load balancing cannot be implemented among IBGP and EBGP routes with the same destination address.
On an IPv4 multicast network, BGP compares the AS_Path attributes of the routes to be used for load balancing. In this case, step 5 is not supported.
Configuring BGP not to compare the AS_Path attributes of the routes to be used for load balancing may cause routing loops.
BGP is configured not to compare the AS_Path attributes of the routes to be used for load balancing.
By default, BGP compares the AS_Path attributes of the routes to be used for load balancing.