load-balance (System view)

Function

The load-balance command configures a load balancing mode for packet forwarding.

The undo load-balance command restores the default mode.

The default load balancing mode for packet forwarding is per-flow.

The default load balancing mode for packet forwarding is per-flow.

Format

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

undo load-balance { flow | packet } { slot slot-id | all }

Parameters

Parameter Description Value
packet

Configures the per-packet load balancing mode for packet forwarding.

-

flow

Configures the per-flow load balancing mode for packet forwarding.

-

slot slot-id

Specifies the slot ID of a board for which a load balancing mode is to be configured.

The value is a string of 1 to 256 case-sensitive characters, spaces not supported.

all

Indicates that a load balancing mode is to be configured for all boards.

-

Views

System view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
forwarding write

Usage Guidelines

Usage Scenario

The device supports per-packet and per-flow load balancing modes.

  • Per-packet load balancing: In this mode, the device checks the load of each link to implement even load balancing. This mode does not prevent packet disorder.
  • Per-flow load balancing: In this mode, the device uses the hash algorithm to calculate a value based on packet quintet information (protocol type, source IP address, destination IP address, source port number, and destination port number), and then selects a link for packet forwarding based on the calculated value. This mode prevents packet disorder.

    After this command is run, the per-packet or per-flow load balancing mode is set for all function (including Eth-Trunk) scenarios by default. If a load balancing mode is configured for a function module, for example, load-balance (Eth-Trunk interface view), the load balancing mode configured for the function module takes precedence over that configured globally.

Precautions

On the forwarding plane, this command takes effect on MPLS packets only on the P node.

On the control plane, this command takes effect on both IP and MPLS packets delivered by the CPU.

Example

# Configure per-packet load balancing for packets on the board in slot 1.
<HUAWEI> system-view
[~HUAWEI] load-balance packet slot 1
# Configure per-packet load balancing for packets on the system.
<HUAWEI> system-view
[~HUAWEI] load-balance packet
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >