Link Aggregation Configuration
此内容尚不支持你的语言。
show link-aggregation summary
Section titled “show link-aggregation summary”[Command] show link-aggregation summary
[Purpose] Display LAG configuration information
[View] System view
[Use Cases]
sonic# show link-aggregation summaryFlags: A - active, I - inactive, Up - up, Dw - Down, N/A - not available,S - selected, D - deselected, * - not syncedNo. Team Dev Protocol Ports----- --------------- ----------- -------------0001 PortChannel0001 LACP(A)(Dw) Ethernet1(D)0002 PortChannel0002 LACP(A)(Dw) Ethernet2(D)Description of the show link-aggregation summary command output
| **** Parameter | Description |
|---|---|
| Team Dev | Link aggregation group name |
| Protocol | Link aggregation group type: * LOADBALANCE: Static Link Aggregation Group |
- LACP: Dynamic Link Aggregation Group
- Dynamic Link Aggregation Group States:
- A (active): Indicates that the interface is in a normal and usable state.
- I (inactive): Indicates that the current interface is not available for use.
Link Aggregation Group States:
* Up: When at least one member interface in the aggregation group is in the UP state, and there are selected member interfaces in the dynamic link aggregation group. This allows for normal traffic forwarding. - Dw (Down): When there are no member interfaces in the UP state within the link aggregation group, or there are no selected member interfaces in the dynamic link aggregation group. This results in the inability to forward traffic. |
| Ports | Member Interface Physical States:
* Up: The interface’s physical state is UP. - Dw (Down): The interface’s physical state is Down.
- Member Interface States in LACP Mode:
- S (selected): Indicates that this member interface is in a selected state.
- D (deselected): Indicates that this member interface is not selected.
- * (not-synced): When the port link is in the UP state but is in a suspended state due to factors such as the remote end not enabling LACP or inconsistent port attributes negotiated through messages. |
interface link-aggregation
Section titled “interface link-aggregation”[Command] interface link-aggregationlag-id no interface link-aggregationlag-id
[Purpose] Add aggregation groups
[Parameter]
| Parameter | Description |
|---|---|
| lag-id | Aggregate group id, range 1-9999 |
[View] System configuration view
[Use Cases]
sonic# configure terminalsonic(config)# interface link-aggregation 3sonic(config-lagif-3)# show this!interface link-aggregation 3link-aggregation-group lag-id [port-priority
Section titled “link-aggregation-group lag-id [port-priority”[Command] link-aggregation-group lag-id [port-priorityport-priority**]** no link-aggregation-grouplag-id
[Purpose] Add member ports to an aggregation group
[Parameter]
| Parameter | Description |
|---|---|
| lag-id | Aggregate group id, range 1-9999 |
| port-priority | Interface priority, range 0-65535, default 255 |
[View] Interface view
[Usage Scenario] Configuring interface priority is done to differentiate between different interfaces on the same device. Interfaces with higher priority will be selected as active interfaces.
If interface priority is not configured, the active interfaces will be selected based on the interface numbers, with lower-numbered interfaces having higher priority.
[Notes]
- Port-priority is used for setting the priority of device ports. Ports with higher priority will be selected as active ports. This parameter is typically used to configure the priority of multiple ports within a Link Aggregation Group (LAG) to enable fast failover to backup links in case of a link failure.
- Lacp-key is used for setting the key value for the device’s Link Aggregation Control Protocol (LACP). Ports with the same key value will be considered part of the same aggregation group. When multiple ports in a LAG need to be controlled using LACP, they should have the same key value assigned to be recognized as part of the same aggregation group.
- Lacp-portid is used to set the port ID for the LACP protocol, which identifies each port within a Link Aggregation Group (LAG). When multiple ports in a LAG need to be controlled using LACP, each port should be assigned a unique port ID for correct identification and control.
[Use Cases]
sonic# configure terminalsonic(config)# interface ethernet 1sonic(config-if-1)# link-aggregation-group 1sonic(config-if-1)# link-aggregation-group 1 port-priority 500sonic# show link-aggregation summaryFlags: A - active, I - inactive, Up - up, Dw - Down, N/A - not available,S - selected, D - deselected, * - not syncedNo. Team Dev Protocol Ports----- --------------- ----------- ---------------------------0001 PortChannel0001 LACP(A)(Dw) Ethernet1(D) Ethernet2(D)0002 PortChannel0002 LACP(A)(Dw) Ethernet3(D)mode {dynamic|static}
Section titled “mode {dynamic|static}”[Command] mode {dynamic|static}
[Purpose] Configure the mode of the LAG
[View] Lagif view
[Usage Scenario] The device currently supports two types of operating modes:
Dynamic LACP Mode: In this mode, the device can achieve both load balancing and redundant backup functions. Additionally, it can automatically detect and add member ports to the Link Aggregation Group (LAG). This mode is suitable for scenarios where you want the device to manage LAGs automatically.
Default Static Mode: In this mode, LAG creation and the addition of member interfaces are entirely configured manually. This means that you have full control over which interfaces are part of the LAG and how they are configured. This mode is typically used when you want to configure LAGs and their members manually according to specific requirements.
[Use Cases]
sonic# configure terminalsonic(config)# interface link-aggregation 3sonic(config-lagif-3)# mode dynamicPlease enter 'commit' to make lacp and mode command take effertsonic(config-lagif-3)# commitsonic(config-lagif-3)# show this!interface link-aggregation 3mode dynamiclacp system-priority
Section titled “lacp system-priority”[Command] lacp system-prioritysystem-priority
[Purpose] Configure the sys_prio in the portchannel port lacp attribute
[Parameter]
| Parameter | Description |
|---|---|
| system-priority | system-priority, in the range 0-65535 |
[View] Lagif view
[Usage Scenario] Configuring the system priority is done to differentiate between the local device’s priority and the remote device’s priority in a Link Aggregation Group (LAG). The device with the higher system priority will be selected as the active side of the LAG, and the selection of active interfaces will be based on the active side’s interfaces.
When system priorities are not configured, the local and remote devices will be selected as the active side based on the system IDs. The device with the smaller system ID will become the active side. By default, the system ID is set to the system’s MAC address.
[Use Cases]
sonic# configure terminalsonic(config)# interface link-aggregation 3sonic (config-lagif-3)# lacp system-priority 100sonic (config-lagif-3)# show this!interface link-aggregation 3lacp system-priority 100mode dynamiclacp system-id
Section titled “lacp system-id”[Command] lacp system-idmac_address
no lacp system-id
[Purpose] Configure the sys_id in the portchannel port LACP attribute
[Parameter]
| Parameter | Description |
|---|---|
| mac_address | system-id, non-all-0 mac address |
[View] Lagif view
[Usage Scenario] The System ID is used to identify devices in the LACP (Link Aggregation Control Protocol) protocol. By default, the System ID is set to the system’s MAC address. When the system priority is not configured, the devices’ priority is determined based on the System ID’s size. Smaller System IDs are given higher priority.
[Use Cases]
sonic# configure terminalsonic(config)# interface link-aggregation 3sonic (config-lagif-3)# lacp system-id 00:a0:23:12:23:53sonic (config-lagif-3)# show this!interface link-aggregation 3commitlacp system-id 00:a0:23:12:23:53mode dynamiclacp fast-rate
Section titled “lacp fast-rate”[Command] lacp fast-rate no lacp fast-rate
[Purpose] Enable the fast_rate attribute of LACP
[View] Lagif view
[Usage Scenario] This configuration will make your local device consider a link as down if it doesn’t receive LACP packets from the remote device within a short period, which is usually around 3 seconds.
[Use Cases]
sonic# configure terminalsonic(config)# interface link-aggregation 3sonic (config-lagif-3)# lacp fast-ratesonic (config-lagif-3)# show this!interface link-aggregation 3lacp fast-ratemode dynamiclacp fallback
Section titled “lacp fallback”[Command] lacp fallback no lacp fallback
[Purpose] Enable the fallback attribute of LACP
[Usage Scenario] This command is used to enable the fast negotiation mode for the Link Aggregation Control Protocol (LACP). In this mode, the LACP protocol quickly renegotiates the link aggregation group in the event of a link failure, ensuring a fast recovery of the link aggregation group. Typically, LACP protocol link aggregation groups take some time to renegotiate, and if a link failure occurs, the reconfiguration process may lead to network interruption or delays, impacting the reliability and performance of the network. By using this command, the dynamic link aggregation group can be kept in the UP (active) state at all times, providing continuous and reliable network connectivity.
[Use Cases]
sonic# configure terminalsonic(config)# interface link-aggregation 3sonic (config-lagif-3)# lacp fallbacksonic (config-lagif-3)# show this!interface link-aggregation 3lacp fallbackmode dynamichash {mode_ecmp|mode_lag}
Section titled “hash {mode_ecmp|mode_lag}”[Command] hash {mode_ecmp|mode_lag}
[Purpose] Modify system hash mode
[Parameter]
| Parameter | Description |
|---|---|
| src-dst-ip | Source and destination ip address |
| src-dst-ip-port | Source and destination ip address and port |
| ip-protocol | protocol |
| dst-ip | Destination ip address |
| src-ip | Source ip address |
| l4-dst-port | Destination port |
| l4-src-port | Source port |
| ip6-flow-label | Flow label in ipv6 packets |
| src-dst-mac | Source and destination mac address |
| src-dst-mac-ip | Source and destination mac address and ip address |
[View] System view
[Usage Scenario] Different hash algorithms yield different load balancing results. Users can select an appropriate hash method for load balancing based on their traffic model. The default hash method for the device is src-dst-ip-port. Configurations within hash-fields can be freely combined.
[Use Cases]
sonic(config)# hash mode_ecmp src-dst-ip