Usage Scenario
On large networks, there may be multiple valid routes to the same destination. MBGP, however, advertises only the optimal route to its peers. This may result in unbalanced traffic on different routes. To prevent this problem, configure load balancing.
After the
peer load-balancing command is run, BGP peer-based load balancing is implemented only when the following conditions are met:
- The routes are received from the specified peer or peer group.
- The optimal route and optimal equal-cost routes exist.
- The AS_Path attribute is the same as that of the optimal route, or as-path-ignore or as-path-relax is specified in the peer load-balancing command.
- a.If as-path-ignore is specified, the device ignores comparing AS_Path attributes when selecting routes for load balancing. In this case, routes can participate in load balancing even if their AS_Path attributes are different.
- b.If as-path-relax is specified, the device ignores comparing the AS_Path attributes of the same length when selecting routes for load balancing. In this case, routes cannot participate in load balancing if their AS_Path attributes are of different lengths. For example, the AS_Path attribute of route A is 10, and the AS_Path attribute of route B is 10, 20. Because the two AS_Path attributes are of different lengths, the two routes cannot participate in load balancing.
Precautions
The maximum load-balancing and the peer load-balancing commands are mutually exclusive.