---
title: MC-LAG
slug: aidc/mc-lag
createdAt: 2025-12-01T11:11:09.000Z
---

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

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

| Command                                                                      | Purpose                                                           |
| ---------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| **show mclag state** \[*domain-id*]                                          | Display information about MC-LAG.                                 |
| **show mclag consistency\_check\_result**                                    | Display the results of the parameter consistency check of MC-LAG. |
| **show interface errdown**                                                   | Display interfaces with err-down status.                          |
| **show loopback-detect** \[**ethernet\|link-aggregation** *interface\_name*] | Display MC-LAG loopback detection configuration.                  |

### <font color="#1d50a2">show mclag state \[*domain-id*\]</font>

**\[Command]**
**show mclag state** \[*domain-id*]

**\[Purpose]**
Display information about MC-LAG.

**\[Parameters]**

| **Parameter** | **Description**                                         |
| ------------- | ------------------------------------------------------- |
| *domain-id*   | Specify the domain ID, and the range is from 1 to 4095. |

**\[View]**
Privileged User View

**\[Use Cases]**

```plaintext
sonic# show mclag state 11
The MCLAG's keepalive is: OK
MCLAG info sync is: completed
Domain id: 11
Local Ip: 11.0.0.6
Peer Ip: 11.0.0.7
Peer Link Interface: Ethernet100
Keepalive time: 1
sesssion Timeout : 15
Peer Link Mac: 18:17:25:37:67:20
Role: Active
MCLAG Interface: PortChannel0009
Loglevel: NOTICE
```

### <font color="#1d50a2">show mclag consistency\_check\_result</font>

**\[Command]**
**show mclag consistency\_check\_result**

**\[Purpose]**
Display the results of the parameter consistency check of MC-LAG.

**\[View]**
Privileged User View

**\[Use Cases]**

```plaintext
sonic# show mclag consistency_check_result
---------------------------------------------------------------------------------
ifname        mode(lacp/static)   fast-rate   fallback    trunk_mode  allowed_vlan
---------------------------------------------------------------------------------
lag203             Pass                Pass         Pass          Pass          Pass
lag202             Pass                Pass         Pass          Pass          Pass
```

### <font color="#1d50a2">show interface errdown</font>

**\[Command]**
**show interface errdown**

**\[Purpose]**
Display interfaces with err-down status.

**\[View]**
Privileged User View

**\[Use Cases]**

```plaintext
sonic# show interface errdown
Interface        Status
---------------  --------
Ethernet0        errdown
Ethernet1        up
Ethernet2        up
Ethernet3        up
Ethernet4        up
Ethernet5        up
Ethernet6        up
Ethernet7        up
Ethernet8        up
Ethernet9        up
Ethernet10       up
Ethernet11       up
Ethernet12       up
Ethernet13       up
Ethernet14       up
Ethernet15       up
Ethernet16       up
Ethernet17       up
Ethernet18       up
Ethernet19       up
Ethernet20       up
Ethernet21       up
Ethernet22       up
Ethernet23       up
Ethernet24       up
Ethernet25       up
Ethernet26       up
Ethernet27       up
Ethernet28       up
Ethernet29       up
Ethernet30       up
Ethernet31       up
Ethernet32       up
Ethernet33       up
Ethernet34       errdown
Ethernet35       up
Ethernet36       up
Ethernet37       up
Ethernet38       up
Ethernet39       up
Ethernet40       up
Ethernet41       up
Ethernet42       up
Ethernet43       up
Ethernet44       up
Ethernet45       up
Ethernet46       up
Ethernet47       errdown
Ethernet48       errdown
Ethernet52       up
Ethernet56       errdown
Ethernet60       errdown
Ethernet64       errdown
Ethernet68       up
Ethernet72       up
Ethernet76       up
PortChannel0001  errdown
PortChannel0099  up
```

### <font color="#1d50a2">show loopback-detect \[ethernet|link-aggregation *interface\_name*\]</font>

