load-balancing (BGP-IPv4 unicast address family view)

Function

The load-balancing as-path-ignore command prevents a router from comparing the AS_Path attributes of routes when selecting routes for load balancing.

The undo load-balancing as-path-ignore command cancels the configuration.

The load-balancing as-path-relax command configures a device to compare AS_Path lengths rather than AS_Path content when selecting routes for load balancing. That is, routes with different AS_Path attributes can be selected for load balancing as long as their AS_Path lengths are the same.

The undo load-balancing as-path-relax command cancels the configuration.

By default, a router compares the AS-Path attributes of routes when selecting routes for load balancing.

Format

load-balancing { as-path-ignore | as-path-relax }

undo load-balancing { as-path-ignore | as-path-relax }

Parameters

None

Views

BGP-IPv4 unicast address family view, BGP-Labeled address family view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
bgp write

Usage Guidelines

Usage Scenario

After the load-balancing as-path-ignore command is run, a router does not compare the AS-Path attributes of routes (including the AS_Path length and content) when selecting routes for load balancing. Exercise caution when using the command because the execution of this command will change the conditions of load balancing.

When selecting routes for load balancing, BGP processes the AS_Path attributes as follows:

  • Requires that the routes for load balancing have the same AS_Path attribute.
  • Ignores comparing the AS_Path attributes if the load-balancing as-path-ignore command is run. If the command is run, it is not required that the routes for load balancing have the same AS_Path attribute.
  • Ignores the AS_Path content and compares only AS_Path lengths. To configure this function, run the load-balancing as-path-relax command. After this command is run, only the AS_Path lengths are compared and the AS_Path content is not compared when selecting routes for load balancing. That is, load balancing can be implemented as long as the AS_Paths have the same length and 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.

    The load-balancing as-path-relax command mainly applies to BGP route load balancing scenarios. Exercise caution when using the command because the execution of this command will change the conditions of load balancing.

Precautions

The load-balancing as-path-ignore command and the bestroute as-path-ignore command are mutually exclusive.

If both the load-balancing as-path-relax and load-balancing as-path-ignore commands are run, the latest configuration overrides the previous one.

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.

Example

# Prevent a router from comparing the AS_Path attributes of routes when selecting routes for load balancing.
<HUAWEI> system-view
[~HUAWEI] bgp 100
[*HUAWEI-bgp] ipv4-family unicast
[*HUAWEI-bgp-af-ipv4] load-balancing as-path-ignore
# Configure a device to ignore comparing the AS_Path attributes of the same length when selecting routes for load balancing.
<HUAWEI> system-view
[~HUAWEI] bgp 100
[*HUAWEI-bgp] ipv4-family unicast
[*HUAWEI-bgp-af-ipv4] load-balancing as-path-relax
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >