The peer load-balancing command enables BGP peer group-based load balancing.
The undo peer load-balancing command restores the default configuration.
By default, BGP load balancing is not enabled.
Parameter | Description | Value |
---|---|---|
group-name |
Specifies the name of a peer group. |
The name is a string of 1 to 47 case-sensitive characters, with spaces not supported. When double quotation marks are used around the string, spaces are allowed in the string. |
as-path-ignore |
Prevents the router from comparing AS_Path attributes when selecting routes for load balancing. |
- |
as-path-relax |
Configures the device to ignore comparing the AS_Path attributes of the same length when selecting routes for load balancing. |
- |
Usage Scenario
On large networks, there may be multiple valid routes to the same destination. BGP, 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:Precautions
The maximum load-balancing and the peer load-balancing commands are mutually exclusive.
By default, BGP does not change the next-hop IP addresses of the routes to be advertised to IBGP peers to the local IP address. However, if BGP peer group-based load balancing is enabled, BGP changes the next-hop IP addresses of the routes to be advertised to the peer group to the local IP address. If the peer load-balancing command without as-path-ignore or as-path-relax specified and the load-balancing as-path-ignore or load-balancing as-path-relax command are run, the load-balancing as-path-ignore or load-balancing as-path-relax command takes effect. If the peer load-balancing command with as-path-ignore or as-path-relax specified and the load-balancing as-path-ignore or load-balancing as-path-relax command are run, the peer load-balancing command takes effect.<HUAWEI> system-view [~HUAWEI] ip vpn-instance vpn1 [*HUAWEI-vpn-instance-vpn1] ipv4-family [*HUAWEI-vpn-instance-vpn1-af-ipv4] route-distinguisher 100:1 [*HUAWEI-vpn-instance-vpn1-af-ipv4] quit [*HUAWEI-vpn-instance-vpn1] quit [*HUAWEI] bgp 100 [*HUAWEI-bgp] ipv4-family vpn-instance vpn1 [*HUAWEI-bgp-vpn1] group test [*HUAWEI-bgp-vpn1] peer test load-balancing as-path-relax