---
title: MC-LAG Configuration
slug: enterprise-v5p2/mc-lag-configuration
description: ethernet switching
createdAt: 2025-11-14T03:58:42.084Z
---

### <font color="#1d50a2">show mclag state</font>

**\[Command]**
**show mclag state**

**\[Purpose]**
View information about MC-LAG

**\[View]**
System view

**\[Use Cases]**

```plaintext
sonic# show mclag state
The MCLAG's keepalive is: ERROR
MCLAG info sync is: incomplete
Domain id: 1
MCLAG session Channel: None
VRF Name: default
consistency Check Action: idle
Local Ip: 30.30.30.2
Peer Ip: 30.30.30.3
Peer Link Interface: Ethernet25
Keepalive time: 1
sesssion Timeout : 3
Peer Link Mac: 00:11:24:1a:1b:62
Admin Role: None
Role: Active
MCLAG Interface:
Loglevel: NOTICE
```

### <font color="#1d50a2">show mclag consistency check result</font>

**\[Command]**
**show mclag consistency check result**

**\[Purpose]**
View the results of the membership consistency check

**\[View]**
System view

**\[Usage Scenario]**
MCLAG (Multi-Chassis Link Aggregation Group) consists of two devices that together form a dual-active system. These two MCLAG devices are logically virtualized as a single device, creating a unified Layer 2 logical node. This also means that certain configurations on both ends of the MCLAG need to be consistent; otherwise, it could lead to issues such as MCLAG not functioning correctly or creating loops in the network.

**\[Use Cases]**

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

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

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

**\[Purpose]**
View the status of interfaces that have been forcibly shut down due to Duplicate Address Detection (DAD) disconnection.

**\[View]**
System view

**\[Use Cases]**

```plaintext
sonic# show interface errdown
Interface  Status
----------- --------
Ethernet1  up
Ethernet2  up
Ethernet3  up
Ethernet4  down
Ethernet5  up
Ethernet6  up
Ethernet48  up
Ethernet49  up
…
Ethernet50  up
Ethernet51  up
Ethernet52  up
```

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

**\[Command]**
**mclag domain** *domain\_id*
**no mclag domain**

**\[Purpose]**
Configure the MCLAG domain

**\[Parameter]**

| **Parameter** | **Description**    |
| ------------- | ------------------ |
| *domain\_id*  | The range of value |

**\[View]**
System configuration view

**\[Usage Scenario]**
All MC-LAG related configurations must be based on the MC-LAG domain. Each device can only be configured with one MC-LAG domain.

**\[Notes]**
Please note that for a successful MC-LAG connection between two devices, the MC-LAG domains on both ends must match.

**\[Use Cases]**

```plaintext
sonic(config)# mclag domain 1
sonic(mclag-domain)#
```

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

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

**\[Purpose]**
Specify the peer-link interface

**\[Parameter]**

| **Parameter**     | **Description** |
| ----------------- | --------------- |
| *interface\_name* | Interface name  |

**\[View]**
MC-LAG view

**\[Usage Scenario]**
The Peer-link link is a directly connected link between two devices in a deployed MC-LAG setup. It is used for exchanging protocol messages and transmitting some traffic to ensure the proper functioning of the MC-LAG.
Typically, the peer-link interface is configured in trunk mode and allows all VLANs belonging to the MC-LAG domain's member aggregated ports to pass through.

**\[Use Cases]**

```plaintext
sonic(config)# mclag domain 1
sonic(mclag-domain)# peer-link ethernet 10
```

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

**\[Command]**
**peer-address** *A.B.C.D*
**no peer-address**

**\[Purpose]**
Configure the IP address of the heartbeat packet of the peer device

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

**\[Use Cases]**

```plaintext
sonic(config)# mclag domain 1
sonic(mclag-domain)# peer-address 10.10.1.1
```

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

**\[Command]**
**local-address** *A.B.C.D*
**no local-address**

**\[Purpose]**
Configure the IPv4 address bound to the current domain

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

**\[Use Cases]**

```plaintext
sonic(config)# mclag domain 1
sonic(mclag-domain)# local address 10.10.1.1
```

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

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

**\[Purpose]**
Configure the transmission interval of MC-LAG Keep alive packets

**\[Parameter]**

| **Parameter** | **Description**            |
| ------------- | -------------------------- |
| *number*      | Value range: 1-60, unit: s |

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

**\[Usage Scenario]**
In the context of MC-LAG, if the remote MC-LAG device doesn't receive Keepalive messages from the local MC-LAG device within the specified timeout period, it will consider the remote MC-LAG device as being in a "down" state.
To ensure the proper operation of MC-LAG, it's crucial that the Keepalive message sending intervals are configured consistently on both the local and remote MC-LAG devices. Failing to do so may result in abnormal functionality.

**\[Notes]**
A critical consideration is that the Keepalive message interval should be set to less than one-third of the session timeout duration. The session timeout duration should be a multiple of the Keepalive message interval. This ensures that Keepalive messages are sent frequently enough to detect failures promptly while allowing for some tolerance in case of network delays.

**\[Use Cases]**

```plaintext
sonic(config)# mclag domain 1
sonic(mclag-domain)# heartbeat-interval 3
```

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

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

**\[Purpose]**
Configure the MC-LAG session timeout period

**\[Parameter]**

| **Parameter** | **Description**              |
| ------------- | ---------------------------- |
| *number*      | Value range: 3-3600, unit: s |