**\[Command]**
**show loopback-detect** \[**ethernet**|**link-aggregation** *interface\_name*]

**\[Purpose]**
Display MC-LAG loopback detection configuration.

**\[Parameters]**

| **Parameter**     | **Description**         |
| ----------------- | ----------------------- |
| *interface\_name* | Interface name (eg.0/1) |

**\[View]**
Privileged User View

**\[Use Cases]**

```plaintext
sonic# show loopback-detect
Port    Policy    Vlan       Interval    Wait time  Vlans with loop
------  --------  -------  ----------  -----------  -----------------
lag111  shutdown  100-200          10           60
sonic# show loopback-detect link-aggregation 111
Port    Policy    Vlan       Interval    Wait time  Vlans with loop
------  --------  -------  ----------  -----------  -----------------
lag111  shutdown  100-200          10           60
```

## <font color="#1d50a2">MC-LAG Config</font>

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

| Command                                                                                                                   | Purpose                                                                                          |
| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
| **mclag domain** *domain-id*                                                                                              | Create a MC-LAG domain.                                                                          |
| **peer-link \{ethernet\|link-aggregation}** *interface\_name*                                                             | Set peer-link for MC-LAG.                                                                        |
| **peer-address** \{*A.B.C.D\|A\::B*}                                                                                      | Configure peer IP address of MC-LAG control link.                                                |
| **local-address** \{*A.B.C.D\|A\::B*}                                                                                     | Configure local IP address of MC-LAG control link.                                               |
| **heartbeat-interval** *interval*                                                                                         | Set the sending interval for MC-LAG keepalive messages.                                          |
| **session-timeout** *timeout*                                                                                             | Set the timeout for MC-LAG sessions.                                                             |
| **member lag** *lag-id*                                                                                                   | Configure the member ports for MC-LAG.                                                           |
| **vrf** *vrf\_name*                                                                                                       | Specify the vrf that MC-LAG keepalive session belongs to.                                        |
| **consistency-check-action \{default\|graceful\|idle}**                                                                   | Specify the mode for MC-LAG consistency check.                                                   |
| **backup-channel vlan** *vlan-id*                                                                                         | Configure ICCP backup channel for MC-LAG.                                                        |
| **dad local-address** \{*A.B.C.D\|A\::B*}                                                                                 | Configure local IP address of MC-LAG DAD link.                                                   |
| **dad peer-address** \{*A.B.C.D\|A\::B*}                                                                                  | Configure peer IP address of MC-LAG DAD link.                                                    |
| **dad detection-delay** *delay\_time*                                                                                     | Specify the delay time for MC-LAG DAD detection.                                                 |
| **dad recovery-delay \{non-mlag\|mlag} delay\_time**                                                                      | Specify the delay time for the interfaces in error-down to be brought up on MC-LAG standby side. |
| **dad vrf** *vrf\_name*                                                                                                   | Specify the vrf where MC-LAG DAD link is located.                                                |
| **loopback-detect vlan** *vlan-id* \[**policy \{shutdown\|block-vlan} interval** *interval* \[**wait-time** *wait-time*]] | Configure MC-LAG loopback detection.                                                             |
| **unique-ip vlan** *vlan-id* \[**diff\_mac\|same\_mac**]                                                                  | Enable unique-ip feature for the VLAN.                                                           |

Notes:

- It is recommended to use low-speed interfaces for the member ports of MC-LAG. To improve system reliability, it is recommended to set the link aggregation mode of member ports to LACP, and it is also recommended to enable fast-rate to improve the performance of failover convergence.
- Set a directly connected aggregation link between two MC-LAG peers as peer-link. It is recommended to use high-speed interfaces for peer-link. In order to improve the reliability of MC-LAG, it is recommended to set peer-link as static aggregation, and the number of member ports is no less than two. You need to manually assign a private VLAN for peer-link and add it to the service VLANs. No other configuration is allowed on the interfaces that are configured as peer-link.
- It is recommended to use low-speed interfaces for DAD-link (currently does not support out-of-band Management Interface ). DAD-link and peer-link cannot be shared.
- Please configure DAD-link when the peer-link status is up to prevent the ports of the standby side from being mistakenly set as error-down.
- You need to manually set a monitor link group for MC-LAG active and standby side. The uplink port is configured as uplink, and the downlink port is configured as downlink, please refer to section **[Monitor Link Config](#)** for specific configuration commands.

### <font color="#1d50a2">mclag domain *domain-id*</font>

**\[Command]**
**mclag domain** *domain-id*

**\[Purpose]**
Create a MC-LAG domain.

**\[Parameters]**

| **Parameter** | **Description**                                         |
| ------------- | ------------------------------------------------------- |
| *domain-id*   | Specify the domain ID, and the range is from 1 to 4095. |

**\[View]**
Global Configuration View

**\[Notes]**
Run command **no mclag domain** *domain-id* to delete MC-LAG domain.

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# mclag domain 1
```

### <font color="#1d50a2">peer-link \{ethernet|link-aggregation\} *interface\_name*</font>

**\[Command]**
**peer-link** \{**ethernet**|**link-aggregation**} *interface\_name*

**\[Purpose]**
Set peer-link for MC-LAG.

**\[Parameters]**

| **Parameter**     | **Description**         |
| ----------------- | ----------------------- |
| *interface\_name* | Interface name (eg.0/1) |

**\[View]**
MC-LAG Domain Configuration View

**\[Notes]**
Run command **no peer-link** to delete peer-link configuration.

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# mclag domain 1
sonic(mclag-domain)# peer-link ethernet 0/100
sonic(mclag-domain)# peer-link link-aggregation 10
```

### <font color="#1d50a2">peer-address \{*A.B.C.D|A\:\:B*\}</font>

**\[Command]**
**peer-address** \{*A.B.C.D|A\::B*}

**\[Purpose]**
Configure peer IP address of MC-LAG control link.

**\[Parameters]**

| **Parameter** | **Description** |
| ------------- | --------------- |
| *A.B.C.D*     | IPv4 address    |
| *A\::B*       | IPv6 address    |

**\[View]**
MC-LAG Domain Configuration View

**\[Notes]**
Run command **no peer-address** to delete peer IP address of MC-LAG control link.

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# mclag domain 1
sonic(mclag-domain)# peer-address 11.0.0.6
```

### <font color="#1d50a2">local-address \{*A.B.C.D|A\:\:B*\}</font>

**\[Command]**
**local-address** \{*A.B.C.D|A\::B*}

**\[Purpose]**
Configure local IP address of MC-LAG control link.

**\[Parameters]**

| **Parameter** | **Description** |
| ------------- | --------------- |
| *A.B.C.D*     | IPv4 address    |
| *A\::B*       | IPv6 address    |

**\[View]**
MC-LAG Domain Configuration View

**\[Notes]**
Run command **no local-address** to delete local IP address of MC-LAG control link.

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# mclag domain 1
sonic(mclag-domain)# local-address 11.0.0.6
```

### <font color="#1d50a2">heartbeat-interval *interval*</font>

**\[Command]**
**heartbeat-interval** *interval*

**\[Purpose]**
Set the sending interval for MC-LAG keepalive messages.

**\[Parameters]**

| **Parameter** | **Description**                                                                   |
| ------------- | --------------------------------------------------------------------------------- |
| *interval*    | Specify the interval in seconds. The range is from 1 to 60, and the default is 1. |

**\[View]**
MC-LAG Domain Configuration View

**\[Notes]**
The keepalive message interval value should be less than 1/3 of the session timeout, and the session timeout should be a multiple of the keepalive message interval.
Run command **no heartbeat-interval** to restore MC-LAG keepalive message sending interval to the default.

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# mclag domain 1
sonic(mclag-domain)# heartbeat-interval 6
```

### <font color="#1d50a2">session-timeout *timeout*</font>

**\[Command]**
**session-timeout** *timeout*

**\[Purpose]**
Set the timeout for MC-LAG sessions.

**\[Parameters]**

| **Parameter** | **Description**                                                                     |
| ------------- | ----------------------------------------------------------------------------------- |
| *timeout*     | Specify the timeout in seconds. The range is from 3 to 3600, and the default is 15. |

**\[View]**
MC-LAG Domain Configuration View

**\[Notes]**
The keepalive message interval value should be less than 1/3 of the session timeout, and the session timeout should be a multiple of the keepalive message interval.
Run command **no session-timeout** to restore MC-LAG session timeout to the default.

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# mclag domain 1
sonic(mclag-domain)# session-timeout 6
```

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

**\[Command]**
**member lag** *lag-id*

**\[Purpose]**
Configure the member ports for MC-LAG.

**\[Parameters]**

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

**\[View]**
MC-LAG Domain Configuration View

**\[Notes]**
Supports configuring multiple MC-LAG member ports.
Run command **no member lag** *lag-id* to delete MC-LAG member ports configuration.

**\[Use Cases]**

```plaintext
sonic# configure
sonic(config)# mclag domain 1
sonic(mclag-domain)# member lag 9
```

### <font color="#1d50a2">vrf *vrf\_name*</font>

**\[Command]**
**vrf** *vrf\_name*

**\[Purpose]**
Specify the vrf that MC-LAG keepalive session belongs to.

**\[Parameters]**

| **Parameter** | **Description**                                   |
| ------------- | ------------------------------------------------- |
| *vrf\_name*   | Specify the VRF name, the default VRF is default. |

**\[View]**
MC-LAG Domain Configuration View

**\[Notes]**
Configure the vrf that MC-LAG keepalive session belongs to, that is, specify the vrf of the router interface to which local-address belongs.
Run command **no vrf** to delete MC-LAG keepalive vrf configuration and restore to default vrf.

**\[Use Cases]**

```plaintext
sonic# configure
sonic(config)# mclag domain 1
sonic(mclag-domain)# vrf 9
```

### <font color="#1d50a2">consistency-check-action \{default|graceful|idle\}</font>

**\[Command]**
**consistency-check-action** \{**default**|**graceful**|**idle**}

**\[Purpose]**
Specify the mode for MC-LAG consistency check.

**\[Parameters]**

| **Parameter** | **Description**                                                                                                                                                           |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **default**   | In this mode, if the consistency check fails, the active and standby switches will bring the member ports down administratively at the same time.                         |
| **graceful**  | In this mode, if the consistency check fails, only standby switch will bring the member ports down administratively, and the active switch will keep the member ports up. |
| **idle**      | In this mode, it only displays the result of the consistency check, without any corresponding action.                                                                     |

**\[View]**
MC-LAG Domain Configuration View

**\[Notes]**
The consistency check is in idle mode by default.

**\[Use Cases]**

```plaintext
sonic# configure
sonic(config)# mclag domain 1
sonic(mclag-domain)# consistency-check-action default
```

### <font color="#1d50a2">backup-channel vlan *vlan-id*</font>

**\[Command]**
**backup-channel vlan** *vlan-id*

**\[Purpose]**
Configure ICCP backup channel for MC-LAG.

**\[Parameters]**

| **Parameter** | **Description**                  |
| ------------- | -------------------------------- |
| *vlan-id*     | VLAN ID, the range is \[1,4094]. |

**\[View]**
MC-LAG Domain Configuration View

**\[Notes]**
This feature requires an additional link. Add the interface to a separate VLAN and configure VLANIF with **interface vlan** *vlan-id* command, and then use this VLANIF as the ICCP backup channel.
Run command **no backup-channel** to delete ICCP backup channel for MC-LAG.

**\[Use Cases]**

```plaintext
sonic# configure
sonic(config)# mclag domain 1
sonic(mclag-domain)# backup-channel vlan 10
```

### <font color="#1d50a2">dad local-address \{*A.B.C.D|A\:\:B*\}</font>

**\[Command]**
**dad local-address** \{*A.B.C.D|A\::B*}

**\[Purpose]**
Configure local IP address of MC-LAG DAD link.

**\[Parameters]**

| **Parameter** | **Description** |
| ------------- | --------------- |
| *A.B.C.D*     | IPv4 address    |
| *A\::B*       | IPv6 address    |

**\[View]**
MC-LAG Domain Configuration View

**\[Notes]**
Run command **no dad local-address** to delete local IP address of MC-LAG DAD link.

**\[Use Cases]**

```plaintext
sonic# configure
sonic(config)# mclag domain 1
sonic(mclag-domain)# dad local-address 10.0.0.3
```

### <font color="#1d50a2">dad peer-address \{*A.B.C.D|A\:\:B*\}</font>

**\[Command]**
**dad peer-address** \{*A.B.C.D|A\::B*}

**\[Purpose]**
Configure peer IP address of MC-LAG DAD link.

**\[Parameters]**

| **Parameter** | **Description** |
| ------------- | --------------- |
| *A.B.C.D*     | IPv4 address    |
| *A\::B*       | IPv6 address    |

**\[View]**
MC-LAG Domain Configuration View

**\[Notes]**
Run command **no dad peer-address** to delete peer IP address of MC-LAG DAD link.

**\[Use Cases]**

```plaintext
sonic# configure
sonic(config)# mclag domain 1
sonic(mclag-domain)# dad peer-address 10.0.0.2
```

### <font color="#1d50a2">dad detection-delay *delay\_time*</font>

**\[Command]**
**dad detection-delay** *delay\_time*

**\[Purpose]**
Specify the delay time for MC-LAG DAD detection.

**\[Parameters]**

| **Parameter** | **Description**                                                                       |
| ------------- | ------------------------------------------------------------------------------------- |
| *delay\_time* | Specify the delay time in seconds. The range is from 0 to 512, and the default is 15. |

**\[View]**
MC-LAG Domain Configuration View

**\[Notes]**
Run command **no dad detection-delay** *time* to restore the delay time to default.

**\[Use Cases]**

```plaintext
sonic# configure
sonic(config)# mclag domain 1
sonic(mclag-domain)# dad detection-delay 60
```

### <font color="#1d50a2">dad recovery-delay \{non-mlag|mlag\} *delay\_time*</font>

**\[Command]**
**dad recovery-delay** \{**non-mlag**|**mlag**} *delay\_time*

**\[Purpose]**
Specify the delay time for the interfaces in error-down to be brought up on MC-LAG standby side.

**\[Parameters]**

| **Parameter** | **Description**                                                                                                                                                                  |
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **non-mlag**  | Configure the delay time for non-MC-LAG members.                                                                                                                                 |
| **mlag**      | Configure the delay time for MC-LAG members.                                                                                                                                     |
| *delay\_time* | Specify the delay time for error-down interface state recovery in seconds. The range is from 0 to 1000. The default value is 60 for MC-LAG members and 0 for non-MC-LAG members. |

**\[View]**
MC-LAG Domain Configuration View

**\[Notes]**
Run command **no dad recovery-delay** \{**non-mlag**|**mlag**} to restore the delay time to default.

**\[Use Cases]**

```plaintext
sonic# configure
sonic(config)# mclag domain 1
sonic(mclag-domain)# dad recovery-delay non-mlag 30
sonic(mclag-domain)# dad recovery-delay mlag 90
```

### <font color="#1d50a2">dad vrf *vrf\_name*</font>

**\[Command]**
**dad vrf** *vrf\_name*

**\[Purpose]**
Specify the vrf where MC-LAG DAD link is located.

**\[Parameters]**

| **Parameter** | **Description**                                   |
| ------------- | ------------------------------------------------- |
| *vrf\_name*   | Specify the VRF name, the default VRF is default. |

**\[View]**
MC-LAG Domain Configuration View

**\[Notes]**
Run command **no dad vrf** to restore the VRF of MC-LAG DAD link to default VRF.

**\[Use Cases]**

```plaintext
sonic# configure
sonic(config)# mclag domain 1
sonic(mclag-domain)# dad vrf 200
```

### <font color="#1d50a2">loopback-detect vlan *vlan-id* \[policy \{shutdown|block-vlan\} interval *interval* \[wait-time *wait-time*\]\]</font>

**\[Command]**
**loopback-detect vlan** *vlan-id* \[**policy** \{**shutdown**|**block-vlan**} **interval** *interval* \[**wait-time** *wait-time*]]

**\[Purpose]**
Configure MC-LAG loopback detection.

**\[Parameters]**

| **Parameter**  | **Description**                                                                                              |
| -------------- | ------------------------------------------------------------------------------------------------------------ |
| *vlan-id*      | VLAN ID, the range is \[1,4094].                                                                             |
| **policy**     | Optionally configure the execution policy after a loopback has been detected. The default is shutdown mode.  |
| **shutdown**   | Indicates that the switch will shut down interfaces with loopback detection configured.                      |
| **block-vlan** | Indicates that the switch will block the VLAN with loopback detection configured.                            |
| *interval*     | Specify the interval time in seconds, and the default value is 5 seconds.                                    |
| *wait-time*    | Specifies the wait time in seconds before restoring a blocked port or VLAN. The default value is 60 seconds. |

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

**\[Notes]**
This feature is enabled on the MC-LAG downlink aggregation port to avoid traffic looping due to configuration mistakes.
Run command **no loopback-detect** to disable loopback detection.

**\[Use Cases]**

```plaintext
sonic# configure
sonic(config)# interface ethernet 0/52
sonic(config-if-0/52)# loopback-detect vlan 10 policy shutdown interval 3
sonic(config)# interface link-aggregation 111
sonic(config-lagif-111)# loopback-detect vlan 200-300
```

### <font color="#1d50a2">unique-ip vlan *vlan-id* \[diff\_mac|same\_mac\]</font>

**\[Command]**
**unique-ip vlan** *vlan-id* **\[diff\_mac|same\_mac]**
**\[Purpose]**
Enable unique-ip feature for the VLAN.

**\[Parameters]**

| **Parameter** | **Description**                                                                                                                              |
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| *vlan-id*     | VLAN ID, the range is \[1,4094].                                                                                                             |
| **diff\_mac** | Use **diff\_mac** mode when the MAC of the MC-LAG Peer's protocol VLAN is different and the default is **diff-mac** mode when not specified. |
| **same\_mac** | Use **same\_mac** mode when the MAC of the MC-LAG Peer's protocol VLAN is the same.                                                          |

**\[View]**
MC-LAG Domain Configuration View

**\[Notes]**
This feature supports the MC-LAG Peer to establish a routing protocol with the access side to transmit routes.
There are two programmes currently supported:

1. The gateway VLAN and the routing protocol VLAN are shared. The primary IP of the SVI are supposed to be different for protocol interactions, while the secondary IP be the same for external gateway. The VLAN MAC should be set to the same value (not the same with system MAC or interface MAC of the peers). In addition, it is required to enable unique-ip in **same\_mac** mode and ARP proxy in EVPN mode for this VLAN.
2. Dual VLANs, that is, the gateway VLAN is separate from the routing protocol VLAN. The IP and the MAC of the gateway VLAN should be the same. While the IP of the routing protocol VLAN should be different from one another and the MAC can just use the default value. In addition, it is required to enable unique-ip in **diff\_mac** mode and ARP proxy in EVPN mode for routing protocol VLAN.
   Run command **no unique-ip vlan** *vlan-id* to disable unique-ip for vlan.

**\[Use Cases]**

```plaintext
sonic# configure
sonic(config)# mclag domain 1
sonic(mclag-domain)# unique-ip vlan 3010 same_mac
```

