The load-balance command sets a load balancing mode of an Eth-Trunk.
The undo load-balance command restores the default load balancing mode of an Eth-Trunk.
The default load balancing mode is src-dst-ip.
load-balance { dst-ip | dst-mac | src-ip | src-mac | src-dst-ip | src-dst-mac | enhanced profile profile-name }
undo load-balance
Only S5720-EI, S5720-HI, S5730-HI, S5730S-EI, S5730-SI, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6720-EI, S6720-HI, S6720-LI, S6720S-EI, S6720S-LI, S6720S-SI, S6720-SI, S6730-H, S6730S-H, S6730-S, and S6730S-S support enhanced profile profile-name.
Parameter |
Description |
Value |
---|---|---|
dst-ip |
Indicates load balancing based on destination IP addresses. |
- |
dst-mac |
Indicates load balancing based on destination MAC addresses. |
- |
src-ip |
Indicates load balancing based on source IP addresses. |
- |
src-mac |
Indicates load balancing based on source MAC addresses. |
- |
src-dst-ip |
Indicates load balancing based on source and destination IP addresses. |
- |
src-dst-mac |
Indicates load balancing based on source and destination MAC addresses. |
- |
enhanced profile profile-name |
Indicates the name of the profile used to configure enhanced load balancing. |
The value is a string of 1 to 31 characters. |
Usage Scenario
To ensure proper load balancing between physical links of an Eth-Trunk and avoid link congestion, use the load-balance command to set the load balancing mode of the Eth-Trunk.
Load balancing is valid only for outgoing traffic; therefore, the load balancing modes for the interfaces at both ends of the link can be different and do not affect each other.
You can set the load balancing mode based on traffic models. When a parameter of traffic changes frequently, you can set the load balancing mode based on this parameter to ensure that the traffic is load balanced evenly. For example, if IP addresses in packets change frequently, use the load balancing mode based on dst-ip, src-ip, or src-dst-ip so that traffic can be properly load balanced among physical links. If MAC addresses in packets change frequently and IP addresses are fixed, use the load balancing mode based on dst-mac, src-mac, or src-dst-mac so that traffic can be properly load balanced among physical links.
After the load-balance command is run to configure the load balancing mode for an Eth-Trunk, the hash factors used to calculate the outbound interface vary according to the packet type and device model. For example, after you configure load balancing based on the source and destination IP addresses for an Eth-Trunk, Layer 2 packets are load balanced automatically based on the source and destination MAC addresses because Layer 2 packets do not contain the source and destination IP addresses. You can run the display eth-trunk load-balance command to check the hash factors used when the outbound interface is calculated.
Prerequisites
Ensure that the load-balance-profile profile-name command has been executed to create a load balancing profile before you run the load-balance enhanced profile profile-name command.
Precautions
If you run the load-balance command multiple times, only the latest configuration takes effect.
When an inter-device Eth-Trunk is configured in a stack and the local device has Eth-Trunk member interfaces and the member interfaces function properly, only the Eth-Trunk member interfaces on the local device participate in load balancing. To enable Eth-Trunk member interfaces on other devices participate in load balancing, run the undo local-preference enable command to configure the Eth-Trunk not to preferentially forward local traffic.
If the value of member-number configured for an Eth-Trunk using the assign trunk { trunk-group group-number | trunk-member member-number }* command is larger than 16 on the S6720-EI and S6720S-EI or larger than 32 on the S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6730-H, S6730S-H, S6730-S, and S6730S-S, only the enhanced mode can be used for load balancing. If the enhanced mode is not used, problems such as packet loss and uneven load balancing may occur.
The S2720-EI, S5720I-SI, S5720-LI, S5720S-LI, S5720S-SI, S5720-SI, S5730S-EI, S5730-SI, S6720-LI, S6720S-LI, S6720S-SI, and S6720-SI use the src-dst-ip, source TCP or UDP port number, and destination TCP or UDP port number in the hash algorithm for load balancing regardless of whether you configure this parameter.
The S2720-EI, S5720I-SI, S5720-LI, S5735-L, S5735S-L, S5735S-L-M, S5720S-LI, S5720S-SI, S5720-SI, S5735-S, S5735S-S, S5735-S-I, S5730S-EI, S5730-SI, S6720-LI, S6720S-LI, S6720S-SI, and S6720-SI support only one load balancing mode globally. If the load balancing mode of an Eth-Trunk is modified, the modification takes effect on all Eth-Trunks. If an Eth-Trunk is created, the load balancing mode of the Eth-Trunk is the same as that of the original Eth-Trunks on the switch.
On the S5720-EI, S6720-EI, and S6720S-EI, when the load-balance command is run to configure the load balancing mode for an Eth-Trunk, whether the TCP or UDP port number is involved in the hash operation depends on the ecmp load-balance command. If the default setting is used or the port parameter is specified in the ecmp load-balance command, the TCP or UDP port number is involved in the hash operation when the dst-ip, src-ip, or src-dst-ip load balancing mode is configured for an Eth-Trunk.
On the S5720-HI, S5730-HI, S5731-H, S5731-S, S5731S-S, S5731S-H, S5732-H, S6720-HI, S6730-H, S6730S-H, S6730-S, and S6730S-S, when you run the load-balance { dst-ip | dst-mac | src-ip | src-mac | src-dst-ip | src-dst-mac } command to configure the load balancing mode for an Eth-Trunk, regardless of which parameter is specified, packets are load balanced based on physical-layer source port numbers in the packets.