---
title: LAG
slug: aidc/lag
createdAt: 2025-12-01T11:11:06.000Z
---

## <font color="#1d50a2">LAG View</font>

<font color="#1d05a2">Table 1 LAG View</font>

| **Command**                                 | **Purpose**                                             |
| ------------------------------------------- | ------------------------------------------------------- |
| **show link-aggregation summary**           | Display LAG configuration.                              |
| **show** \{**ip**\|**ipv6**} **interfaces** | Display IP address configuration of lag interfaces.     |
| **show interface lag** *lag-id*             | Display information about the status of LAG interfaces. |

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

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

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

**\[View]**
Privileged User 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  Lag1        LACP(A)(Dw)  Ethernet46(D)
 0002  Lag2        LACP(A)(Dw)  Ethernet47(D)
```

### <font color="#1d50a2">show \{ip|ipv6\} interfaces</font>

**\[Command]**
**show** \{**ip**|**ipv6**} **interfaces**

**\[Purpose]**
Display IP address configuration of lag interfaces.

**\[View]**
Privileged User View

**\[Use Cases]**

```plaintext
sonic# show ip interfaces
Interface        Master    IPv4 address/mask    Admin/Oper    BGP Neighbor    Neighbor IP
---------------  --------  -------------------  ------------  --------------  -------------
0/0.2                      2.0.0.1/24           up/down       N/A             N/A
0/48                       199.0.3.1/24         up/up         N/A             N/A
loopback0                  10.1.0.34/32         up/up         N/A             N/A
lag24                      24.0.0.1/24          up/down       N/A             N/A
mgmt                       10.250.0.138/24      up/up         N/A             N/A
```

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

**\[Command]**
**show interface lag** *lag-id*

**\[Purpose]**
Display information about the status of LAG interfaces.

**\[Parameters]**

| **Parameter** | **Description**                      |
| ------------- | ------------------------------------ |
| *lag-id*      | LAG ID, the range is from 1 to 9999. |

**\[View]**
Privileged User 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          Description
-----  ---------------  -----------  -------------  -------------
 0010  lag 10           LACP(A)(Up)  0/3      (D)   N/A
                                     0/2      (S)
                                     0/4      (D)
sonic# show interface lag 10
lag10           is up, line protocol is up
Hardware is Eth
Mac address is N/A
Interface index is 0010
Description is N/A
Mode of IPV4 address assignment: not-set
Mode of IPV6 address assignment: not-set
IP MTU  9216 bytes
LineSpeed 30.0G, CurrentSpeed 10.0G, Auto-negotiation off
Input statistics:
        82 packets, 14988 octets
        82 Multicasts, 0 Broadcasts, 0 Unicasts
        0 error, 0 discarded
Output statistics:
        1205 packets, 158858 octets
        1205 Multicasts, 0 Broadcasts, 0 Unicasts
        0 error, 0 discarded
```

## LAG Config

<font color="#1d05a2">Table 2 LAG Config</font>

| **Command**                                                                                                                          | **Purpose**                                                       |
| ------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------- |
| **interface link-aggregation** *lag-id*                                                                                              | Create a link-aggregation group and enter LAG Configuration View. |
| **description** *description*                                                                                                        | Specify the description for the lag.                              |
| **link-aggregation-group** *lag-id* \[**port-priority** *port-priority*] \[**lacp-key** *lacp-key*] \[**lacp-portid** *lacp-portid*] | Configure the lag member ports and set their attributes.          |
| **mode** \{*dynamic\|static*}                                                                                                        | Set the aggregation mode.                                         |
| **lacp min-links** *min-links*                                                                                                       | Set the minimum number of active links for LACP.                  |
| **lacp system-priority** *system-priority*                                                                                           | Set system-priority for LACP.                                     |
| **lacp system-id** *HH\:HH\:HH\:HH\:HH\:HH*                                                                                          | Set system-id for LACP.                                           |
| **lacp fast-rate**                                                                                                                   | Enable short timeout for LACP.                                    |
| **lacp fallback**                                                                                                                    | Enable fallback for LACP.                                         |
| **mtu** *mtu*                                                                                                                        | Configure the MTU value on a lag interface.                       |
| **shutdown**                                                                                                                         | Bring the lag down administratively.                              |
| **ip address** \{*A.B.C.D/M\|A\::B/M*} \[**secondary**]                                                                              | Configure IP address for the lag interface.                       |
| **mac\_address** *HH\:HH\:HH\:HH\:HH\:HH*                                                                                            | Specify a MAC address to the lag interface.                       |
| **mac-address learning**                                                                                                             | Enable MAC learning for the lag.                                  |
| **lacp graceful-down**                                                                                                               | Dynamic LAG disconnects LACP interactions actively.               |

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

