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 synced No. Team Dev Protocol Ports----- --------------- ----------- ------------- 0001 PortChannel0001 LACP(A)(Dw) Ethernet46(D) 0002 PortChannel0002 LACP(A)(Dw) Ethernet47(D)Description of the
| Parameter | Description |
|---|---|
| Team Dev | Link aggregation group name |
| Protocol | Link aggregation group type: Dynamic Link Aggregation Group States: Link Aggregation Group States: |
| Ports | Member Interface Physical States: Member Interface States in LACP Mode: |
show hash brief
Section titled “show hash brief”[Command] show hash brief
[Purpose] Show the system hash method
[View] System View
[Use Cases]
sonic# show hash briefHash Mode Hash Seed--------------- -----------src-dst-ip-port 10show lacp config
Section titled “show lacp config”[Command] show lacp config
[Purpose] Show the lacp configuration
[View] System View
[Use Cases]
sonic# show lacp configName Mode System-id Fast-rate Fallback System-priority--------------- ------- ----------------- ----------- ---------- -----------------PortChannel0001 dynamic 60:eb:5a:01:25:29 false false 65535PortChannel0002 dynamic 00:00:00:00:00:01 true true 2interface link-aggregation
Section titled “interface link-aggregation”[Command]
interface link-aggregation lag_id
no interface link-aggregation lag_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
Section titled “link-aggregation-group”[Command]
link-aggregation-group lag-id [port-priority ]
no link-aggregation-group
[Purpose]
Add member ports to an aggregation group
[Parameter]
| Parameter | Description |
|---|---|
| lag-id | Aggregate group id |
| 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 45sonic(config-if-45)# link-aggregation-group 1sonic(config-if-45)# 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) Ethernet46(D) Ethernet45(D)0002 PortChannel0002 LACP(A)(Dw) Ethernet47(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 3 mode dynamiclacp system-priority
Section titled “lacp system-priority”[Command]
lacp system-priority system_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 100 mode dynamiclacp system-id
Section titled “lacp system-id”[Command]
lacp system-id mac_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
Section titled “hash mode”[Command]
hash mode {src-dst-mac-ip-port|src-dst-ip|src-dst-ip-port|src-dst-mac|src-dst-mac-ip}
[Purpose]
Configure the device hash mode
[View]
System configuration view
[Usage Scenario]
Using different hash mode will yield different load-balancing results. Users can choose the appropriate hash mode based on their traffic model for load distribution. The default hash method for the device is src-dst-ip-port.
[Use Cases]
sonic(config)# hash mode src-dst-mac-ip-porthash seed
Section titled “hash seed”[Command]
hash seed interger
[Purpose]
Configure the device hash seed
[Parameter]
| Parameter | Description |
|---|---|
| interger | Value range: 0-4294967295, default value is 10 |
[View]
System configuration view
[Use Cases]
sonic(config)# hash seed 100