peer load-balancing (BGP multi-instance VPN instance IPv4 address family view)

Function

The peer load-balancing command enables BGP peer-based load balancing.

The undo peer load-balancing command restores the default configuration.

By default, BGP load balancing is not enabled.

Format

peer ipv4-address load-balancing [ as-path-ignore | as-path-relax ]

undo peer ipv4-address load-balancing [ as-path-ignore | as-path-relax ]

Parameters

Parameter Description Value
ipv4-address

Specifies the IPv4 address of a peer.

The value is in dotted decimal notation.

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.

-

Views

BGP multi-instance VPN instance IPv4 address family view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
bgp write

Usage Guidelines

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:

  • The routes are received from the specified peer.
  • 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 command and the peer load-balancing command are mutually exclusive.

By default, BGP does not change the next hop addresses of routes to be advertised to IBGP peers to the local address. After peer-based load balancing is enabled, BGP does not change the next hop addresses of routes to be advertised, regardless of whether load balancing is implemented.

If load-balancing as-path-ignore or load-balancing as-path-relax is configured but as-path-ignore or as-path-relax is not configured in the peer load-balancing command, the configuration of load-balancing as-path-ignore or load-balancing as-path-relax takes effect. If as-path-ignore or as-path-relax is specified in the peer load-balancing command, the configuration specified in the peer load-balancing command takes effect.

Example

# Enable load balancing among routes learned from peer 10.1.1.1 and among routes learned from peer 10.2.2.2.
<HUAWEI> system-view
[~HUAWEI] ip vpn-instance vpna
[*HUAWEI-vpn-instance-vpna] ipv4-family
[*HUAWEI-vpn-instance-vpna-af-ipv4] route-distinguisher 100:1
[*HUAWEI-vpn-instance-vpna-af-ipv4] vpn-target 111:1 both
[*HUAWEI-vpn-instance-vpna-af-ipv4] quit
[*HUAWEI-instance-vpna] quit
[*HUAWEI] bgp 100 instance a
[*HUAWEI-bgp-instance-a] ipv4-family vpn-instance vpna
[*HUAWEI-bgp-instance-a-vpna] peer 10.1.1.1 as-number 100
[*HUAWEI-bgp-instance-a-vpna] peer 10.2.2.2 as-number 100
[*HUAWEI-bgp-instance-a-vpna] peer 10.2.2.2 enable
[*HUAWEI-bgp-instance-a-vpna] peer 10.1.1.1 enable
[*HUAWEI-bgp-instance-a-vpna] peer 10.2.2.2 enable
[*HUAWEI-bgp-instance-a-vpna] peer 10.1.1.1 load-balancing
[*HUAWEI-bgp-instance-a-vpna] peer 10.2.2.2 load-balancing
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >