< Home

load-balance (system view)

Function

The load-balance command enables the per-packet load balancing mode for IP packet forwarding.

The undo load-balance command restores the load balancing mode for IP packet forwarding to the default configuration.

By default, flow-based load balancing is used.

Format

load-balance { flow | packet } [ all | slot slot-id ]

undo load-balance packet [ all | slot slot-id ]

Parameters

Parameter Description Value
flow Indicates flow-based load balancing. -
packet Indicates packet-based load balancing. -
all

In a stack, the configuration is applied to all devices in the stack. On a stand-alone switch, the configuration is applied to the local device.

-
slot slot-id

Indicates that the configuration is applied to the device with the specified stack ID.

The value is an integer. It has a fixed value of 0 in a non-stack scenario, and depends on the device configuration in a stack scenario.

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

If flow-based load balancing is used, the hash algorithm is used to calculate a value for selecting a link to forward packets. The value is calculated based on the protocol type, source IP address, destination IP address, source port number, and destination port number.

If packet-based load balancing is used, packets are forwarded through different links. Packet-based load balancing can be implemented only for packets forwarded by the CPU such as protocol packets.

Precautions

The load-balance command takes effect for packets both delivered by the local device and processed by the CPU.

The load-balance command can also be used for MPLS packets.

Example

# Configure packet-based load balancing for IP packet forwarding.

<HUAWEI> system-view
[HUAWEI] load-balance packet
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >