---
title: Link Aggregation Configuration
slug: routing/link-aggregation-configuration
createdAt: 2025-12-04T04:27:17.011Z
---

## <font color="#1d50a2">Link Aggregation Configuration</font>

### <font color="#1d50a2">show link-aggregation summary</font>

**\[Command]**
**show link-aggregation summary**

**\[Purpose]**
Display LAG configuration information

**\[View]**
System view

**\[Use Cases]**

```plaintext
sonic# show link-aggregation summary
Flags: 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) Ethernet1(D)
0002 PortChannel0002 LACP(A)(Dw) Ethernet2(D)
```

Description of the **show link-aggregation summary** command output

| ****<font color="#0C121D">**Parameter**</font> | <font color="#0C121D">**Description**</font>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| *Team Dev*                                     | Link aggregation group name                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| *Protocol*                                     | Link aggregation group type：<br />- LOADBALANCE: Static Link Aggregation Group<br />- LACP: Dynamic Link Aggregation Group<br />- Dynamic Link Aggregation Group States:<br />- A (active): Indicates that the interface is in a normal and usable state.<br />- I (inactive): Indicates that the current interface is not available for use.<br />Link Aggregation Group States:<br />- 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.<br />- 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:<br />- Up: The interface's physical state is UP.<br />- Dw (Down): The interface's physical state is Down.<br />- Member Interface States in LACP Mode:<br />- S (selected): Indicates that this member interface is in a selected state.<br />- D (deselected): Indicates that this member interface is not selected.<br />- \* (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.                                                                                                                                                                                                                                                                              |

### <font color="#1d50a2">interface link-aggregation *lag-id*</font>

**\[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]**

```plaintext
sonic# configure terminal
sonic(config)# interface link-aggregation 3
sonic(config-lagif-3)# show this
!
interface link-aggregation 3
```

### <font color="#1d50a2">link-aggregation-group lag-id \[port-priority *port-priority*\]</font>

**\[Command]**
**link-aggregation-group lag-id \[port-priority *port-priority*]**
**no link-aggregation-group *lag-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]**

```plaintext
sonic# configure terminal
sonic(config)# interface ethernet 1
sonic(config-if-1)# link-aggregation-group 1
sonic(config-if-1)# link-aggregation-group 1 port-priority 500
sonic# show link-aggregation summary
Flags: 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) Ethernet1(D) Ethernet2(D)
0002 PortChannel0002 LACP(A)(Dw) Ethernet3(D)
```

### <font color="#1d50a2">mode \{dynamic|static\}</font>

**\[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]**

```plaintext
sonic# configure terminal
sonic(config)# interface link-aggregation 3
sonic(config-lagif-3)# mode dynamic
Please enter 'commit' to make lacp and mode command take effert
sonic(config-lagif-3)# commit
sonic(config-lagif-3)# show this
!
interface link-aggregation 3
mode dynamic
```

### <font color="#1d50a2">lacp system-priority *system-priority*</font>

**\[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]**

```plaintext
sonic# configure terminal
sonic(config)# interface link-aggregation 3
sonic (config-lagif-3)# lacp system-priority 100
sonic (config-lagif-3)# show this
!
interface link-aggregation 3
lacp system-priority 100
mode dynamic
```

### <font color="#1d50a2">lacp system-id *mac\_address*</font>

**\[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]**

```plaintext
sonic# configure terminal
sonic(config)# interface link-aggregation 3
sonic (config-lagif-3)# lacp system-id 00:a0:23:12:23:53
sonic (config-lagif-3)# show this
!
interface link-aggregation 3
commit
lacp system-id 00:a0:23:12:23:53
mode dynamic
```

### <font color="#1d50a2">lacp fast-rate</font>

**\[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]**

```plaintext
sonic# configure terminal
sonic(config)# interface link-aggregation 3
sonic (config-lagif-3)# lacp fast-rate
sonic (config-lagif-3)# show this
!
interface link-aggregation 3
lacp fast-rate
mode dynamic
```

### <font color="#1d50a2">lacp fallback</font>

**\[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]**

```plaintext
sonic# configure terminal
sonic(config)# interface link-aggregation 3
sonic (config-lagif-3)# lacp fallback
sonic (config-lagif-3)# show this
!
interface link-aggregation 3
lacp fallback
mode dynamic
```

### 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]**

```plaintext
sonic(config)# hash mode_ecmp src-dst-ip
```