**\[Command]**
**interface link-aggregation** *lag-id*

**\[Purpose]**
Create a link-aggregation group and enter LAG Configuration View.

**\[Parameters]**

| **Parameter** | **Description**                      |
| ------------- | ------------------------------------ |
| *lag-id*      | LAG ID, the range is from 1 to 9999. |

**\[View]**
Global Configuration View

**\[Notes]**
The default aggregation mode is LACP.
Run command **no interface link-aggregation** *lag-id* to delete the link-aggregation group. The member ports should be removed before deleting.

**\[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">description *description*</font>

**\[Command]**
**description** *description*

**\[Purpose]**
Specify the description for the lag.

**\[Parameters]**

| **Parameter** | **Description** |
| ------------- | --------------- |
| *description* | In string form. |

**\[View]**
LAGIF Configuration View

**\[Notes]**
Run command **no description** to delete description.

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# interface link-aggregation 100
sonic(config-lagif-100)# description lag100
sonic(config-lagif-100)# do 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                        Description
-----  ---------------  ---------------  ---------------------------  -------------
0100  lag100           LACP(A)(Dw)                                   lag100
```

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

**\[Command]**
**link-aggregation-group** *lag-id* \[**port-priority** *port-priority*] \[**lacp-key** *lacp-key*] \[**lacp-portid** *lacp-portid*]

**\[Purpose]**
Configure the lag member ports and set their attributes.

**\[Parameters]**

| **Parameter**   | **Description**                                                 |
| --------------- | --------------------------------------------------------------- |
| *lag-id*        | LAG ID, the range is from 1 to 9999.                            |
| *port-priority* | Port priority, the range is 0-65535. The default is 255.        |
| *lacp-key*      | LACP message key value, the range is 0-65535. The default is 0. |
| *lacp-portid*   | Interface id value, the range is 0-65535                        |

**\[View]**
Physical Interface Configuration View

**\[Notes]**
Run command **no link-aggregation-group** *lag-id* to delete aggregation member ports.

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# interface ethernet 0/45
sonic(config-if-0/45)# link-aggregation-group 1
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   Lag1       LACP(A)(Dw)  Ethernet46(D) Ethernet45(D)
0002   Lag2       LACP(A)(Dw)  Ethernet47(D)
sonic(config-if-0/45)# link-aggregation-group 1 port-priority 500
sonic(config-if-0/45)# link-aggregation-group 2 port-priority 500 lacp-key 10 lacp-portid 60
```

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

**\[Command]**
**mode** \{**dynamic**|**static**}

**\[Purpose]**
Set the aggregation mode.

**\[View]**
LAGIF Configuration View

**\[Notes]**
Run **commit** to take effect;
The default is dynamic(LACP).

**\[Use Cases]**

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

### <font color="#1d50a2">lacp min-links *min-links*</font>

**\[Command]**
**lacp min-links** *min-links*

**\[Purpose]**
Set the minimum number of active links for LACP.

**\[Parameters]**

| **Parameter** | **Description**                                         |
| ------------- | ------------------------------------------------------- |
| *min-links*   | The minimum number of active links, the range is 1-128. |

**\[View]**
Dynamic LAGIF Configuration View

**\[Use Cases]**

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

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

**\[Command]**
**lacp system-priority** *system-priority*

**\[Purpose]**
Set system-priority for LACP.

**\[Parameters]**

| **Parameter**     | **Description**                        |
| ----------------- | -------------------------------------- |
| *system-priority* | System priority, the range is 0-65535. |

**\[View]**
Dynamic LAGIF Configuration View

**\[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 *HH\:HH\:HH\:HH\:HH\:HH*</font>

**\[Command]**
**lacp system-id** *HH\:HH\:HH\:HH\:HH\:HH*

**\[Purpose]**
Set system-id for LACP.

**\[Parameters]**

| **Parameter**            | **Description** |
| ------------------------ | --------------- |
| *HH\:HH\:HH\:HH\:HH\:HH* | MAC address.    |

**\[View]**
Dynamic LAGIF Configuration View

**\[Notes]**
Run command **no lacp system-id** to delete system-id configuration.

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

**\[Purpose]**
Enable short timeout for LACP.

**\[View]**
Dynamic LAGIF Configuration View

**\[Notes]**
The default LACP timeout mode is long timeout.
Run command **no lacp fast-rate** to disable short timeout for LACP.

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

**\[Purpose]**
Enable fallback for LACP.

**\[View]**
Dynamic LAGIF Configuration View

**\[Notes]**
Run command **no lacp fallback** to disable fallback for LACP.

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

### <font color="#1d50a2">mtu *mtu*</font>

**\[Command]**
**mtu** *mtu*

**\[Purpose]**
Configure the MTU value on a lag interface.

**\[Parameters]**

| **Parameter** | **Description**                                                                       |
| ------------- | ------------------------------------------------------------------------------------- |
| *mtu*         | Maximum Transmission Unit, the range is from 1312 to 9216. The default is 9216 Bytes. |

**\[View]**
LAGIF Configuration View

**\[Use Cases]**

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

### <font color="#1d50a2">shutdown</font>

**\[Command]**
**shutdown**

**\[Purpose]**
Bring the lag down administratively.

**\[View]**
LAGIF Configuration View

**\[Notes]**
Run command **no shutdown** to bring the lag up administratively.

**\[Use Cases]**

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

### <font color="#1d50a2">ip address \{*A.B.C.D/M|A\:\:B/M*\} \[secondary\]</font>

**\[Command]**
**ip address** \{*A.B.C.D/M|A\::B/M*} \[**secondary**]

**\[Purpose]**
Configure IP address for the lag interface.

**\[Parameters]**

| **Parameter** | **Description**                                                                                                                                                          |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| *A.B.C.D/M*   | IPv4 address with prefix length.                                                                                                                                         |
| *A\::B/M*     | IPv6 address with prefix length.                                                                                                                                         |
| **secondary** | The default is Primary IP, specifying this option means configuring as Secondary IP, which requires that the Secondary IP and Primary IP be in the same network segment. |

**\[View]**
LAGIF Configuration View

**\[Notes]**
IPv4 address with subnet mask /32 is not allowed to be configured. Addresses with subnet mask /31 is allowed. In other subnet masks, addresses with the host portion all-zeros or all-ones are not allowed. IPv6 address with subnet mask /127 or /128 is not allowed to be configured. In other subnet masks, addresses with the host portion all-zeros are not allowed, but all-ones are allowed.
Run command **no ip address** \{*A.B.C.D/M|A\::B/M*} \[**secondary**] to delete IP address configuration of the lag interface.

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# interface link-aggregation 3
sonic(config-lagif-3)# ip address 3.3.3.6/24
sonic(config-lagif-3)# show this
!
interface link-aggregation 3
ip address 3.3.3.6/24
```

### <font color="#1d50a2">mac\_address *HH\:HH\:HH\:HH\:HH\:HH*</font>

**\[Command]**
**mac\_address** *HH\:HH\:HH\:HH\:HH\:HH*

**\[Purpose]**
Specify a MAC address to the lag interface.

**\[Parameters]**

| **Parameter**           | **Description**                  |
| ----------------------- | -------------------------------- |
| *HH\:HH\:HH\:HH\:HH*:HH | MAC address, not case sensitive. |

**\[View]**
LAGIF Configuration View

**\[Notes]**
The default is the MAC of the switch;
Run command **no mac\_address** to restore the MAC of the lag interface to default.

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# interface link-aggregation 3
sonic(config-lagif-3)# mac-address 18:17:25:37:67:af
sonic(config-lagif-3)# show this
!
interface link-aggregation 3
mac-address 18:17:25:37:67:af
```

### <font color="#1d50a2">mac-address learning</font>

**\[Command]**
**mac-address learning**

**\[Purpose]**
Enable MAC learning for the lag.

**\[View]**
LAGIF Configuration View

**\[Notes]**
The interface to be operated should be added to a VLAN.
MAC learning is enabled by default.
Run command **no mac-address learning** to disable MAC learning for the lag.

**\[Use Cases]**

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

### <font color="#1d50a2">lacp graceful-down</font>

**\[Command]**
**lacp graceful-down**

**\[Purpose]**
Dynamic LAG disconnects LACP interactions actively.

**\[View]**
LAGIF Configuration View

**\[Notes]**
After executing the **no lacp graceful-down** command, the LAG resumes lacp interaction.
This command is valid for a single time and will not be saved to the configuration, i.e., the LAG interface will be restored to UP after reboot or reload.

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# interface link-aggregation 3
sonic(config-lagif-3)# lacp graceful-down
```

