---
title: MC-LAG Configuration Guide
slug: aidc/mc-lag-configuration-guide
createdAt: 2025-11-28T09:00:10.299Z
---

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

MC-LAG (Multi Chassis Link Aggregation Group) is a mechanism for implementing cross-device link aggregation by aggregating one device with two other devices across the switch, retaining all the benefits of normal link aggregation while providing device-level redundancy.
MC-LAG provides a horizontal virtualization technique that virtualizes two physical devices into a single logical device, and this virtualized "single device" is "one-to-one" with its connected uplink or downlink device for link aggregation.

::Image[]{src="https://app.archbee.com/api/optimize/zl-MD6bX0o2Ab3p8w66u1/eHhNCKzIBmYObUs-XrHaK-20251128-083126.png" size="80" width="589" height="293" position="center" caption="Figure 1 Physical Topology And Logical View" showCaption="true"}

As shown in figure above, the MC-LAG group is externally represented as a logical device for link aggregation; the MC-LAG switch group deploys Ethernet or LAG type peer-link for protocol information interaction between MC-LAG, as well as taking up the east-west traffic in case of failure scenarios. The MC-LAG group is externally presented as a single node, which does not pose a loop risk when implementing redundant backups, and the load balancing mode of link aggregation does not result in idle links, making link utilization more efficient.
As shown in figure below, the Server side performs cross-device link aggregation with the other two devices Leaf1 and Leaf2 via the MC-LAG mechanism.

::Image[]{src="https://app.archbee.com/api/optimize/zl-MD6bX0o2Ab3p8w66u1/H8PO4J4T80jRKoW_gIhJ5-20251128-083300.png" size="70" width="335" height="265" position="center" caption="Figure 2 MC-LAG Common Topology Diagram" showCaption="true"}

## <font color="#1d50a2">Basic Concepts</font>

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

Refers to the two devices participating in the cross-device link aggregation group.
The two MC-LAG peer devices assume the Active and Standby roles respectively. According to the comparison of the size of the local\_ip and peer\_ip numbers in the configuration information, the smaller number will be the Active side, the Client side of the TCP connection; the larger number will be the Standby side, the Server side of the TCP connection, and the Client side will initiate a connection request to the server.

:::hint{type="success"}
**NOTE:**&#x20;
The Active, Standby role of MC-LAG peer is a control level concept only. On the data forwarding side, MC-LAG peers each determine the traffic forwarding path and have the same status.
:::

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

Refers to a series of LAGs that participate in cross-device link aggregation.

### <font color="#1d50a2">Keep-alive link</font>

The keep-alive link is a heartbeat detection link, typically implemented as a direct Layer 3 connection between MC-LAG peer, periodically sends heartbeat packet. It's used for transmitting ICCP control protocol packets, synchronizing table information, establishing MC-LAG peer relationships, and implementing configuration consistency checks.

### <font color="#1d50a2">Peer-Link</font>

The peer-link refers to a direct physical link between MC-LAG peers, used to forward traffic when there is a failure in downstream links. Generally, it is recommended to be shared with keep-alive link for operational efficiency and resource optimization.

### <font color="#1d50a2">DAD link</font>

The DAD (Dual Active Detection) link is a layer 3 interoperable link used by MC-LAG peer to send dual-active detection packets, applicable in scenarios when the peer-link and keep-alive link are shared.  When the keep-alive link is detected as disconnected, the system will automatically shut down all interfaces on the standby node except logical interfaces, management ports, and peer-link interfaces.

## <font color="#1d50a2">Working Principle</font>

### <font color="#1d50a2">Control Protocols</font>

SONiC uses a lightweight ICCP protocol on the MC-LAG control plane, with only a small amount of consistency checking and packet synchronization while safeguarding functionality.
ICCP (Inter-Chassis Communication Protocol), a standard protocol defined in RFC 7275, uses TCP port 8888 to establish a connection between MC-LAG peers, and the lightweight ICCP protocol performs configuration consistency checks, ARP table entry and MAC table entry synchronization.

### <font color="#1d50a2">Neighbor Establishment</font>

The two MC-LAG peer devices establish ICCP neighbor with local\_ip and peer\_ip as the source and destination addresses of the TCP connection.
When the ICCP connection is established, the MC-LAG peer modifies the APP\_PORT\_TABLE or APP\_LAG\_TABLE or APP\_VXLAN\_TUNNEL\_TABLE table entry in APP\_DB and disables the mac learning function of the peer-link, depending on the port type of the peer-link.

### <font color="#1d50a2">Information Synchronization</font>

The following information is synchronized between MC-LAG peers.

- System Information
  Synchronize the MAC addresses of MC-LAG member ports to ensure that the "system ID" field in the LACP packets sent from MC-LAG peer to Server is the same, so as to achieve cross-device link aggregation. To achieve cross-device link aggregation, when the Standby side receives the system MAC information of the Active side, it sends a netlink packet to modify the system ID of the local MC-LAG member port to be the same as that of the Active side.
- MC-LAG member port configuration information
  Records information such as the name of the local and peer MC-LAG member ports, which is used for consistency checking.
- MC-LAG member port status information
  The local and peer-LAG member port status is recorded to ensure the isolation of peer-link to MC-LAG member port in case of no fault, and the isolation of peer-link to port of the same name in case of peer-LAG member port fault is released. Isolation is adding table entries to APP\_DB, and the table entry is deleted for isolation release.
- ARP information
  The ARP table entries associated with MC-LAG member ports are synchronized between MC-LAG peers. When an ARP packet is received from the peer, the ARP table entry is updated locally by sending a netlink packet.
- FDB Information
  The FDB table entries associated with MC-LAG member ports are synchronized between MC-LAG peers. Upon receipt of FDB packets from the peer, the local FDB table entries are updated by modifying the table entries in APP\_DB.

### <font color="#1d50a2">Heartbeat Detection</font>

In SONiC, a heartbeat packet is sent to the other end at 1s intervals. If a heartbeat packet is not received for 15 consecutive cycles, it is judged to have timed out and the ICCP connection is broken.

### <font color="#1d50a2">Consistency Check</font>

SONiC uses the lightweight ICCP protocol for consistency checking of the following attributes: symmetrical configuration of MC-LAG peer in local\_ip, peer\_ip; same configuration of MC-LAG member ports: name, number, joined VLAN, routing port IP of VLAN, routing port MAC address of VLAN; same configuration of MC-LAG peer in the port type of peer-link.
The MC-LAG solution provides an automatic detection mechanism that supports the following three modes:

- <font color="#1d05a2">**Idle Mode**</font>
  In this mode, consistency checks only display the relevant results without performing any processing.
- <font color="#1d05a2">**Default Mode**</font>
  In this mode, member ports failing detection will be shut down on two peers.
- <font color="#1d05a2">**Graceful Mode**</font>
  In this mode, member ports failing detection will be shut down on standby node.
  The default mode for MC-LAG consistency checks is the idle mode.

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

<font color="#1d05a2">Table 1 Overview of MC-LAG Configuration Tasks</font>

