load-balance
Function
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.
By default, the load balancing mode is src-dst-ip.
Format
load-balance { dst-ip | dst-mac | src-ip | src-mac | src-dst-ip | src-dst-mac }
undo load-balance
Parameters
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. |
- |
Usage Guidelines
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.
The device supports the following load balancing modes:
- dst-ip: load balancing based on destination IP address. In this mode, the system obtains the specified three bits from each of the destination IP address and the TCP or UDP port number in outgoing packets to perform the Exclusive-OR calculation, and then selects the outgoing interface from the Eth-Trunk table according to the calculation result.
- dst-mac: load balancing based on destination MAC address. In this mode, the system obtains the specified three bits from each of the destination MAC address, VLAN ID, Ethernet type, and incoming interface information to perform the Exclusive-OR calculation, and then selects the outgoing interface from the Eth-Trunk table according to the calculation result.
- src-ip: load balancing based on source IP address. In this mode, the system obtains the specified three bits from each of the source IP address and the TCP or UDP port number in incoming packets to perform the Exclusive-OR calculation, and then selects the outgoing interface from the Eth-Trunk table according to the calculation result.
- src-mac: load balancing based on source MAC address. In this mode, the system obtains the specified three bits from each of the source MAC address, VLAN ID, Ethernet type, and incoming interface information to perform the Exclusive-OR calculation, and then selects the outgoing interface from the Eth-Trunk table according to the calculation result.
- src-dst-ip: load balancing based on the Exclusive-OR result of the source IP address and destination IP address. In this mode, the system performs the Exclusive-OR calculation between the Exclusive-OR results of the dip and dmac modes, and then selects the outgoing interface from the Eth-Trunk table according to the calculation result.
- src-dst-mac: load balancing based on the Exclusive-OR result of the source MAC address and destination MAC address. In this mode, the system obtains three bits from each of the source MAC address, destination MAC address, VLAN ID, Ethernet type, and incoming interface information to perform the Exclusive-OR calculation, and then selects the outgoing interface from the Eth-Trunk table according to the calculation result.
Precautions
If you run the load-balance command multiple times, only the latest configuration takes effect.