Usage Scenario
To configure the maximum number of equal-cost routes for load balancing, run the maximum load-balancing command. Load balancing improves the usage of network resources.
After BGP load balancing is configured, the routes that meet the following conditions can carry out load balancing as equal-cost routes.
- Original next-hop addresses are different.
- PrefVal values are the same.
- Local_Pref attributes are the same.
- The routes are either summarized or non-summarized.
- Origin attributes (IGP, EGP, or incomplete) are the same.
- MED values are the same.
- The routes are EBGP or IBGP routes.
- The IGP costs within an AS are the same.
- AS_Path attributes are the same.
For BGP routes with the same prefix in a routing table:
- If the optimal route and the routes selected for load balancing are all labeled routes, the number of routes used for load balancing depends on the maximum load-balancing ingress-lsp or maximum load-balancing transit-lsp command configuration.
- If the optimal route and the routes selected for load balancing are all non-labeled routes, the number of routes used for load balancing depends on the maximum load-balancing command configuration.
If BGP labeled routes implement load balancing and the ingress LSP creation criteria are met, ingress LSPs are created for the labeled routes; If BGP labeled routes implement load balancing and the transit LSP creation criteria are met, transit LSPs are created for the labeled routes.
After the maximum load-balancing ebgp number command is run, only EBGP routes implement road balancing. After the maximum load-balancing ibgp number command is run, only IBGP routes implement load balancing. If neither ebgp nor ibgp is configured, both EBGP and IBGP routes participate in load balancing, and the number of EBGP routes for load balancing is the same as the number of IBGP routes for load balancing.
By default, after the maximum load-balancing number command is run on a BGP device, the BGP device changes the next-hop of a route to itself before advertising the route to a peer, regardless of whether the route participates in load balancing. After ecmp-nexthop-changed is set, a BGP device changes the next-hop of only routes that participate in load balancing to itself before advertising them to peers and keeps the next-hop of the routes that do not participate in load balancing unchanged.
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 of only routes that participate in load balancing to itself before advertising them to peers and keeps the next-hop of the routes that do not participate in load balancing unchanged.
Precautions
The maximum load-balancing command cannot be configured together with the maximum load-balancing ebgp or maximum load-balancing ibgp command.
If either the ebgp or the ibgp parameter is configured in the
maximum load-balancing command, this parameter must be also configured in the
undo maximum load-balancing command to delete load balancing.
The maximum load-balancing and the
peer load-balancing commands are mutually exclusive.