| **Configuration Tasks**          | **Description**  | **Refer to**                                                                                                                       |                                                                                                    |
| -------------------------------- | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| MC-LAG Configuration             | Configure MC-LAG | Required                                                                                                                           | [Configure MC-LAG](https://v1.docs.asternos.com/aidc/mc-lag-configuration-guide#configure-mc-lag)  |
| Configure Peer-link              | Required         | [Configure Peer-link](https://v1.docs.asternos.com/aidc/mc-lag-configuration-guide#configure-peer-link)                            |                                                                                                    |
| Configure Keep-alive             | Required         | [Configure Keep-alive](https://v1.docs.asternos.com/aidc/mc-lag-configuration-guide#configure-keep-alive)                          |                                                                                                    |
| Configure MC-LAG Member          | Required         | [Configure MC-LAG Member](https://v1.docs.asternos.com/aidc/mc-lag-configuration-guide#configure-mc-lag-member)                    |                                                                                                    |
| Configure Monitor Link Group     | Required         | [Configure Monitor Link Group](https://v1.docs.asternos.com/aidc/mc-lag-configuration-guide#configure-monitor-link-group)          |                                                                                                    |
| Configure Dual-Active Gateway    | Optional         | [Configure Dual-Active Gateway](https://v1.docs.asternos.com/aidc/mc-lag-configuration-guide#configure-dual-active-gateway)        |                                                                                                    |
| Configure DAD-link               | Optional         | [Configure DAD-link](https://v1.docs.asternos.com/aidc/mc-lag-configuration-guide#configure-dad-link)                              |                                                                                                    |
| Configure Consistency Check Mode | Optional         | [Configure Consistency Check Mode](https://v1.docs.asternos.com/aidc/mc-lag-configuration-guide#configure-consistency-check-mode)  |                                                                                                    |
| Configure MSTP                   | Optional         | [Configure MSTP](https://v1.docs.asternos.com/aidc/mc-lag-configuration-guide#configure-mstp)                                      |                                                                                                    |
| Configure ICCP Backup Channel    | Optional         | [Configure ICCP Backup Channel](https://v1.docs.asternos.com/aidc/mc-lag-configuration-guide#configure-iccp-backup-channel)        |                                                                                                    |
| Configure Loopback-Detect        | Optional         | [Configure Loopback-Detect](https://v1.docs.asternos.com/aidc/mc-lag-configuration-guide#configure-loopback-detect)                |                                                                                                    |
| Configure Unique IP              | Optional         | [Configure Unique IP](https://v1.docs.asternos.com/aidc/mc-lag-configuration-guide#configure-unique-ip)                            |                                                                                                    |

:::hint{type="info"}
**NOTE:**&#x20;

- Host commissioning can only proceed after completing the MC-LAG configuration and service VLAN configuration.&#x20;
- Regarding the requirement to transform the current standalone access into dual-homing access using MC-LAG, please note that if there is already a standalone host, it is essential to ensure that the peer-link has been added to the corresponding VLAN on the newly added device before establishing the MC-LAG. Otherwise, this may lead to anomalies in MC-LAG peer entry synchronization. If such an issue occurs, it can be resolved by manually clearing the ARP and MAC entries under the corresponding VLAN to allow re-onboarding, or by manually down/up the peer-link interface to trigger re-synchronization of the entries.
:::

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

The default setting of the MC-LAG is shown in the table below.

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

| **Parameters**                        | **Default value** |
| ------------------------------------- | ----------------- |
| heartbeat-interval                    | 1s                |
| session timeout                       | 15s               |
| consistency-check mode                | idle              |
| MCLAG VRF                             | default           |
| DAD detection delay                   | 60s               |
| DAD recovery delay (MCLAG member)     | 60s               |
| DAD recovery delay (not MCLAG member) | 0s                |
| DAD VRF                               | default           |

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

<font color="#1d05a2">Table 3 MC-LAG Basic Configuration</font>

| **Purpose**                                     | **Commands**                  | **Description**                                                                                                                                                                                                                                                                                      |
| ----------------------------------------------- | ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Enter global configuration view                 | **configure terminal**        | -                                                                                                                                                                                                                                                                                                    |
| Create  MC-LAG domain                           | **mclag domain** *domain-id*  | Only one domain is currently supported, with range of 1-4095                                                                                                                                                                                                                                         |
| (Optional) Configure the MC-LAG session timeout | **session-timeout** *timeout* | Timeout time, in seconds, value range is 3-3600, default value is 15 seconds; the time interval of the heartbeat detection message should be less than 1/3 of the MC-LAG session timeout time; the session timeout time should be a multiple of the time interval of the heartbeat detection message |

### <font color="#1d50a2">Configure Peer-link</font>

- Peer-link is recommended to use a high-speed interface for interconnection, and it is recommended that a directly connected aggregation link located between two MC-LAG devices be used as a Peer-link link, and it is recommended that it be configured as a static aggregation in order to improve the reliability of MC-LAGs
- After interface is configured as a peer-link interface, no other services can be configured on this interface
- Assign a dedicated VLAN for the peer-link and add the peer-link to other MC-LAG service VLANs
- Configure interface delayed startup on the physical port where the peer-link is located so that it is up before the up/downlink port up, so that the MC-LAG state is restored and the table entries are synchronized and then the traffic is forwarded, which reduces packet loss when the MC-LAG master and backup devices reboot.

<font color="#1d05a2">Table 4 MC-LAG Member Configuration</font>

| **Purpose**                                                | **Commands**                                                             | **Description**                                                                                                                                                |
| ---------------------------------------------------------- | ------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Enter global configuration view                            | **configure terminal**                                                   | -                                                                                                                                                              |
| Create a peer-link private VLAN                            | **vlan** *vlan-id*                                                       | vlan-id: range 1-4094                                                                                                                                          |
| Exit VLAN configuration view                               | **exit**                                                                 | -                                                                                                                                                              |
| Enter LAG configuration view and create a link-aggregation | **interface link-aggregation** *lag-id*                                  | lag-id: aggregation group id, range 1-9999                                                                                                                     |
| Configure static aggregation mode                          | **mode static**                                                          | -                                                                                                                                                              |
| Commit the configuration                                   | **commit**                                                               | -                                                                                                                                                              |
| Specify the private VLAN and join other service VLANs.     | **switchport trunk vlan** *vlan-id*                                      | -                                                                                                                                                              |
| Exit LAG interface configuration view                      | **exit**                                                                 | -                                                                                                                                                              |
| Enter Ethernet interface view                              | **interface ethernet** *interface-name*                                  | -                                                                                                                                                              |
| Add the corresponding LAG                                  | **link-aggregation-group** *lag-id* \[**port-priority** *port-priority*] | Port priority can be specified, in the range 0 to 65535, default 255.                                                                                          |
| Configure the delay to start the interface                 | **startup-delay** *delay*                                                | The default interface delay startup is 150 seconds, and it is recommended that 120 seconds be configured on the physical interface where peer-link is located. |
| Exit Ethernet interface view                               | **exit**                                                                 | -                                                                                                                                                              |
| Enter MC-LAG domain configuration view.                    | **mclag domain** *domain-id*                                             | domain-id: range 1-4095                                                                                                                                        |
| Specify peer-link                                          | **peer-link link-aggregation** *lag-id*                                  | -                                                                                                                                                              |
| Commit configuration                                       | **commit**                                                               | -                                                                                                                                                              |
| Exit MC-LAG domain configuration view                      | **exit**                                                                 | -                                                                                                                                                              |

### <font color="#1d50a2">Configure Keep-alive</font>

- The heartbeat detection link is used to forward control messages of MC-LAG, which can be shared with peer-link or use a separate physical link.
- When the dual-master detection function is enabled, the heartbeat detection link is required to be shared with the peer-link, otherwise the function will be disabled.
  The configuration using a separate physical link is as follow.

<font color="#1d05a2">Table 5 Configure Keep-Alive Link</font>

| **Purpose**                                                                             | **Commands**                                                                                          | **Description**                                                                                                                                                                                                                                                                                                  |
| --------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Enter global configuration view                                                         | **configure terminal**                                                                                | -                                                                                                                                                                                                                                                                                                                |
| Enter ethernet interface view                                                           | **interface** \{**ethernet** *interface-name* \| **link-aggregation** *lag-id* \| **vlan** *vlan-id*} | When heartbeat detection link is shared with peer-link, the interface uses VLAN interface.                                                                                                                                                                                                                       |
| Configure the IPv4 address                                                              | **ip address** \{*A.B.C.D/M*\|*A\::B/M*}                                                              | -                                                                                                                                                                                                                                                                                                                |
| Exit ethernet interface view                                                            | **exit**                                                                                              | -                                                                                                                                                                                                                                                                                                                |
| Enter MC-LAG domain configuration view                                                  | **mclag domain** *domain-id*                                                                          | domain-id: range 1-4095                                                                                                                                                                                                                                                                                          |
| Configure the peer IP of the keep-alive link                                            | **peer-address** \{*A.B.C.D* \| *A\::B*}                                                              | -                                                                                                                                                                                                                                                                                                                |
| Configure the local IP of the keep-alive link                                           | **local-address** \{*A.B.C.D* \| *A\::B*}                                                             | -                                                                                                                                                                                                                                                                                                                |
| (Optional) Specify the VRF of the keep-alive link.                                      | **vrf** *vrf-name*                                                                                    | Default is default VRF                                                                                                                                                                                                                                                                                           |
| (Optional) Configure the time interval for sending MC-LAG heartbeat detection messages. | **heartbeat-interval** *interval*                                                                     | The unit of interval time is second, the value range is 1-60, and the default value is 1 second; the time interval of heartbeat detection message should be less than 1/3 of the MC-LAG session timeout time; the session timeout time should be a multiple of the time interval of heartbeat detection message. |
| Commit Configuration                                                                    | **commit**                                                                                            | -                                                                                                                                                                                                                                                                                                                |
| Exit MC-LAG domain configuration view.                                                  | **exit**                                                                                              | -                                                                                                                                                                                                                                                                                                                |

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

- It is recommended to use low-speed interfaces as MC-LAG member interfaces
- To improve system reliability, it is recommended to use dynamic aggregation for cross-device aggregation groups and enable LACP short timeout
- It is required that the port IDs of the member physical interfaces of the two devices deployed with MC-LAG are the same, otherwise they cannot be aggregated properly

<font color="#1d05a2">Table 6 MC-LAG Member Configuration</font>

| **Purpose**                                                            | **Commands**                            | **Description**                                                                                                               |
| ---------------------------------------------------------------------- | --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| Enter global configuration view                                        | **configure terminal**                  | -                                                                                                                             |
| Enter VLAN interface configuration view                                | **vlan** *vlan-id*                      | vlan-id: range 1-4094                                                                                                         |
| Exit VLAN configuration view                                           | **exit**                                | -                                                                                                                             |
| Enter LAG interface configuration view and create an aggregation group | **interface link-aggregation** *lag-id* | lag-id: aggregation group id, range 1-9999                                                                                    |
| (Optional) Enable LACP short timeout                                   | **lacp fast-rate**                      | -                                                                                                                             |
| (Optional) Enable LACP fallback                                        | **lacp fallback**                       | When not receiving LACP packets, activate one member port of a LAG, which can only be configured on one of the MCLAG devices. |
| Commit the configuration                                               | **commit**                              | -                                                                                                                             |
| Join the service VLAN                                                  | **switchport trunk vlan** *vlan-id*     | -                                                                                                                             |
| Exit LAG interface configuration view                                  | **exit**                                | -                                                                                                                             |
| Enter MC-LAG configuration view                                        | **mclag domain** *domain-id*            | domain-id: range 1-4095                                                                                                       |
| Add member lag port of MC-LAG                                          | **member lag** *lag-id*                 | lag-id: aggregation group id, range 1-9999                                                                                    |
| Exit mc-lag configuration view                                         | **exit**                                | -                                                                                                                             |
| Enter the LAG interface view where peer-link is located                | **interface link-aggregation** *lag-id* | -                                                                                                                             |
| Join the service VLAN                                                  | **switchport trunk vlan** *vlan-id*     | -                                                                                                                             |

### <font color="#1d50a2">Configure Monitor Link Group</font>

- It is recommended that you configure the Monitor Link group on the master and backup devices deployed with MC-LAG, with the uplink port configured as uplink and the downlink port configured as downlink. After you enable this function, the downlink port will be linked down after the uplink port state is down, ensuring that it can converge quickly when a failure occurs in the topology.

<font color="#1d05a2">Table 7 Configure Monitor Link Group</font>

| **Purpose**                                       | **Commands**                                          | **Description**                                                                                                                                                                   |
| ------------------------------------------------- | ----------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Enter global configuration view                   | **configure terminal**                                | -                                                                                                                                                                                 |
| Create Monitor Link Group                         | **monitor-link-group** *group-name* \[ *delay-time* ] | delay-time is an optional parameter, which indicates the delay time of downlink port up after uplink port up, the unit is second, and the default value is 0 when not configured. |
| Enter Ethernet interface view                     | **interface ethernet** *interface-name*               | -                                                                                                                                                                                 |
| Configure the uplink port as uplink               | **monitor-link** *group-name* **uplink**              | -                                                                                                                                                                                 |
| Exit Ethernet interface view                      | **exit**                                              | -                                                                                                                                                                                 |
| Enter downlink LAG interface configuration view   | **interface ethernet** *interface-name*               | -                                                                                                                                                                                 |
| Configure the MC-LAG member interface as downlink | **monitor-link** *group-name* **downlink**            | -                                                                                                                                                                                 |

### <font color="#1d50a2">Configure Dual-Active Gateway</font>

In scenarios where the MC-LAG accesses a Layer 3 network or a VXLAN network, the MC-LAG master and backup devices need to act as Layer 3 gateways at the same time, and must ensure that the VLANIF interfaces corresponding to the MC-LAG member interfaces have the same IP address and MAC address; in scenarios with a VXLAN network, it is also required that the VRFs corresponding to the same L3 VNI on the MC-LAG master and backup devices have the MAC is the same.

<font color="#1d05a2">Table 8 Configure Dual-Active Gateway</font>

| **Purpose**                                       | **Commands**                             | **Description** |
| ------------------------------------------------- | ---------------------------------------- | --------------- |
| Enter global configuration view                   | **configure terminal**                   | -               |
| Enter VRF configuration view                      | **vrf** *vrf-name*                       | -               |
| Set the MAC of VRF.                               | **mac** *HH\:HH\:HH\:HH\:HH\:HH*         | -               |
| Exit VRF configuration view                       | **exit**                                 | -               |
| Enter the service VLANIF configuration view       | **interface vlan** *vlan-id*             | -               |
| (Optional)Configure VRF for the interface         | **vrf** *vrf-name*                       | -               |
| Configure the VLANIF interface IPv4 address       | **ip address** *A.B.C.D/M*               | -               |
| Configure the MAC address of the VLANIF interface | **mac-address** *HH\:HH\:HH\:HH\:HH\:HH* | -               |

### <font color="#1d50a2">Configure DAD-link</font>

- Dual Active Detection Link (DAD-link) is recommended to be interconnected using low-speed service ports and is recommended to be configured on a separate physical Layer 3 interface.
- The DAD-link and peer-link cannot be shared.
- If the peer-link is configured before the DAD-link is not configured, configure the DAD-link when the peer-link port is in the Up state to prevent the standby device port from being mistakenly Error-Down.

<font color="#1d05a2">Table 9 DAD-link Configuration</font>

| **Purpose**                                                                                                                 | **Commands**                            | **Description**                                                                            |
| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- | ------------------------------------------------------------------------------------------ |
| Enter global configuration view                                                                                             | **configure terminal**                  | -                                                                                          |
| Enter Ethernet interface view                                                                                               | **interface ethernet** *interface-name* | -                                                                                          |
| Configure the interface IPv4 address to enable DAD link interworking                                                        | **ip address** *A.B.C.D/M*              | -                                                                                          |
| Exit Ethernet interface view                                                                                                | **exit**                                | -                                                                                          |
| Enter MC-LAG configuration view                                                                                             | **mclag domain** *domain-id*            | domain-id: range 1-4095                                                                    |
| Configure DAD local ip                                                                                                      | **dad local-address**  *A.B.C.D*        | -                                                                                          |
| Configure DAD peer ip                                                                                                       | **dad peer-address** *A.B.C.D*          | -                                                                                          |
| (Optional) Configure DAD detection delay                                                                                    | **dad detection-delay** *time*          | time: range 0-512; default value 15                                                        |
| (Optional) Configure the delay for recovering the error-down status of MC-LAG member interfaces on the MC-LAG standby side. | **dad recovery-delay mlag** *time*      | time: recovery delay time , range 0-1000; default value 60 for mc-lag member interfaces    |
| (Optional) Configure the delay of error-down state recovery for non-MC-LAG member interfaces on the MC-LAG standby side.    | **dad recovery-delay non-mlag** *time*  | time: recovery delay time , range 0-1000; default value 0 for non-mc-lag member interfaces |
| (Optional) Configure the VRF where the DAD link is located                                                                  | **dad vrf** \{**default**\|*name*}      | default: default VRFname: VRF name                                                         |
| Delete DAD local ip configuration                                                                                           | **commit**                              | -                                                                                          |
| Delete DAD peer ip configuration                                                                                            | **exit**                                | -                                                                                          |

### <font color="#1d50a2">Configure Consistency Check Mode</font>

<font color="#1d05a2">Table 10 Configure Consistency Check Mode</font>

| **Purpose**                                       | **Commands**                                                        | **Description**                            |
| ------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------ |
| Enter global configuration view                   | **configure terminal**                                              | -                                          |
| Enter MC-LAG domain configuration view            | **mclag domain** *domain-id*                                        | domain-id: range 1-4095                    |
| Configure the mode of MC-LAG consistency checking | **consistency-check-action** \{**default**\|**graceful**\|**idle**} | The default consistency check is idle mode |
| Exit MC-LAG domain configuration view             | **exit**                                                            | -                                          |

### <font color="#1d50a2">Configure MSTP</font>

The MC-LAG scenario supports the configuration of MSTP Spanning Tree Protocol anti-loop.

- You should manually deploy the two devices of the MC-LAG as the root bridge of the Layer 2 network when you turn on MSTP, and configure the same bridge ID to simulate the two devices as the same root bridge, and the root priority is configured to be the highest in both cases to ensure that the M-LAG device is the root node. By default, the bridge MAC on the switch that participates in the spanning tree calculation is the MAC address of the switch. When configuring manually, it is recommended that you additionally select a smaller MAC address (not the MAC address of the MC-LAG master or backup device) as the bridge MAC.
- Since the switches at both ends of the MC-LAG need to be simulated as the same STP root bridge, it should be ensured that the switch's directly connected interface will not be blocked off, and it is necessary to disable the STP function of the peer-link interface, that is, to turn on the BPDU filtering function.
- The MC-LAG member interface needs to be manually configured as an edge interface.
- Does not support multi-level MC-LAG scenarios.

<font color="#1d05a2">Table 11 Configure MSTP</font>

| **Purpose**                                                                       | **Commands**                                                                                          | **Description** |
| --------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | --------------- |
| Enter global configuration view.                                                  | **configure terminal**                                                                                | -               |
| Enable MSTP.                                                                      | **mstp enable**                                                                                       | -               |
| Enter the default MSTP instance configuration view.                               | **mstp instance 0**                                                                                   | -               |
| Configure the MC-LAG master/standby device MSTP instance priority to 0.           | **priority 0**                                                                                        | -               |
| Exit the MSTP instance configuration view.                                        | **exit**                                                                                              | -               |
| Configure the MC-LAG root bridge MAC on the MC-LAG master and standby device.     | **bridge mac** *HH\:HH\:HH\:HH\:HH\:HH*                                                               | -               |
| Disable the STP function for peer-link links on MC-LAG master and backup devices. | **mstp bpdu-filter enable interface** \{**ethernet** *interface-name*\|**link-aggregation** *lag-id*} | -               |
| Configure MC-LAG member interfaces as edge interfaces                             | **mstp edge-port enable interface** \{**ethernet** *interface-name*\|**link-aggregation** *lag-id*}   | -               |

### <font color="#1d50a2">Configure ICCP Backup Channel</font>

Use a separate link, added to an independent VLAN, as a backup path for ICCP. When the heartbeat detection link is disconnected, the system can automatically switch to this ICCP backup path, ensuring MC-LAG reliability. No manual IP address configuration is required on the ICCP backup path; only a VLANIF interface needs to be configured, and Link-local addresses will be used for ICCP communication.

<font color="#1d05a2">Table 12 Configure ICCP Backup Channel</font>

| **Purpose**                                          | **Commands**                            | **Description**         |
| ---------------------------------------------------- | --------------------------------------- | ----------------------- |
| Enter global configuration view                      | **configure terminal**                  | -                       |
| Create an ICCP backup channel dedicated VLAN         | **vlan** *vlan-id*                      | vlan-id: range: 1-4094. |
| Exit VLAN configuration view                         | **exit**                                | -                       |
| Create ICCP backup channel VLANIF configuration view | **interface vlan** *vlan-id*            | -                       |
| Exit VLANIF configuration view                       | **exit**                                | -                       |
| Enter Ethernet configuration view                    | **interface ethernet** *interface-name* | -                       |
| Add member for the ICCP standby path dedicated VLAN  | **switchport trunk vlan** *vlan-id*     | -                       |
| Enter MC-LAG domain configuration view               | **mclag domain** *domain-id*            | domain-id: range 1-4095 |
| Configure the ICCP backup channel                    | **backup-channel vlan** *vlan-id*       | -                       |
| Exit MC-LAG domain configuration view                | **exit**                                | -                       |

### <font color="#1d50a2">Configure Loopback-Detect</font>

Loop detection policies include two modes: shutdown and block-vlan.
In shutdown mode, the system administratively disables the interface where a loop is detected.
In block-vlan mode, the system blocks the VLAN in which a loop is detected.
The default mode is shutdown.

<font color="#1d05a2">Table 13 Configure Loopback-Detect</font>

| **Purpose**                             | **Commands**                                                                                                                          | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Enter global configuration view         | **configure terminal**                                                                                                                | -                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Enter downlink LAG view (MC-LAG member) | **interface link-aggregation** *lag-id*                                                                                               | lag-id: aggregation group id, range 1-9999                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| Configure MC-LAG loopback-detect        | **loopback-detect vlan** *vlan-id* \[**policy** \{**shutdown**\|**block-vlan**} **interval** *interval* \[**wait-time** *wait-time*]] | *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. The default value is 5 s.*wait-time*: Specifies the wait time in seconds before restoring a blocked port or VLAN. The default value is 60 s. |

### <font color="#1d50a2">Configure Unique IP</font>

This feature supports the MC-LAG Peer to establish a routing protocol with the access side to transmit routes. Two options are currently available.

- 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.
- 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.

The first one is configured as follows:

<font color="#1d05a2">Table 14 MC-LAG Unique-ip Dual VLANs Configuration</font>

| **Purpose**                                                               | **Commands**                                  | **Description**                                                                                           |
| ------------------------------------------------------------------------- | --------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| Enter global configuration view.                                          | **configure terminal**                        | -                                                                                                         |
| Create two VLANs, one for gateway and another for protocol communication. | **vlan** *vlan-id*                            | vlan-id range: 1-4094                                                                                     |
| Exit VLAN configuration view.                                             | **exit**                                      | -                                                                                                         |
| Enter MC-LAG domain configuration view.                                   | **mclag domain** *domain-id*                  | domain-id range 1-4095                                                                                    |
| Enable MC-LAG Unique-ip for protocol communication.                       | **unique-ip vlan** *vlan-id* \[**diff\_mac**] | Enable with mode **diff\_mac** (the default mode is **diff\_mac**).                                       |
| Exit MC-LAG configuration view.                                           | **exit**                                      | -                                                                                                         |
| Enter protocol VLAN interface view.                                       | **interface vlan** *vlan-id*                  | -                                                                                                         |
| Set the IP address.                                                       | **ip address** *A.B.C.D/M*                    | Assign with different IP on MC-LAG peers.                                                                 |
| (Optional)Set the MAC address.                                            | **mac-address** *HH\:HH\:HH\:HH\:HH\:HH*      | The MAC of this VLANIF needs to be different on MC-LAG peers. It is recommended to use the default value. |
| Configure ARP Proxy                                                       | **arp proxy mode evpn**                       | -                                                                                                         |
| Enter gateway VLAN interface view                                         | **interface vlan** *vlan-id*                  | -                                                                                                         |
| Set the IP address.                                                       | **ip address** *A.B.C.D/M*                    | Assign with the same IP on MC-LAG peers.                                                                  |
| Set the MAC address.                                                      | **mac-address** *HH\:HH\:HH\:HH\:HH\:HH*      | Assign with the same MAC on MC-LAG peers.                                                                 |

The second one is configured as follows:

<font color="#1d05a2">Table 15 MC-LAG Unique-ip Single VLAN with Dual IP Configuration</font>

| **Purpose**                                     | **Commands**                               | **Description**                                                                                                          |
| ----------------------------------------------- | ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ |
| Enter global configuration view                 | **configure terminal**                     | -                                                                                                                        |
| Create a VLAN for both uses.                    | **vlan** *vlan-id*                         | vlan-id range: 1-4094                                                                                                    |
| Exit VLAN configuration view.                   | **exit**                                   | -                                                                                                                        |
| Enter MC-LAG domain configuration view.         | **mclag domain** *domain-id*               | domain-id range 1-4095                                                                                                   |
| Enable MC-LAG Unique-ip.                        | **unique-ip vlan** *vlan-id* **same\_mac** | Enable with mode **same\_mac.**                                                                                          |
| Exit MC-LAG configuration view.                 | **exit**                                   | -                                                                                                                        |
| Enter VLAN interface view.                      | **interface vlan** *vlan-id*               | -                                                                                                                        |
| Set the primary IP as the protocol IP.          | **ip address** *A.B.C.D/M*                 | Assign with different IP as protocol IP on MC-LAG peers.                                                                 |
| Set the secondary IP as the service gateway IP. | **ip address** *A.B.C.D/M* **secondary**   | Assign with the same IP as gateway IP on MC-LAG peers.                                                                   |
| Set the MAC address.                            | **mac-address** *HH\:HH\:HH\:HH\:HH\:HH*   | The MAC of this VLANIF needs to be consistent on MC-LAG peers (should not be the same with system MAC or interface MAC). |
| Configure ARP Proxy                             | **arp proxy mode evpn**                    | -                                                                                                                        |

## <font color="#1d50a2">Display and Maintenance</font>

<font color="#1d05a2">Table 16 MC-LAG Configuration Display</font>

| **Purpose**                              | **Commands**                              | **Description**                         |
| ---------------------------------------- | ----------------------------------------- | --------------------------------------- |
| Check MC-LAG status                      | **show mclag state** \[ *domain-id* ]     | domain-id: the created MC-LAG domain ID |
| Display MC-LAG consistency check results | **show mclag consistency\_check\_result** | -                                       |

## <font color="#1d50a2">Typical Configuration Example</font>

### <font color="#1d50a2">Example of a Single Group MC-LAG Configuration</font>

1. Networking Requirements
   In the network, Leaf1 and Leaf2 are two independently operating devices, connected to Spine respectively. Due to the high service reliability requirements of the customer, MC-LAG is required to be configured between Leaf1 and Leaf2 to achieve cross-device link aggregation.
2. Topology

::Image[]{src="https://app.archbee.com/api/optimize/zl-MD6bX0o2Ab3p8w66u1/VcPCqWfpg_9D7Q7STS0c2-20251128-083515.png" size="70" width="372" height="546" position="center" caption="Figure 3 Single Group MC-LAG Topology" showCaption="true"}

3. Configuration Roadmap
   (1) Check that the link status of the ports used on the switch is normal, and that all ports are stable in the UP state.
   (2) Configure the switch interface IP addresses.
   (3) Configure VLAN and configure IP address for VLAN interface.
   (4) Configure link aggregation group and add it to VLAN.
   (5) Configure MC-LAG.
   (6) Configure monitor-link-group.
   (7) Configure static routes to ensure reachability of the service network.
4. Procedure
   **Spine**
   Configure IP addresses for interfaces.

```plaintext
interface ethernet 0/48
 ip address 10.93.0.1/30
 exit
!
interface ethernet 0/52
 ip address 10.93.0.9/30
 exit
!
```

Configure service VLAN with VLAN-ID 20.

```plaintext
!
vlan 20
 exit
!
interface vlan 20
 ip address 10.20.0.1/24
 exit
```

Add the interface to the VLAN.

```plaintext
!
interface ethernet 0/0
 switchport trunk vlan 20
```

Configure static routes

```plaintext
ip route 10.10.0.1/24 10.93.0.2
ip route 10.10.0.1/24 10.93.0.10
```

**Leaf1**
Configure IP addresses for interfaces.

```plaintext
interface ethernet 0/48
 ip address 10.93.0.2/30
 exit
```

Configure service VLAN with VLAN-ID 10 and Keep-alive VLAN with VLAN-ID 4094.

```plaintext
vlan 10
 exit
!
vlan 4094
 exit
!
interface vlan 10
 ip address 10.10.0.1/24
 mac-address 00:00:00:10:00:00
 exit
!
interface vlan 4094
 ip address 10.245.0.1/30
 exit
```

Configure LAG.

```plaintext
interface link-aggregation 9999
 mode static
 commit
 switchport trunk vlan 4094
 switchport trunk vlan 10
 exit
!
interface link-aggregation 1
 lacp fast-rate
 commit
 switchport trunk vlan 10
!
interface ethernet 0/72
 link-aggregation-group 9999
 exit
!
interface ethernet 0/76
 link-aggregation-group 9999
 exit
!
interface ethernet 0/0
 link-aggregation-group 1
 exit
```

Configure MC-LAG.

```plaintext
mclag domain 1
 local-address 10.245.0.1
 peer-address 10.245.0.2
 peer-link link-aggregation 9999
 commit
 member lag 1
```

Configure Monitor-link

```plaintext
!
monitor-link-group MC_LAG 90
!
interface ethernet 0/48
 monitor-link MC_LAG uplink
 exit
!
interface ethernet 0/0
 monitor-link MC_LAG downlink
 exit
```

Configure static routes.

```plaintext
ip route 10.20.0.1/24 10.93.0.1
```

**Leaf2**
Configure IP addresses for interfaces.

```plaintext
interface ethernet 0/48
 ip address 10.93.0.10/30
 exit
```

Configure service VLAN with VLAN-ID 10 and Keep-alive VLAN with VLAN-ID 4094.

```plaintext
vlan 10
 exit
!
vlan 4094
 exit
!
interface vlan 10
 ip address 10.10.0.1/24
 mac-address 00:00:00:10:00:00
 exit
!
interface vlan 4094
 ip address 10.245.0.2/30
 exit
```

Configure LAG.

```plaintext
interface link-aggregation 9999
 mode static
 commit
 switchport trunk vlan 4094
 switchport trunk vlan 10
 exit
!
interface link-aggregation 1
 lacp fast-rate
 commit
 switchport trunk vlan 10
!
interface ethernet 0/72
 link-aggregation-group 9999
 exit
!
interface ethernet 0/76
 link-aggregation-group 9999
 exit
!
interface ethernet 0/0
 link-aggregation-group 1
 exit
```

Configure MC-LAG.

```plaintext
mclag domain 1
 local-address 10.245.0.2
 peer-address 10.245.0.1
 peer-link link-aggregation 9999
 commit
 member lag 1
```

Configure Monitor-link

```plaintext
!
monitor-link-group MC_LAG 90
!
interface ethernet 0/48
 monitor-link MC_LAG uplink
 exit
!
interface ethernet 0/0
 monitor-link MC_LAG downlink
 exit
```

Configure static routes.

```plaintext
ip route 10.20.0.1/24 10.93.0.9
```

5. Verify the configuration.

(1) Check the MC-LAG status (Leaf1).

```plaintext
sonic# show mclag state
The MCLAG's keepalive is: OK
MCLAG info sync is: completed
Domain id: 1
MCLAG session Channel: Primary Channel
VRF Name: default
consistency Check Action: idle
Local Ip: 10.245.0.1
Peer Ip: 10.245.0.2
Dad Local Ip:
Dad Peer Ip:
Peer Link Interface: lag 9999
Keepalive time: 1
Dad Detection Delay: 15
Dad Recovery Delay Mlag Intf: 60
Dad Recovery Delay Non Mlag Intf: 0
Dad VRF Name: default
Dad Status: disable
session Timeout : 15
Peer Link Mac: 60:eb:5a:01:10:b1
System Mac: 60:eb:5a:01:10:b1
Peer Mac: 00:00:00:00:00:00
Admin Role: None
Role: Active
MCLAG Interface: lag 1
Loglevel: NOTICE
```

(2) Verify VM connectivity.
VM-A1 and VM-B1 ping each other, can ping through, indicating successful configuration.

### <font color="#1d50a2">Example of MC-LAG ICCP Backup-channel Configuration (keepalive and peer-link are not the same link)</font>

1. Networking Requirements
   In the network, Leaf1 and Leaf2 are two independently operating devices, connected to Spine respectively. Due to the high service reliability requirements of the customer, MC-LAG is required to be configured between Leaf1 and Leaf2 to achieve cross-device link aggregation. Also configure ICCP backup-channel to ensure keep-alive link failure does not affect the work of MC-LAG.
2. Topology

::Image[]{src="https://app.archbee.com/api/optimize/zl-MD6bX0o2Ab3p8w66u1/dPKYHqD-gGo-UTg-H9aaC-20251128-083655.png" size="70" width="372" height="546" position="center" caption="Figure 4 MC-LAG ICCP Backup-channel Topology" showCaption="true"}

3. Steps
   (1)Check that the link status of the ports used on the switch is normal, and that all ports are stable in the UP state.
   (2)Configure the switch interface IP addresses.
   (3)Configure VLAN and configure IP address for VLAN interface.
   (4)Configure link aggregation group and add it to VLAN.
   (5)Configure MC-LAG.
   (6)Configure Monitor-link-group.
   (7)Configure static routes to ensure reachability of the service network.
4. Procedure
   **Spine**
   Configure IP addresses for interfaces.

```plaintext
interface ethernet 0/48
 ip address 10.93.0.1/30
 exit
!
interface ethernet 0/52
 ip address 10.93.0.9/30
 exit
!
```

Configure service VLAN with VLAN-ID 20.

```plaintext
!
vlan 20
 exit
!
interface vlan 20
 ip address 10.20.0.1/24
 exit
```

Add the interface to the VLAN.

```plaintext
!
interface ethernet 0/0
 switchport trunk vlan 20
```

Configure static routes

```plaintext
ip route 10.10.0.1/24 10.93.0.2
ip route 10.10.0.1/24 10.93.0.10
```

**Leaf1**
Configure IP addresses for interfaces.

```plaintext
interface ethernet 0/48
 ip address 10.93.0.2/30
 exit
```

Configure service VLAN with VLAN-ID 10, Keep-alive VLAN with VLAN-ID 4094 and ICCP  backup VLAN with VLAN-ID 4093.

```plaintext
vlan 10
 exit
!
vlan 4094
 exit
!
vlan 4093
 exit
!
interface vlan 10
 ip address 10.10.0.1/24
 mac-address 00:00:00:10:00:00
 exit
!
interface vlan 4094
 ip address 10.245.0.1/30
 exit
!
interface vlan 4093
 exit
```

Configure LAG.

```plaintext
interface link-aggregation 9999
 mode static
 commit
 switchport trunk vlan 10
 exit
!
interface link-aggregation 1
 lacp fast-rate
 commit
 switchport trunk vlan 10
!
interface ethernet 0/64
 switchport trunk vlan 4094
!
interface ethernet 0/68
 switchport trunk vlan 4093
!
interface ethernet 0/72
 link-aggregation-group 9999
 exit
!
interface ethernet 0/76
 link-aggregation-group 9999
 exit
!
interface ethernet 0/0
 link-aggregation-group 1
 exit
```

Configure MC-LAG.

```plaintext
mclag domain 1
 local-address 10.245.0.1
 peer-address 10.245.0.2
 peer-link link-aggregation 9999
 backup-channel vlan 4093
 commit
 member lag 1
```

Configure Monitor-link-group

```plaintext
!
monitor-link-group MC_LAG 90
!
interface ethernet 0/48
 monitor-link MC_LAG uplink
 exit
!
interface ethernet 0/0
 monitor-link MC_LAG downlink
 exit
```

Configure static routes.

```plaintext
ip route 10.20.0.1/24 10.93.0.1
```

**Leaf2**
Configure IP addresses for interfaces.

```plaintext
interface ethernet 0/48
 ip address 10.93.0.10/30
 exit
```

Configure service VLAN with VLAN-ID 10, Keep-alive VLAN with VLAN-ID 4094 and ICCP  backup VLAN with VLAN-ID 4093.

```plaintext
vlan 10
 exit
!
vlan 4094
 exit
!
vlan 4093
 exit
!
interface vlan 10
 ip address 10.10.0.1/24
 mac-address 00:00:00:10:00:00
 exit
!
interface vlan 4094
 ip address 10.245.0.2/30
 exit
!
interface vlan 4093
 exit
```

Configure LAG.

```plaintext
interface link-aggregation 9999
 mode static
 commit
 switchport trunk vlan 10
 exit
!
interface link-aggregation 1
 lacp fast-rate
 commit
 switchport trunk vlan 10
!
interface ethernet 0/64
 switchport trunk vlan 4094
!
interface ethernet 0/68
 switchport trunk vlan 4093
!
interface ethernet 0/72
 link-aggregation-group 9999
 exit
!
interface ethernet 0/76
 link-aggregation-group 9999
 exit
!
interface ethernet 0/0
 link-aggregation-group 1
 exit
```

Configure MC-LAG.

```plaintext
mclag domain 1
 local-address 10.245.0.2
 peer-address 10.245.0.1
 peer-link link-aggregation 9999
 backup-channel vlan 4093
 commit
 member lag 1
```

Configure Monitor-link-group

```plaintext
!
monitor-link-group MC_LAG 90
!
interface ethernet 0/48
 monitor-link MC_LAG uplink
 exit
!
interface ethernet 0/0
 monitor-link MC_LAG downlink
 exit
```

Configure static routes.

```plaintext
ip route 10.20.0.1/24 10.93.0.9
```

5. Verify the configuration.

(1) Check the MC-LAG status (Leaf1).

```plaintext
sonic# show mclag state
The MCLAG's keepalive is: OK
MCLAG info sync is: completed
Domain id: 1
MCLAG session Channel: Primary Channel
VRF Name: default
consistency Check Action: idle
Local Ip: 10.245.0.1
Peer Ip: 10.245.0.2
Dad Local Ip:
Dad Peer Ip:
Peer Link Interface: lag 9999
Keepalive time: 1
Dad Detection Delay: 15
Dad Recovery Delay Mlag Intf: 60
Dad Recovery Delay Non Mlag Intf: 0
Dad VRF Name: default
Dad Status: disable
session Timeout : 15
Peer Link Mac: 60:eb:5a:01:10:b1
System Mac: 60:eb:5a:01:10:b1
Peer Mac: 00:00:00:00:00:00
Admin Role: None
Role: Active
MCLAG Interface: lag 1
Loglevel: NOTICE
```

(2) Verify VM connectivity.
VM-A1 and VM-B1 ping each other, can ping through, indicating successful configuration.
(3) Check if the ICCP backup channel is active.
Disconnect the keep-alive link and then check the MC-LAG status.

```plaintext
sonic# show mclag state
The MCLAG's keepalive is: OK
MCLAG info sync is: completed
Domain id: 1
MCLAG session Channel: Backup channel（vlan4093）
VRF Name: default
consistency Check Action: idle
Local Ip: 10.245.0.1
Peer Ip: 10.245.0.2
Dad Local Ip:
Dad Peer Ip:
Peer Link Interface: lag 9999
Keepalive time: 1
Dad Detection Delay: 15
Dad Recovery Delay Mlag Intf: 60
Dad Recovery Delay Non Mlag Intf: 0
Dad VRF Name: default
Dad Status: disable
session Timeout : 15
Peer Link Mac: 60:eb:5a:01:10:b1
System Mac: 60:eb:5a:01:10:b1
Peer Mac: 00:00:00:00:00:00
Admin Role: None
Role: Active
MCLAG Interface: lag 1
Loglevel: NOTICE
```

### <font color="#1d50a2">Example of MC-LAG scenario loop detection</font>

1. Topology

::Image[]{src="https://app.archbee.com/api/optimize/zl-MD6bX0o2Ab3p8w66u1/RWKrSXehylKne1qwveWUD-20251128-083833.png" size="70" width="372" height="546" position="center" caption="Figure 5 MC-LAG Scenario Loop Detection Topology" showCaption="true"}

2. Configuration Roadmap
   (1) Check that the link status of the ports used on the switch is normal, and that all ports are stable in the UP state.
   (2) Configure the switch interface IP addresses.
   (3) Configure VLAN and configure IP address for VLAN interface.
   (4) Configure link aggregation group and add it to VLAN.
   (5) Configure MC-LAG.
   (6) Configure loop detection on the interface
   (7) Configure static routes to ensure reachability of the service network
3. Procedure
   **Spine**
   Configure IP addresses for interfaces.

```plaintext
interface ethernet 0/48
 ip address 10.93.0.1/30
 exit
!
interface ethernet 0/52
 ip address 10.93.0.9/30
 exit
!
```

Configure service VLAN with VLAN-ID 20.

```plaintext
!
vlan 20
 exit
!
interface vlan 20
 ip address 10.20.0.1/24
 exit
```

Add the interface to the VLAN.

```plaintext
!
interface ethernet 0/0
 switchport trunk vlan 20
```

Configure static routes.

```plaintext
ip route 10.10.0.1/24 10.93.0.2
ip route 10.10.0.1/24 10.93.0.10
```

**Leaf1**
Configure IP addresses for interfaces.

```plaintext
interface ethernet 0/48
 ip address 10.93.0.2/30
 exit
```

Configure service VLAN with VLAN-ID 10, Keep-alive VLAN with VLAN-ID 4094.

```plaintext
vlan 10
 exit
!
vlan 4094
 exit
!
interface vlan 10
 ip address 10.10.0.1/24
 mac-address 00:00:00:10:00:00
 exit
!
interface vlan 4094
 ip address 10.245.0.1/30
 exit
```

Configure LAG.

```plaintext
interface link-aggregation 9999
 mode static
 commit
 switchport trunk vlan 4094
 switchport trunk vlan 10
 exit
!
interface link-aggregation 1
 lacp fast-rate
 commit
 switchport trunk vlan 10
!
interface ethernet 0/68
 switchport trunk vlan 10
!
interface ethernet 0/72
 link-aggregation-group 9999
 exit
!
interface ethernet 0/76
 link-aggregation-group 9999
 exit
!
interface ethernet 0/0
 link-aggregation-group 1
 exit
```

Configure MC-LAG.

```plaintext
mclag domain 1
 local-address 10.245.0.1
 peer-address 10.245.0.2
 peer-link link-aggregation 9999
 commit
 member lag 1
```

Configure loopback detection on the interface.

```plaintext
!
interface link-aggregation 1
 loopback-detect vlan 10-40 policy block-vlan interval 20 wait-time 60
```

Configure static routes.

```plaintext
ip route 10.20.0.1/24 10.93.0.1
```

**Leaf2**
Configure IP addresses for interfaces.

```plaintext
interface ethernet 0/48
 ip address 10.93.0.10/30
 exit
```

Configure service VLAN with VLAN-ID 10, Keep-alive VLAN with VLAN-ID 4094.

```plaintext
vlan 10
 exit
!
vlan 4094
 exit
!
interface vlan 10
 ip address 10.10.0.1/24
 mac-address 00:00:00:10:00:00
 exit
!
interface vlan 4094
 ip address 10.245.0.2/30
 exit
```

Configure LAG.

```plaintext
interface link-aggregation 9999
 mode static
 commit
 switchport trunk vlan 4094
 switchport trunk vlan 10
 exit
!
interface link-aggregation 1
 lacp fast-rate
 commit
 switchport trunk vlan 10
!
interface ethernet 0/68
 switchport trunk vlan 10
!
interface ethernet 0/72
 link-aggregation-group 9999
 exit
!
interface ethernet 0/76
 link-aggregation-group 9999
 exit
!
interface ethernet 0/0
 link-aggregation-group 1
 exit
```

Configure MC-LAG.

```plaintext
mclag domain 1
 local-address 10.245.0.2
 peer-address 10.245.0.1
 peer-link link-aggregation 9999
 commit
 member lag 1
```

Configure loopback detection on the interface.

```plaintext
!
interface link-aggregation 1
 loopback-detect vlan 10-40 policy block-vlan interval 20 wait-time 60
```

Configure static routes.

```plaintext
ip route 10.20.0.1/24 10.93.0.9
```

4. Verify the configuration.

(1) Check the MC-LAG status (Leaf1).

```plaintext
sonic# show mclag state
The MCLAG's keepalive is: OK
MCLAG info sync is: completed
Domain id: 1
MCLAG session Channel: Primary Channel
VRF Name: default
consistency Check Action: idle
Local Ip: 10.245.0.1
Peer Ip: 10.245.0.2
Dad Local Ip:
Dad Peer Ip:
Peer Link Interface: lag 9999
Keepalive time: 1
Dad Detection Delay: 15
Dad Recovery Delay Mlag Intf: 60
Dad Recovery Delay Non Mlag Intf: 0
Dad VRF Name: default
Dad Status: disable
session Timeout : 15
Peer Link Mac: 60:eb:5a:01:10:b1
System Mac: 60:eb:5a:01:10:b1
Peer Mac: 00:00:00:00:00:00
Admin Role: None
Role: Active
MCLAG Interface: lag 1
Loglevel: NOTICE
```

(2) Check the loop detection results.

```plaintext
 sonic# show loopback-detect
Port    Policy      Vlan      Interval    Wait time  Vlans with loop
------  ----------  ------  ----------  -----------  -----------------
lag1    block-vlan  10-40           20           60  10
```

### <font color="#1d50a2">Example of Two-Level MC-LAG Configuration</font>

1. Networking Requirements
   The customer needs to build a large Layer 2 data center network using a two-level MC-LAG approach to expand the number of accessible hosts.
2. Topology

::Image[]{src="https://app.archbee.com/api/optimize/zl-MD6bX0o2Ab3p8w66u1/dcyLF2Zsjl8mGJzK0c_Ly-20251128-083950.png" size="90" width="894" height="360" position="center" caption="Figure 6 Two Level MC-LAG Topology" showCaption="true"}

1. Configuration Roadmap
   (1) Check that the link status of the ports used on the switch is normal, and that all ports are stable in the UP state.
   (2) Configure VLAN and configure IP address for VLAN interface.
   (3) Configure link aggregation group and add it to VLAN.
   (4) Configure MC-LAG.
2. Procedure
   **Leaf1**
   Configure service VLAN with VLAN-ID 10, Keep-alive VLAN with VLAN-ID 4094.

```plaintext
vlan 10
 exit
!
vlan 4094
 exit
!
interface vlan 10
 ip address 10.10.0.1/24
 mac-address 00:00:00:10:00:00
 exit
!
interface vlan 4094
 ip address 10.245.0.1/30
 exit
```

:::Paragraph{indent="1"}
Configure LAG.
:::

```plaintext
interface link-aggregation 9999
 mode static
 commit
 switchport trunk vlan 4094
 switchport trunk vlan 10
 exit
!
interface link-aggregation 1
 lacp fast-rate
 commit
 switchport trunk vlan 10
!
interface link-aggregation 2
 lacp fast-rate
 commit
 switchport trunk vlan 10
!
interface ethernet 0/72
 link-aggregation-group 9999
 exit
!
interface ethernet 0/76
 link-aggregation-group 9999
 exit
!
interface ethernet 0/0
 link-aggregation-group 1
 exit
!
interface ethernet 0/1
 link-aggregation-group 1
 exit
!
interface ethernet 0/2
 link-aggregation-group 2
 exit
!
interface ethernet 0/3
 link-aggregation-group 2
 exit
```

:::Paragraph{indent="1"}
Configure MC-LAG
:::

```plaintext
mclag domain 1
 local-address 10.245.0.1
 peer-address 10.245.0.2
 peer-link link-aggregation 9999
 commit
 member lag 1
 member lag 2
```

:::Paragraph{indent="1"}
**Leaf2**
Configure service VLAN with VLAN-ID 10, Keep-alive VLAN with VLAN-ID 4094.
:::

```plaintext
vlan 10
 exit
!
vlan 4094
 exit
!
interface vlan 10
 ip address 10.10.0.1/24
 mac-address 00:00:00:10:00:00
 exit
!
interface vlan 4094
 ip address 10.245.0.2/30
 exit
```

:::Paragraph{indent="1"}
Configure LAG.
:::

```plaintext
interface link-aggregation 9999
 mode static
 commit
 switchport trunk vlan 4094
 switchport trunk vlan 10
 exit
!
interface link-aggregation 1
 lacp fast-rate
 commit
 switchport trunk vlan 10
!
interface link-aggregation 2
 lacp fast-rate
 commit
 switchport trunk vlan 10
!
interface ethernet 0/72
 link-aggregation-group 9999
 exit
!
interface ethernet 0/76
 link-aggregation-group 9999
 exit
!
interface ethernet 0/0
 link-aggregation-group 1
 exit
!
interface ethernet 0/1
 link-aggregation-group 1
 exit
!
interface ethernet 0/2
 link-aggregation-group 2
 exit
!
interface ethernet 0/3
 link-aggregation-group 2
 exit
```

:::Paragraph{indent="1"}
Configure MC-LAG
:::

```plaintext
mclag domain 1
 local-address 10.245.0.2
 peer-address 10.245.0.1
 peer-link link-aggregation 9999
 commit
 member lag 1
 member lag 2
```

:::Paragraph{indent="1"}
**Leaf3**
Configure service VLAN with VLAN-ID 10, Keep-alive VLAN with VLAN-ID 4094.
:::

```plaintext
vlan 10
 exit
!
vlan 4094
 exit
!
interface vlan 4094
 ip address 10.245.0.5/30
 exit
```

:::Paragraph{indent="1"}
Configure LAG.
:::

```plaintext
interface link-aggregation 9999
 mode static
 commit
 switchport trunk vlan 4094
 switchport trunk vlan 10
 exit
!
interface link-aggregation 1
 lacp fast-rate
 commit
 switchport trunk vlan 10
!
interface link-aggregation 100
 lacp fast-rate
 commit
 switchport trunk vlan 10
!
interface link-aggregation 101
 lacp fast-rate
 commit
 switchport trunk vlan 10
!
interface ethernet 0/72
 link-aggregation-group 9999
 exit
!
interface ethernet 0/76
 link-aggregation-group 9999
 exit
!
interface ethernet 0/0
 link-aggregation-group 1
 exit
!
interface ethernet 0/1
 link-aggregation-group 1
 exit
!
interface ethernet 0/2
 link-aggregation-group 100
 exit
!
interface ethernet 0/3
 link-aggregation-group 101
 exit
```

:::Paragraph{indent="1"}
Configure MC-LAG
:::

```plaintext
mclag domain 1
 local-address 10.245.0.5
 peer-address 10.245.0.6
 peer-link link-aggregation 9999
 commit
 member lag 1
 member lag 100
 member lag 101
```

:::Paragraph{indent="1"}
**Leaf4**
Configure service VLAN with VLAN-ID 10, Keep-alive VLAN with VLAN-ID 4094.
:::

```plaintext
vlan 10
 exit
!
vlan 4094
 exit
!
interface vlan 4094
 ip address 10.245.0.6/30
 exit
```

:::Paragraph{indent="1"}
Configure LAG.
:::

```plaintext
interface link-aggregation 9999
 mode static
 commit
 switchport trunk vlan 4094
 switchport trunk vlan 10
 exit
!
interface link-aggregation 1
 lacp fast-rate
 commit
 switchport trunk vlan 10
!
interface link-aggregation 100
 lacp fast-rate
 commit
 switchport trunk vlan 10
!
interface link-aggregation 101
 lacp fast-rate
 commit
 switchport trunk vlan 10
!
interface ethernet 0/72
 link-aggregation-group 9999
 exit
!
interface ethernet 0/76
 link-aggregation-group 9999
 exit
!
interface ethernet 0/0
 link-aggregation-group 1
 exit
!
interface ethernet 0/1
 link-aggregation-group 1
 exit
!
interface ethernet 0/2
 link-aggregation-group 100
 exit
!
interface ethernet 0/3
 link-aggregation-group 101
 exit
```

:::Paragraph{indent="1"}
Configure MC-LAG
:::

```plaintext
mclag domain 1
 local-address 10.245.0.6
 peer-address 10.245.0.5
 peer-link link-aggregation 9999
 commit
 member lag 1
 member lag 100
 member lag 101
```

:::Paragraph{indent="1"}
**Leaf5**
Configure service VLAN with VLAN-ID 10, Keep-alive VLAN with VLAN-ID 4094.
:::

```plaintext
vlan 10
 exit
!
vlan 4094
 exit
!
interface vlan 4094
 ip address 10.245.0.9/30
 exit
```

:::Paragraph{indent="1"}
Configure LAG.
:::

```plaintext
interface link-aggregation 9999
 mode static
 commit
 switchport trunk vlan 4094
 switchport trunk vlan 10
 exit
!
interface link-aggregation 2
 lacp fast-rate
 commit
 switchport trunk vlan 10
!
interface link-aggregation 100
 lacp fast-rate
 commit
 switchport trunk vlan 10
!
interface link-aggregation 101
 lacp fast-rate
 commit
 switchport trunk vlan 10
!
interface ethernet 0/72
 link-aggregation-group 9999
 exit
!
interface ethernet 0/76
 link-aggregation-group 9999
 exit
!
interface ethernet 0/0
 link-aggregation-group 2
 exit
!
interface ethernet 0/1
 link-aggregation-group 2
 exit
!
interface ethernet 0/2
 link-aggregation-group 100
 exit
!
interface ethernet 0/3
 link-aggregation-group 101
 exit
```

:::Paragraph{indent="1"}
Configure MC-LAG
:::

```plaintext
mclag domain 1
 local-address 10.245.0.9
 peer-address 10.245.0.10
 peer-link link-aggregation 9999
 commit
 member lag 2
 member lag 100
 member lag 101
```

:::Paragraph{indent="1"}
**Leaf6**
Configure service VLAN with VLAN-ID 10, Keep-alive VLAN with VLAN-ID 4094.
:::

```plaintext
vlan 10
 exit
!
vlan 4094
 exit
!
interface vlan 4094
 ip address 10.245.0.10/30
 exit
```

:::Paragraph{indent="1"}
Configure LAG.
:::

```plaintext
interface link-aggregation 9999
 mode static
 commit
 switchport trunk vlan 4094
 switchport trunk vlan 10
 exit
!
interface link-aggregation 2
 lacp fast-rate
 commit
 switchport trunk vlan 10
!
interface link-aggregation 100
 lacp fast-rate
 commit
 switchport trunk vlan 10
!
interface link-aggregation 101
 lacp fast-rate
 commit
 switchport trunk vlan 10
!
interface ethernet 0/72
 link-aggregation-group 9999
 exit
!
interface ethernet 0/76
 link-aggregation-group 9999
 exit
!
interface ethernet 0/0
 link-aggregation-group 2
 exit
!
interface ethernet 0/1
 link-aggregation-group 2
 exit
!
interface ethernet 0/2
 link-aggregation-group 100
 exit
!
interface ethernet 0/3
 link-aggregation-group 101
 exit
```

:::Paragraph{indent="1"}
Configure MC-LAG
:::

```plaintext
mclag domain 1
 local-address 10.245.0.10
 peer-address 10.245.0.9
 peer-link link-aggregation 9999
 commit
 member lag 2
 member lag 100
 member lag 101
```

5. Verify the configuration.

:::Paragraph{indent="1"}
(1) Check the MC-LAG status (Leaf1)
:::

```plaintext
sonic# show mclag state
The MCLAG's keepalive is: OK
MCLAG info sync is: completed
Domain id: 1
MCLAG session Channel: Primary Channel
VRF Name: default
consistency Check Action: idle
Local Ip: 10.245.0.1
Peer Ip: 10.245.0.2
Dad Local Ip:
Dad Peer Ip:
Peer Link Interface: lag 9999
Keepalive time: 1
Dad Detection Delay: 15
Dad Recovery Delay Mlag Intf: 60
Dad Recovery Delay Non Mlag Intf: 0
Dad VRF Name: default
Dad Status: disable
session Timeout : 15
Peer Link Mac: 60:eb:5a:01:10:b1
System Mac: 60:eb:5a:01:10:b1
Peer Mac: 18:45:85:98:43:9b
Admin Role: None
Role: Active
MCLAG Interface: lag 1
Loglevel: NOTICE
```

:::Paragraph{indent="1"}
(2) Verify Server connectivity.
Configure IPs for the Servers within the subnet of VLAN 10: assign 10.10.0.11 to Server1, 10.10.0.12 to Server2, 10.10.0.13 to Server3, and 10.10.0.14 to Server4.
Server1, Server2, Server3, Server4, ping each other, can ping through, indicating successful configuration.
:::

### <font color="#1d50a2">Example of MC-LAG L3 Backup Link Configuration</font>

1. Networking Requirements
   In the network, Leaf1 and Leaf2 are two independently operating devices, connected to Spine respectively. Due to the high service reliability requirements of the customer, MC-LAG is required to be configured between Leaf1 and Leaf2 to achieve cross-device link aggregation. An additional L3 backup link needs to be configured to ensure that traffic can be forwarded normally in the event of an uplink failure.
2. Topology

::Image[]{src="https://app.archbee.com/api/optimize/zl-MD6bX0o2Ab3p8w66u1/RxzoafkcTcPh0J0qb6jCu-20251128-084302.png" size="70" width="372" height="546" position="center" caption="Figure 7 MC-LAG L3 Backup Link Topology" showCaption="true"}

3. Configuration Roadmap
   (1) Check that the link status of the ports used on the switch is normal, and that all ports are stable in the UP state.
   (2) Configure the switch interface IP addresses.
   (3) Configure VLAN and configure IP address for VLAN interface.
   (4) Configure link aggregation group and add it to VLAN.
   (5) Configure MC-LAG.
   (6) Configure L3 backup link.
   (7) Configure static routes to ensure reachability of the service network
4. Procedure
   **Spine**
   Configure IP addresses for interfaces.

```plaintext
interface ethernet 0/48
 ip address 10.93.0.1/30
 exit
!
interface ethernet 0/52
 ip address 10.93.0.9/30
 exit
!
```

:::Paragraph{indent="1"}
Configure service VLAN with VLAN-ID 20.
:::

```plaintext
!
vlan 20
 exit
!
interface vlan 20
 ip address 10.20.0.1/24
 exit
```

:::Paragraph{indent="1"}
Add the interface to the VLAN.
:::

```plaintext
!
interface ethernet 0/0
 switchport trunk vlan 20
```

:::Paragraph{indent="1"}
Configure static routes.
:::

```plaintext
ip route 10.10.0.1/24 10.93.0.2
ip route 10.10.0.1/24 10.93.0.10
```

:::Paragraph{indent="1"}
**Leaf1**
Configure IP addresses for interfaces.
:::

```plaintext
interface ethernet 0/48
 ip address 10.93.0.2/30
 exit
```

:::Paragraph{indent="1"}
Configure service VLAN with VLAN-ID 10 and Keep-alive VLAN with VLAN-ID 4094.
:::

```plaintext
vlan 10
 exit
!
vlan 4094
 exit
!
interface vlan 10
 ip address 10.10.0.1/24
 mac-address 00:00:00:10:00:00
 exit
!
interface vlan 4094
 ip address 10.245.0.1/30
 exit
```

:::Paragraph{indent="1"}
Configure LAG.
:::

```plaintext
interface link-aggregation 9999
 mode static
 commit
 switchport trunk vlan 4094
 switchport trunk vlan 10
 exit
!
interface link-aggregation 1
 lacp fast-rate
 commit
 switchport trunk vlan 10
!
interface ethernet 0/72
 link-aggregation-group 9999
 exit
!
interface ethernet 0/76
 link-aggregation-group 9999
 exit
!
interface ethernet 0/0
 link-aggregation-group 1
 exit
```

:::Paragraph{indent="1"}
Configure MC-LAG.
:::

```plaintext
mclag domain 1
 local-address 10.245.0.1
 peer-address 10.245.0.2
 peer-link link-aggregation 9999
 commit
 member lag 1
```

:::Paragraph{indent="1"}
Configure static routes.
:::

```plaintext
ip route 10.20.0.1/24 10.93.0.1
```

:::Paragraph{indent="1"}
Configure L3 backup link
:::

```plaintext
！
interface vlan 4094
 ip ospf bfd
 ip ospf network point-to-point
 exit
!
ospf enable
!
router ospf
 network 10.245.0.1/30 area 0.0.0.0
 network 10.20.0.1/24 area 0.0.0.0
```

:::Paragraph{indent="1"}
**Leaf2**
Configure IP addresses for interfaces.
:::

```plaintext
interface ethernet 0/48
 ip address 10.93.0.10/30
 exit
```

:::Paragraph{indent="1"}
Configure service VLAN with VLAN-ID 10 and Keep-alive VLAN with VLAN-ID 4094.
:::

```plaintext
vlan 10
 exit
!
vlan 4094
 exit
!
interface vlan 10
 ip address 10.10.0.1/24
 mac-address 00:00:00:10:00:00
 exit
!
interface vlan 4094
 ip address 10.245.0.2/30
 exit
```

:::Paragraph{indent="1"}
Configure LAG.
:::

```plaintext
interface link-aggregation 9999
 mode static
 commit
 switchport trunk vlan 4094
 switchport trunk vlan 10
 exit
!
interface link-aggregation 1
 lacp fast-rate
 commit
 switchport trunk vlan 10
!
interface ethernet 0/72
 link-aggregation-group 9999
 exit
!
interface ethernet 0/76
 link-aggregation-group 9999
 exit
!
interface ethernet 0/0
 link-aggregation-group 1
 exit
```

:::Paragraph{indent="1"}
Configure MC-LAG.
:::

```plaintext
mclag domain 1
 local-address 10.245.0.2
 peer-address 10.245.0.1
 peer-link link-aggregation 9999
 commit
 member lag 1
```

:::Paragraph{indent="1"}
Configure static routes.
:::

```plaintext
ip route 10.20.0.1/24 10.93.0.9
```

:::Paragraph{indent="1"}
Configure L3 backup link
:::

```plaintext
！
interface vlan 4094
 ip ospf bfd
 ip ospf network point-to-point
!
ospf enable
!
router ospf
 network 10.245.0.2/30 area 0.0.0.0
 network 10.20.0.1/24 area 0.0.0.0
```

5. Verify the configuration.
   (1) Check the MC-LAG status (Leaf1).

```plaintext
sonic# show mclag state
The MCLAG's keepalive is: OK
MCLAG info sync is: completed
Domain id: 1
MCLAG session Channel: Primary Channel
VRF Name: default
consistency Check Action: idle
Local Ip: 10.245.0.1
Peer Ip: 10.245.0.2
Dad Local Ip:
Dad Peer Ip:
Peer Link Interface: lag 9999
Keepalive time: 1
Dad Detection Delay: 15
Dad Recovery Delay Mlag Intf: 60
Dad Recovery Delay Non Mlag Intf: 0
Dad VRF Name: default
Dad Status: disable
session Timeout : 15
Peer Link Mac: 60:eb:5a:01:10:b1
System Mac: 60:eb:5a:01:10:b1
Peer Mac: 00:00:00:00:00:00
Admin Role: None
Role: Active
MCLAG Interface: lag 1
Loglevel: NOTICE
```

:::Paragraph{indent="1"}
(2) Verify VM connectivity.
VM-A1 and VM-B1 ping each other, can ping through, indicating successful configuration
:::