**\[View]**
MC-LAG view

**\[Usage Scenario]**
In certain scenarios, if Keep Alive messages are not received continuously within the specified timeout period, the device will determine that the Peer-Link link is malfunctioning.

**\[Notes]**
Please note the following considerations: The interval between sending Keep Alive messages should be less than one-third of the session timeout period, and the session timeout period must be a multiple of the Keep Alive message interval. This configuration ensures that Keep Alive messages are sent frequently enough to detect faults promptly while providing some fault tolerance in cases of network latency.

**\[Use Cases]**

```plaintext
sonic(config)# mclag domain 1
sonic(mclag-domain)# session-timeout 9
```

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

**\[Command]**
**member lag** *lag\_id*
**no member lag**

**\[Purpose]**
Add member ports for MC-LAG

**\[View]**
MC-LAG view

**\[Notes]**
This command removes a member port

**\[Use Cases]**

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

### <font color="#1d50a2">member lag active-backup</font>

**\[Command]**
**member lag** *lag\_id* **active-backup**
**no member lag** *lag\_id* **active-backup**

**\[Purpose]**
Add MC-LAG member ports and configure them in master/backup mode

**\[View]**
MC-LAG view

**\[Usage Scenario]**
When servers with dual network adapters are connected using a primary-backup configuration, the device needs to configure the following command. The device will automatically determine the primary and backup interfaces on the device side based on the traffic transmitted and received through the primary and backup ports of the server.

**\[Use Cases]**

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

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

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

**\[Purpose]**
Configure the backup link for peer-link

**\[View]**
MC-LAG view

**\[Usage Scenario]**
In the event of a peer-link link failure, configuring a backup link ensures that the network environment remains unaffected. This configuration allows MC-LAG to continue functioning normally even when the peer-link link is down.

**\[Notes]**
In the event of a peer-link link failure, the member interfaces of the specified VLAN on the backup-channel will be switched to serve as backup links

**\[Use Cases]**

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

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

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

**\[Purpose]**
Enable the M-LAG configuration consistency check function and specify the check mode

**\[Parameter]**

| **Parameter** | **Description**                                                                              |
| ------------- | -------------------------------------------------------------------------------------------- |
| **idle**      | Only check for consistency, do not make movements                                            |
| **default**   | Check whether the member interface is consistent and shutdown is inconsistent                |
| **graceful**  | Check whether it is consistent, only the shutdown role is a member port of the standbydevice |

**\[View]**
MC-LAG view

**\[Use Cases]**

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

### <font color="#1d50a2">dad local-address</font>

**\[Command]**
**dad local-address** *A.B.C.D*
**no dad local-address**

**\[Purpose]**
Configure the source IP address for DAD heartbeat packets

**\[View]**
MC-LAG view

**\[Usage Scenario]**
In the MC-LAG scenario, devices on both ends of the MC-LAG use the IP address configured by this command to send and receive heartbeat packets. When a Peer-link link failure is detected, the standby device negotiated by the MC-LAG has its interface states (excluding management and loopback interfaces) set to down.

**\[Notes]**
The IP address specified by this command needs to be the IP address of either the loopback interface or the management interface

**\[Use Cases]**

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

### <font color="#1d50a2">dad peer-address</font>

**\[Command]**
**dad peer-address** *A.B.C.D*
**no dad peer-address**

**\[Purpose]**
Configure the destination IP address for DAD heartbeat packets

**\[View]**
MC-LAG view

**\[Notes]**
It is necessary to ensure that the configured local-address and peer-address are reachable at the Layer 3 level.

**\[Use Cases]**

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

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

**\[Command]**
**dad detection-delay** *time*
**no dad detection-delay**

**\[Purpose]**
Configure the Error Down delay time

**\[View]**
MC-LAG view

**\[Notes]**
When a Peer-link failure occurs but Duplicate Address Detection (DAD) detection is normal, the backup device will trigger an Error Down after the configured delay time to prevent session flapping.

**\[Use Cases]**

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

### <font color="#1d50a2">dad recovery-delay mlag</font>

**\[Command]**
**dad recovery-delay mlag** *time*
**no dad recovery-delay mlag**

**\[Purpose]**
Configure the Error Down recovery delay time

**\[View]**
MC-LAG view

**\[Notes]**
After the Peer-link failure is restored, the Error Down state of the MC-LAG member LAGs will be restored after the configured delay time to prevent session flapping.

**\[Use Cases]**

```plaintext
sonic(config)# mclag domain 1
sonic(mclag-domain)# dad recovery-delay mlag 10
```

### <font color="#1d50a2">dad recovery-delay non-mlag</font>

**\[Command]**
**dad recovery-delay non-mlag** *time*
**no dad recovery-delay non-mlag**

**\[Purpose]**
Configure the Error Down recovery delay time

**\[View]**
MC-LAG view

**\[Notes]**
After the restoration of a Peer-link failure, the Error Down state of non-MC-LAG member interfaces will be recovered after the configured delay time to prevent session flapping.


**\[Use Cases]**

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

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

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

**\[Purpose]**
Specify the VRF to which the DAD packets belong

**\[View]**
MC-LAG view

**\[Notes]**
When using the management network interface as the source for DAD packets, and the management network interface is designated as the MGMT VRF, use this command to specify that the source of DAD is the MGMT VRF.

**\[Use Cases]**

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

