---
title: VRRP Configuration Guide
slug: aidc/vrrp-configuration-guide
createdAt: 2025-11-28T09:24:53.555Z
---

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

VRRP, which stands for Virtual Router Redundancy Protocol, is a protocol that creates a virtual router by grouping multiple devices together. By configuring the IP address of this virtual device as the default gateway, it achieves backup for the default gateway. When the gateway device fails, the VRRP mechanism can elect a new gateway device to handle data traffic, thus ensuring reliable network communication. Hosts within the local area network only need to know the virtual IP address of this virtual router and set it as the IP address of the gateway.

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

### <font color="#1d50a2">Master Device</font>

The switch elected to take on the forwarding task, responsible for forwarding packets sent to the virtual IP address, as well as responding to ARP requests/ND requests.

### <font color="#1d50a2">Backup Device</font>

A group of devices that are not currently undertaking the forwarding task; when the Master device fails, they will compete to become the new Master device.

### <font color="#1d50a2">VRRP Working Process</font>

The working process of VRRP is as follows:
Devices in the VRRP backup group elect a Master based on priority. The Master device sends gratuitous ARP messages to notify the connected devices or hosts of the virtual MAC address, thereby taking on the task of forwarding packets.
The Master device periodically sends VRRP advertisement messages to all Backup devices within the backup group to announce its configuration information (priority, etc.) and working status.
If the Master device fails, the Backup devices in the VRRP backup group will re-elect a new Master based on priority.
When there is a state transition in the VRRP backup group, the Master device switches from one device to another. The new Master device immediately sends gratuitous ARP messages, which carry the virtual MAC address and virtual IP address information of the virtual router to refresh the MAC table entries of the connected devices or hosts, thereby directing user traffic to the new Master device. The entire process is completely transparent to the users.

## <font color="#1d50a2">VRRP Configuration</font>

- This feature is only supported by the CX308P-48Y-N-V2 and CX532P-N-V2 models; other models are not currently supported.

### <font color="#1d50a2">VRRP Default Setting</font>

The default setting of VRRP is shown in the following table.

<font color="#1d05a2">Table 1 Default setting of VRRP</font>

| **Parameters**                                      | **Default value** |
| --------------------------------------------------- | ----------------- |
| Protocol Running Version                            | 3                 |
| Message Announcement Interval                       | 1000ms            |
| Preemption Mode                                     | Enable            |
| Priority                                            | 100               |
| Checksum Calculation with IPv4 Packet Pseudo-header | Enable            |

### <font color="#1d50a2">Configure VRRP Instance</font>

<font color="#1d05a2">Table 2 Configure VRRP Instance</font>

| **Purpose**                                                                    | **Commands**                                                                                                                                                        | **Description**                                                                                                                                                                                                                                                                                                                               |
| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Enter global configuration view                                                | **configure terminal**                                                                                                                                              | -                                                                                                                                                                                                                                                                                                                                             |
| Enable VRRP.                                                                   | **vrrp enable**                                                                                                                                                     | -                                                                                                                                                                                                                                                                                                                                             |
| Enter interface configuration view.                                            | **interface** \{**ethernet** *interface-name\[.subinterface-number ]*\| **link-aggregation** *lag-id\[.subinterface-number&#x20;*]\|**vlan** *vlan-id*}             | -                                                                                                                                                                                                                                                                                                                                             |
| Configure VRID                                                                 | \{**vrrp**\|**vrrp6**} *vrid* \[**version** *protocol\_ver*]                                                                                                        | vrid: range is \[0,255].the VRRP protocol version parameter protocol\_ver can be specified as 2 or 3, with the default value being 3. VRRP6 does not require specification.                                                                                                                                                                   |
| Configure Virtual IP                                                           | \{**vrrp**\|**vrrp6**} *vrid* \{**ip** *A.B.C.D/M*\| **ipv6** *X\:X\::X\:X/M*}                                                                                      | -                                                                                                                                                                                                                                                                                                                                             |
| Configure VRRP Instance priority.                                              | \{**vrrp**\|**vrrp6**} *vrid&#x20;***priority** *pri*                                                                                                               | pri: Priority, default is 100, value range \[1,254]                                                                                                                                                                                                                                                                                           |
| Configure the VRRP advertisement interval                                      | \{**vrrp**\|**vrrp6**} *vrid* **advertisement-interval** *time*                                                                                                     | time: The advertisement interval for VRRP messages, with a value range of \[10,40950] in milliseconds and a default value of 1000. When the protocol version is 2, this value should be a multiple of 1000; when the protocol version is 3, it should be a multiple of 10.                                                                    |
| Disable Preempt Mode                                                           | **no** \{**vrrp**\|**vrrp6**} *vrid* **preempt**                                                                                                                    | Enabled by default, when enabled, the Backup device has a higher priority than the Master and will become the new Master. When disabled, even if a Backup device is later configured with a higher priority, it will not become the Master device as long as the Master device has not failed, which can prevent frequent Master switchovers. |
| Disable VRRP Instance                                                          | \{**vrrp**\|**vrrp6**} *vrid* **shutdown**                                                                                                                          | Before making network adjustments or changing VRRP configurations, you can first disable the VRRP instance to avoid affecting existing network services during the modification process.                                                                                                                                                      |
| Configure checksum to exclude the calculation of the IPv4 packet pseudo-header | **no vrrp&#x20;***vrid***&#x20;checksum-with-ipv4-pseudoheader**                                                                                                    | Default is to calculate, applicable only for VRRP protocol version 3                                                                                                                                                                                                                                                                          |
| Configure instance associated interfaces                                       | \{**vrrp**\|**vrrp6**} *vrid* **track-interface** \{**ethernet** *interface\_name*\|**link-aggregation** *lag-id* \|**vlan** *vlan-id*} **priority-dec***&#x20;pri* | When the upstream port fails, the Master can correspondingly reduce its priority to trigger a re-election of the Master, ensuring normal traffic forwarding.                                                                                                                                                                                  |

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

<font color="#1d05a2">Table 3 VRRP Display and Maintenance</font>

| **Purpose**                  | **Command**                                                                                                                                                                                                                    | **Description** |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------- |
| Display VRRP configurations. | **show** \{**vrrp**\|**vrrp6**} \[**interface** \{**ethernet** *interface\_name*\[*.subinterface-number* ]\|**link-aggregation** *lag-id*\[*.subinterface-number* ] \|**vlan** *vlan-id*}] \[*vrid* ] \[**json**\|**summary**] | -               |

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

### <font color="#1d50a2">VRRP and MSTP Integrated Configuration Scenario</font>

1. Networking Requirements
   SwitchA and SwitchB implement gateway redundancy through VRRP and eliminate Layer 2 loops through MSTP.
2. Topology

::Image[]{src="https://app.archbee.com/api/optimize/zl-MD6bX0o2Ab3p8w66u1/fsYCDseE_Sk5DiNxvZLA5-20251128-085004.png" size="90" width="681" height="540" position="center" caption="Figure 9 VRRP And MSTP Typical Scenario Topology" showCaption="true"}

3. Configuration Roadmap
   (1) Basic VLAN and IP configuration.
   (2) MSTP configuration for Switch A, Switch B, and Switch C.
   (3) VRRP configuration for Switch A and Switch B.
   (4) Routing protocol configuration for Switch A, Switch B, and Switch D.
4. Procedure
   **Switch A**
   Configure MSTP.

```plaintext
sonic# configure terminal
sonic(config)# vlan 107
sonic(config-vlan-107)# exit
sonic(config)# mstp enable
sonic(config)# mstp name test1
sonic(config)# mstp instance 1
sonic(config-mstp-instance-1)# vlan 107
sonic(config-mstp-instance-1)# priority 0
sonic(config-mstp-instance-1)# exit
```

:::Paragraph{indent="1"}
Configure VLAN and IP.
:::

```plaintext
sonic(config)# interface ethernet 0/128
sonic(config-if-0/128)# switchport trunk vlan 107
sonic(config-if-0/128)# exit
sonic(config)# interface ethernet 0/129
sonic(config-if-0/129)# switchport trunk vlan 107
sonic(config-if-0/129)# exit
sonic(config)# interface vlan 107
sonic(config-vlanif-107)# ip address 107.0.0.171/24
sonic(config-vlanif-107)# ip address 107::171/64
sonic(config-vlanif-107)# exit
sonic(config)# interface ethernet 0/4
sonic(config-if-0/4)# ip address 4.0.0.171/24
sonic(config-if-0/4)# ip address 4::171/2464
sonic(config-if-0/4)# exit
```

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

```plaintext
sonic(config)# interface vlan 107
sonic(config-vlanif-107)# vrrp 1 ip 107.0.0.1/24
sonic(config-vlanif-107)# vrrp6 2 ipv6 107::1/64
sonic(config-vlanif-107)# vrrp 1 priority 120
sonic(config-vlanif-107)# vrrp6 2 priority 120
sonic(config-vlanif-107)# vrrp 1 track-interface ethernet 0/4 priority-dec 50
sonic(config-vlanif-107)# vrrp6 2 track-interface ethernet 0/4 priority-dec 50
sonic(config-vlanif-107)# exit
```

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

```plaintext
sonic(config)# router ospf
sonic(config-router)# router-id 10.250.0.171
sonic(config-router)# exit
sonic(config)# router ospf6
sonic(config-ospf6)# ospf6 router-id 10.250.0.171
sonic(config-ospf6)# exit
sonic(config)# interface vlan 107
sonic(config-vlanif-107)# ip ospf area 107
sonic(config-vlanif-107)# ipv6 ospf6 area 107
sonic(config-vlanif-107)# exit
sonic(config)# interface ethernet 0/4
sonic(config-if-0/4)# ip ospf area 107
sonic(config-if-0/4)# ipv6 ospf6 area 107
sonic(config-if-0/4)# exit
```

:::Paragraph{indent="1"}
**Switch B**
Configure MSTP.
:::

```plaintext
sonic# configure terminal
sonic(config)# vlan 107
sonic(config-vlan-107)# exit
sonic(config)# mstp enable
sonic(config)# mstp name test1
sonic(config)# mstp instance 1
sonic(config-mstp-instance-1)# vlan 107
sonic(config-mstp-instance-1)# exit
```

:::Paragraph{indent="1"}
Configure VLAN and IP.
:::

```plaintext
sonic(config)# interface ethernet 0/0
sonic(config-if-0/0)# switchport trunk vlan 107
sonic(config-if-0/0)# exit
sonic(config)# interface ethernet 0/45
sonic(config-if-0/45)# switchport trunk vlan 107
sonic(config-if-0/45)# exit
sonic(config)# interface vlan 107
sonic(config-vlanif-107)# ip address 107.0.0.173/24
sonic(config-vlanif-107)# ip address 107::173/64
sonic(config-vlanif-107)# exit
sonic(config)# interface ethernet 0/46
sonic(config-if-0/46)# ip address 46.0.0.173/24
sonic(config-if-0/46)# ip address 46::173/24
sonic(config-if-0/46)# exit
```

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

```plaintext
sonic(config)# interface vlan 107
sonic(config-vlanif-107)# vrrp 1 ip 107.0.0.1/24
sonic(config-vlanif-107)# vrrp6 2 ipv6 107::1/64
sonic(config-vlanif-107)# exit
```

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

```plaintext
sonic(config)# router ospf
sonic(config-router)# ospf router-id 10.250.0.173
sonic(config-router)# exit
sonic(config)# router ospf6
sonic(config-ospf6)# router ospf6 vrf 1007
sonic(config-ospf6)# ospf6 router-id 10.250.0.173
sonic(config-ospf6)# exit
sonic(config)# interface vlan 107
sonic(config-vlanif-107)# ip ospf area 107
sonic(config-vlanif-107)# ipv6 ospf6 area 107
sonic(config-vlanif-107)# exit
sonic(config)# interface ethernet 0/46
sonic(config-if-0/46)# ip ospf area 107
sonic(config-if-0/46)# ipv6 ospf6 area 107
sonic(config-if-0/46)# exit
```

:::Paragraph{indent="1"}
**Switch C**
Configure MSTP.
:::

```plaintext
sonic# configure terminal
sonic(config)# vlan 107
sonic(config-vlan-107)# exit
sonic(config)# mstp enable
sonic(config)# mstp name test1
sonic(config)# mstp instance 1
sonic(config-mstp-instance-1)# vlan 107
sonic(config-mstp-instance-1)# exit
sonic(config)# mstp edge-port enable interface ethernet 0/64
```

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

```plaintext
sonic(config)# interface ethernet 0/64
sonic(config-if-0/64)# switchport access vlan 107
sonic(config-if-0/64)# exit
sonic(config)# interface ethernet 0/47
sonic(config-if-0/47)# switchport trunk vlan 107
sonic(config-if-0/47)# exit
sonic(config)# interface ethernet 0/45
sonic(config-if-0/45)# switchport trunk  vlan 107
sonic(config-if-0/45)# exit
```

:::Paragraph{indent="1"}
**Switch D**
Configure IP.
:::

```plaintext
sonic(config)# interface ethernet 0/76
sonic(config-if-0/76)# ip address 4.0.0.131/24
sonic(config-if-0/76)# ip address 4::131/64
sonic(config-if-0/76)# exit
sonic(config)# interface ethernet 0/46
sonic(config-if-0/46)# ip address 46.0.0.131/24
sonic(config-if-0/46)# ip address 46::131/64
sonic(config-if-0/46)# exit
sonic(config)# interface ethernet 0/65
sonic(config-if-0/65)# ip address 65.0.0.131/24
sonic(config-if-0/65)# ip address 65::131/64
sonic(config-if-0/65)# exit
```

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

```plaintext
sonic(config)# router ospf
sonic(config-router)# ospf router-id 10.250.0.131
sonic(config-router)# exit
sonic(config)# router ospf6
sonic(config-ospf6)# ospf6 router-id 10.250.0.131
sonic(config-ospf6)# exit
sonic(config)# interface ethernet 0/76
sonic(config-if-0/76)# ip ospf area 107
sonic(config-if-0/76)# ipv6 ospf6 area 107
sonic(config-if-0/76)# exit
sonic(config)# interface ethernet 0/46
sonic(config-if-0/46)# ip ospf area 107
sonic(config-if-0/46)# ipv6 ospf6 area 107
sonic(config-if-0/46)# exit
sonic(config)# interface ethernet 0/65
sonic(config-if-0/65)# ip ospf area 107
sonic(config-if-0/65)# ipv6 ospf6 area 107
sonic(config-if-0/65)# end
```

5. Configure Verification

:::Paragraph{indent="1"}
(1) Configuration check
(2) Check VRRP/VRRP6 status
:::

```plaintext
show vrrp/vrrp6
```

:::Paragraph{indent="1"}
(3) Check MSTP status
:::

```plaintext
show mstp
```

:::Paragraph{indent="1"}
(4) VM-A1's gateway is configured with the VRRP address, and it can ping VM-B1 successfully.
:::

### <font color="#1d50a2">MC-LAG Device Configuration with VRRP Scenari</font>

1. Networking Requirements
   Within the same data center, when creating VRRP, configure the same interface IP and virtual MAC to simulate the two devices of the MC-LAG system as a single device for VRRP negotiation with the MC-LAG system of the peer data center.
2. Topology

::Image[]{src="https://app.archbee.com/api/optimize/zl-MD6bX0o2Ab3p8w66u1/A9T2Z_SB4w3AuJ5jqExiP-20251128-085240.png" size="90" width="919" height="810" position="center" caption="Figure 10 MCLAG Device Configuration VRRP Scenario Topology" showCaption="true"}

3. Configuration Roadmap
   (1) Switch A and Switch B are configured as an MCLAG pair, and Switch C and Switch D are configured as another MCLAG pair.
   (2) Switch A and Switch B are configured as VRRP masters, while Switch C and Switch D are configured as VRRP backups.
   (3) Routing protocols are configured between Switch A and Switch D, and between Switch A and Switch H.
4. Procedure
   **Switch A**
   Configure MCLAG.

```plaintext
sonic# configure terminal
sonic(config)# vlan range 1,1007
sonic(config)# interface vlan 1
sonic(config-vlanif-1)# ip address 1.0.0.173/24
sonic(config-vlanif-1)# exit
sonic(config)# interface vlan 1007
sonic(config-vlanif-1007)# mac-address 60:eb:5a:00:01:07
sonic(config-vlanif-1007)# ip address 107.0.0.10/24
sonic(config-vlanif-1007)# exit
sonic(config)# interface ethernet 0/1
sonic(config-if-0/1)# switchport trunk vlan 1
sonic(config-if-0/1)# switchport trunk vlan 1007
sonic(config-if-0/1)# exit
sonic(config)# interface link-aggregation 1007
sonic(config-lagif-1007)# switchport trunk vlan 1007
sonic(config-lagif-1007)# exit
sonic(config)# interface ethernet 0/0
sonic(config-if-0/0)# link-aggregation-group 1007
sonic(config-if-0/0)# exit
sonic(config)# mclag domain 1007
sonic(mclag-domain)# local-address 1.0.0.173
sonic(mclag-domain)# peer-address 1.0.0.174
sonic(mclag-domain)# peer-link ethernet 0/1
sonic(mclag-domain)# commit
sonic(mclag-domain)# member lag 1007
sonic(mclag-domain)# exit
```

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

```plaintext
sonic# configure terminal
sonic(config)# interface vlan 1007
sonic(config-vlanif-1007)# vrrp 255
sonic(config-vlanif-1007)# vrrp 255 priority 120
sonic(config-vlanif-1007)# vrrp 255 track-interface ethernet 0/2 priority-dec 50
sonic(config-vlanif-1007)# vrrp 255 ip 107.0.0.1/24
sonic(config-vlanif-1007)# exit
```

:::Paragraph{indent="1"}
Configure Routing protocols.
:::

```plaintext
sonic# configure terminal
sonic(config)# router ospf
sonic(config-router)# ospf router-id 10.1.0.173
sonic(config-router)# exit
sonic(config)# interface ethernet 0/2
sonic(config-if-0/2)# ip address 2.0.0.173/24
sonic(config-if-0/2)# ip ospf area 1007
sonic(config-if-0/2)# exit
sonic(config)# interface vlan 1007
sonic(config-vlanif-1007)# ip ospf area 1007
sonic(config-vlanif-1007)# exit
```

:::Paragraph{indent="1"}
**Switch B**
Configure MCLAG.
:::

```plaintext
sonic# configure terminal
sonic(config)# vlan range 1,1007
sonic(config)# interface vlan 1
sonic(config-vlanif-1)# ip address 1.0.0.174/24
sonic(config-vlanif-1)# exit
sonic(config)# interface vlan 1007
sonic(config-vlanif-1007)# mac-address 60:eb:5a:00:01:07
sonic(config-vlanif-1007)# ip address 107.0.0.10/24
sonic(config-vlanif-1007)# exit
sonic(config)# interface ethernet 0/1
sonic(config-if-0/1)# switchport trunk vlan 1
sonic(config-if-0/1)# switchport trunk vlan 1007
sonic(config-if-0/1)# exit
sonic(config)# interface link-aggregation 1007
sonic(config-lagif-1007)# switchport trunk vlan 1007
sonic(config-lagif-1007)# exit
sonic(config)# interface ethernet 0/46
sonic(config-if-0/46)# link-aggregation-group 1007
sonic(config-if-0/46)# exit
sonic(config)# mclag domain 1007
sonic(mclag-domain)# local-address 1.0.0.174
sonic(mclag-domain)# peer-address 1.0.0.173
sonic(mclag-domain)# peer-link ethernet 0/1
sonic(mclag-domain)# commit
sonic(mclag-domain)# member lag 1007
sonic(mclag-domain)# exit
```

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

```plaintext
sonic# configure terminal
sonic(config)# interface vlan 1007
sonic(config-vlanif-1007)# vrrp 255
sonic(config-vlanif-1007)# vrrp 255 priority 120
sonic(config-vlanif-1007)# vrrp 255 track-interface ethernet 0/0 priority-dec 50
sonic(config-vlanif-1007)# vrrp 255 ip 107.0.0.1/24
sonic(config-vlanif-1007)# exit
```

:::Paragraph{indent="1"}
Configure Routing protocols.
:::

```plaintext
sonic# configure terminal
sonic(config)# router ospf
sonic(config-router)# ospf router-id 10.250.0.174
sonic(config-router)# exit
sonic(config)# interface ethernet 0/0
sonic(config-if-0/0)# ip address 46.0.0.174/24
sonic(config-if-0/0)# ip ospf area 1007
sonic(config-if-0/0)# exit
sonic(config)# interface vlan 1007
sonic(config-vlanif-1007)# ip ospf area 1007
sonic(config-vlanif-1007)# exit
```

:::Paragraph{indent="1"}
**Switch C**
Configure MCLAG.
:::

```plaintext
sonic# configure terminal
sonic(config)# vlan range 1,1007
sonic(config)# interface vlan 1
sonic(config-vlanif-1)# ip address 1.0.0.132/24
sonic(config-vlanif-1)# exit
sonic(config)# interface vlan 1007
sonic(config-vlanif-1007)# mac-address 60:eb:5a:00:01:08
sonic(config-vlanif-1007)# ip address 107.0.0.20/24
sonic(config-vlanif-1007)# exit
sonic(config)# interface ethernet 0/45
sonic(config-if-0/45)# switchport trunk vlan 1
sonic(config-if-0/45)# switchport trunk vlan 1007
sonic(config-if-0/45)# exit
sonic(config)# interface link-aggregation 1007
sonic(config-lagif-1007)# switchport trunk vlan 1007
sonic(config-lagif-1007)# exit
sonic(config)# interface ethernet 0/44
sonic(config-if-0/44)# link-aggregation-group 1007
sonic(config-if-0/44)# exit
sonic(config)# mclag domain 107
sonic(mclag-domain)# local-address 1.0.0.132
sonic(mclag-domain)# peer-address 1.0.0.180
sonic(mclag-domain)# peer-link ethernet 0/45
sonic(mclag-domain)# commit
sonic(mclag-domain)# member lag 1007
sonic(mclag-domain)# exit
```

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

```plaintext
sonic# configure terminal
sonic(config)# interface vlan 1007
sonic(config-vlanif-1007)# vrrp 255
sonic(config-vlanif-1007)# vrrp 255 ip 107.0.0.1/24
sonic(config-vlanif-1007)# exit
```

:::Paragraph{indent="1"}
Configure Routing protocols.
:::

```plaintext
sonic# configure terminal
sonic(config)# router ospf
sonic(config-router)# ospf router-id 10.250.0.132
sonic(config-router)# exit
sonic(config)# interface ethernet 0/0
sonic(config-if-0/0)# ip address 7.0.0.132/24
sonic(config-if-0/0)# ip ospf area 1007
sonic(config-if-0/0)# exit
sonic(config)# interface vlan 1007
sonic(config-vlanif-1007)# ip ospf area 1007
sonic(config-vlanif-1007)# exit
```

:::Paragraph{indent="1"}
**Switch D**
Configure MCLAG.
:::

```plaintext
sonic# configure terminal
sonic(config)# vlan range 1,1007
sonic(config)# interface vlan 1
sonic(config-vlanif-1)# ip address 1.0.0.180/24
sonic(config-vlanif-1)# exit
sonic(config)# interface vlan 1007
sonic(config-vlanif-1007)# mac-address 60:eb:5a:00:01:08
sonic(config-vlanif-1007)# ip address 107.0.0.20/24
sonic(config-vlanif-1007)# exit
sonic(config)# interface ethernet 0/40
sonic(config-if-0/40)# switchport trunk vlan 1
sonic(config-if-0/40)# switchport trunk vlan 1007
sonic(config-if-0/40)# exit
sonic(config)# interface link-aggregation 1007
sonic(config-lagif-1007)# switchport trunk vlan 1007
sonic(config-lagif-1007)# exit
sonic(config)# interface ethernet 0/42
sonic(config-if-0/42)# link-aggregation-group 1007
sonic(config-if-0/42)# exit
sonic(config)# mclag domain 107
sonic(mclag-domain)# local-address 1.0.0.180
sonic(mclag-domain)# peer-address 1.0.0.132
sonic(mclag-domain)# peer-link ethernet 0/40
sonic(mclag-domain)# commit
sonic(mclag-domain)# member lag 1007
sonic(mclag-domain)# exit
```

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

```plaintext
sonic# configure terminal
sonic(config)# interface vlan 1007
sonic(config-vlanif-1007)# vrrp 255
sonic(config-vlanif-1007)# vrrp 255 ip 107.0.0.1/24
sonic(config-vlanif-1007)# exit
```

:::Paragraph{indent="1"}
Configure Routing protocols.
:::

```plaintext
sonic# configure terminal
sonic(config)# router ospf
sonic(config-router)# ospf router-id 10.250.0.180
sonic(config-router)# exit
sonic(config)# interface ethernet 0/38
sonic(config-if-0/38)# ip address 47.0.0.180/24
sonic(config-if-0/38)# ip ospf area 1007
sonic(config-if-0/38)# exit
sonic(config)# interface vlan 1007
sonic(config-vlanif-1007)# ip ospf area 1007
sonic(config-vlanif-1007)# exit
```

:::Paragraph{indent="1"}
**Switch E**
:::

```plaintext
sonic# configure terminal
sonic(config)# vlan range 1007
sonic(config)# interface link-aggregation 1007
sonic(config-lagif-1007)# switchport trunk vlan 1007
sonic(config-lagif-1007)# exit
sonic(config)# interface ethernet 0/45
sonic(config-if-0/45)# link-aggregation-group 1007
sonic(config-if-0/45)# exit
sonic(config)# interface ethernet 0/46
sonic(config-if-0/46)# link-aggregation-group 1007
sonic(config-if-0/46)# exit
sonic(config)# interface ethernet 0/44
sonic(config-if-0/44)# switchport trunk vlan 1007
sonic(config-if-0/44)# exit
```

:::Paragraph{indent="1"}
**Switch F**
:::

```plaintext
sonic# configure terminal
sonic(config)# vlan range 1007
sonic(config)# interface ethernet 0/44
sonic(config-if-0/44)# link-aggregation-group 1007
sonic(config-if-0/44)# exit
sonic(config)# interface ethernet 0/47
sonic(config-if-0/47)# link-aggregation-group 1007
sonic(config-if-0/47)# exit
sonic(config)# interface link-aggregation 1007
sonic(config-lagif-1007)# switchport trunk vlan 1007
sonic(config-lagif-1007)# exit
sonic(config)# interface ethernet 0/7
sonic(config-if-0/7)# switchport trunk vlan 1007
sonic(config-if-0/7)# exit
```

:::Paragraph{indent="1"}
**Switch G**
:::

```plaintext
sonic# configure terminal
sonic(config)# interface ethernet 0/8
sonic(config-if-0/8)# switchport trunk vlan 1007
sonic(config-if-0/8)# exit
sonic(config)# interface ethernet 0/9
sonic(config-if-0/9)# switchport trunk vlan 1007
sonic(config-if-0/9)# exit
sonic(config)# interface ethernet 0/72
sonic(config-if-0/72)# switchport access vlan 1007
sonic(config-if-0/72)# exit
```

:::Paragraph{indent="1"}
**Switch H**
:::

```plaintext
sonic# configure terminal
sonic(config)# interface ethernet 0/7
sonic(config-if-0/7)# ip address 7.0.0.133/24
sonic(config-if-0/7)# ip ospf area 1007
sonic(config-if-0/7)# exit
sonic(config)# interface ethernet 0/45
sonic(config-if-0/45)# ip address 2.0.0.133/24
sonic(config-if-0/45)# ip ospf area 1007
sonic(config-if-0/45)# exit
sonic(config)# interface ethernet 0/46
sonic(config-if-0/46)# ip address 46.0.0.133/24
sonic(config-if-0/46)# ip ospf area 1007
sonic(config-if-0/46)# exit
sonic(config)# interface ethernet 0/47
sonic(config-if-0/47)# ip address 47.0.0.133/24
sonic(config-if-0/47)# ip ospf area 1007
sonic(config-if-0/47)# exit
sonic(config)# interface ethernet 0/73
sonic(config-if-0/73)# ip address 73.0.0.133/24
sonic(config-if-0/73)# ip ospf area 1007
sonic(config-if-0/73)# exit
```

5. Configure Verification

:::Paragraph{indent="1"}
(1) Configuration check
(2) Check VRRP status
:::

```plaintext
show vrrp
```

:::Paragraph{indent="1"}
(3) Check MCLAG status
:::

```plaintext
show mclag state
```

:::Paragraph{indent="1"}
(4) VM-A1's gateway is configured with the VRRP address, and it can ping VM-B1 successfully.
:::

### <font color="#1d50a2">MCLAG Interconnection with Enabled VRRP/VRRP6 FW Scenario</font>

1. Networking Requirements
   MCLAG interconnects with FW devices enabled for VRRP/VRRP6, and traffic is processed by the FW before being sent to other networks.
2. Topology

::Image[]{src="https://app.archbee.com/api/optimize/zl-MD6bX0o2Ab3p8w66u1/6ymI6IvcIDRikzPtZdR1H-20251128-085447.png" size="80" width="505" height="530" position="center" caption="Figure 11 MCLAG Interconnection With Enabled VRRP/VRRP6 FW Scenario Topology" showCaption="true"}

3. Configuration Roadmap
   (1) Switch A and Switch B are configured as an MCLAG pair.
   (2) FW A and FW B are configured with VRRP.
   (3) Switch A, Switch B, Switch C, and Switch D are configured with routing protocols.
4. Procedure
   **Switch A**
   Configure MCLAG.

```plaintext
sonic# configure terminal
sonic(config)# vlan range 1,1007-1008
sonic(config)# interface vlan 1
sonic(config-vlanif-1)# ip address 1.0.0.173/24
sonic(config-vlanif-1)# exit
sonic(config)# interface vlan 1007
sonic(config-vlanif-1007)# mac-address 60:eb:5a:00:01:07
sonic(config-vlanif-1007)# vrf 1007
sonic(config-vlanif-1007)# ip address 107.0.0.10/24
sonic(config-vlanif-1007)# ip address 107::10/64
sonic(config-vlanif-1007)# exit
sonic(config)# interface vlan 1008
sonic(config-vlanif-1008)# mac-address 60:eb:5a:00:01:08
sonic(config-vlanif-1008)# ip address 108.0.0.10/24
sonic(config-vlanif-1008)# ip address 108::10/64
sonic(config-vlanif-1008)# exit
sonic(config)# interface ethernet 0/2
sonic(config-if-0/2)# switchport trunk vlan 1
sonic(config-if-0/2)# switchport trunk vlan 1007
sonic(config-if-0/2)# switchport trunk vlan 1008
sonic(config-if-0/2)# exit
sonic(config)# interface link-aggregation 1007
sonic(config-lagif-1007)# switchport trunk vlan 1007
sonic(config-lagif-1007)# exit
sonic(config)# interface link-aggregation 1008
sonic(config-lagif-1008)# switchport trunk vlan 1008
sonic(config-lagif-1008)# exit
sonic(config)# interface link-aggregation 1009
sonic(config-lagif-1009)# switchport trunk vlan 1007
sonic(config-lagif-1009)# exit
sonic(config)# interface link-aggregation 1010
sonic(config-lagif-1010)# switchport trunk vlan 1008
sonic(config-lagif-1010)# exit
sonic(config)# interface ethernet 0/3
sonic(config-if-0/3)# link-aggregation-group 1007
sonic(config-if-0/3)# exit
sonic(config)# interface ethernet 0/4
sonic(config-if-0/4)# link-aggregation-group 1008
sonic(config-if-0/4)# exit
sonic(config)# interface ethernet 0/5
sonic(config-if-0/5)# link-aggregation-group 1009
sonic(config-if-0/5)# exit
sonic(config)# interface ethernet 0/6
sonic(config-if-0/6)# link-aggregation-group 1010
sonic(config-if-0/6)# exit
sonic(config)# mclag domain 1007
sonic(mclag-domain)# local-address 1.0.0.173
sonic(mclag-domain)# peer-address 1.0.0.132
sonic(mclag-domain)# peer-link ethernet 0/2
sonic(mclag-domain)# commit
sonic(mclag-domain)# member lag 1007
sonic(mclag-domain)# member lag 1008
sonic(mclag-domain)# member lag 1009
sonic(mclag-domain)# member lag 1010
sonic(mclag-domain)# exit
```

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

```plaintext
sonic# configure terminal
sonic(config)# router ospf
sonic(config-router)# ospf router-id 10.1.0.173
sonic(config-router)# exit
sonic(config)# router ospf6
sonic(config-ospf6)# ospf6 router-id 10.1.0.173
sonic(config-ospf6)# exit
sonic(config)# vrf 1007
sonic(config-vrf)# ip route 65.0.0.0/24 107.0.0.1
sonic(config-vrf)# ipv6 route 65::/64 107::1
sonic(config-vrf)# exit-vrf
sonic(config)# interface ethernet 0/0
sonic(config-if-0/0)# vrf 1007
sonic(config-if-0/0)# ip address 45.0.0.173/24
sonic(config-if-0/0)# ip address 45::173/24
sonic(config-if-0/0)# exit
sonic(config)# interface ethernet 0/1
sonic(config-if-0/1)# ip address 46.0.0.173/24
sonic(config-if-0/1)# ip address 46::173/64
sonic(config-if-0/1)# ip ospf area 1007
sonic(config-if-0/1)# ipv6 ospf6 area 1007
sonic(config-if-0/1)# exit
```

:::Paragraph{indent="1"}
**Switch B**
Configure MCLAG.
:::

```plaintext
sonic# configure terminal
sonic(config)# vlan range 1,1007-1008
sonic(config)# interface vlan 1
sonic(config-vlanif-1)# ip address 1.0.0.132/24
sonic(config-vlanif-1)# exit
sonic(config)# interface vlan 1007
sonic(config-vlanif-1007)# mac-address 60:eb:5a:00:01:07
sonic(config-vlanif-1007)# vrf 1007
sonic(config-vlanif-1007)# ip address 107.0.0.10/24
sonic(config-vlanif-1007)# ip address 107::10/64
sonic(config-vlanif-1007)# exit
sonic(config)# interface vlan 1008
sonic(config-vlanif-1008)# mac-address 60:eb:5a:00:01:08
sonic(config-vlanif-1008)# ip address 108.0.0.10/24
sonic(config-vlanif-1008)# ip address 108::10/64
sonic(config-vlanif-1008)# exit
sonic(config)# interface ethernet 0/40
sonic(config-if-0/40)# switchport trunk vlan 1
sonic(config-if-0/40)# switchport trunk vlan 1007
sonic(config-if-0/40)# switchport trunk vlan 1008
sonic(config-if-0/40)# exit
sonic(config)# interface link-aggregation 1007
sonic(config-lagif-1007)# switchport trunk vlan 1007
sonic(config-lagif-1007)# exit
sonic(config)# interface link-aggregation 1008
sonic(config-lagif-1008)# switchport trunk vlan 1008
sonic(config-lagif-1008)# exit
sonic(config)# interface link-aggregation 1009
sonic(config-lagif-1009)# switchport trunk vlan 1007
sonic(config-lagif-1009)# exit
sonic(config)# interface link-aggregation 1010
sonic(config-lagif-1010)# switchport trunk vlan 1008
sonic(config-lagif-1010)# exit
sonic(config)# interface ethernet 0/0
sonic(config-if-0/0)# link-aggregation-group 1010
sonic(config-if-0/0)# exit
sonic(config)# interface ethernet 0/41
sonic(config-if-0/41)# link-aggregation-group 1007
sonic(config-if-0/41)# exit
sonic(config)# interface ethernet 0/42
sonic(config-if-0/42)# link-aggregation-group 1009
sonic(config-if-0/42)# exit
sonic(config)# interface ethernet 0/43
sonic(config-if-0/43)# link-aggregation-group 1008
sonic(config-if-0/43)# exit
sonic(config)# mclag domain 1007
sonic(mclag-domain)# local-address 1.0.0.132
sonic(mclag-domain)# peer-address 1.0.0.173
sonic(mclag-domain)# peer-link ethernet 0/40
sonic(mclag-domain)# commit
sonic(mclag-domain)# member lag 1007
sonic(mclag-domain)# member lag 1008
sonic(mclag-domain)# member lag 1009
sonic(mclag-domain)# member lag 1010
sonic(mclag-domain)# exit
```

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

```plaintext
sonic# configure terminal
sonic(config)# vrf 1007
sonic(config-vrf)# ip route 65.0.0.0/24 107.0.0.1
sonic(config-vrf)# ipv6 route 65::/64 107::1
sonic(config-vrf)# exit-vrf
sonic(config)# router ospf
sonic(config-router)# ospf router-id 10.250.0.132
sonic(config-router)# exit
sonic(config)# router ospf6
sonic(config-ospf6)# ospf6 router-id 10.250.0.132
sonic(config-ospf6)# exit
sonic(config)# interface ethernet 0/44
sonic(config-if-0/44)# vrf 1007
sonic(config-if-0/44)# ip address 44.0.0.132/24
sonic(config-if-0/44)# ip address 44::132/64
sonic(config-if-0/44)# exit
sonic(config)# interface ethernet 0/45
sonic(config-if-0/45)# ip address 47.0.0.132/24
sonic(config-if-0/45)# ip address 47::132/64
sonic(config-if-0/45)# ip ospf area 1007
sonic(config-if-0/45)# ipv6 ospf6 area 1007
sonic(config-if-0/45)# exit
```

:::Paragraph{indent="1"}
**FW-A**
Configure VRRP.
:::

```plaintext
sonic# configure terminal
sonic(config)# vlan range 1007-1008
sonic(config)# interface link-aggregation 1007
sonic(config-lagif-1007)# switchport trunk vlan 1007
sonic(config-lagif-1007)# exit
sonic(config)# interface link-aggregation 1008
sonic(config-lagif-1008)# switchport trunk vlan 1008
sonic(config-lagif-1008)# exit
sonic(config)# interface ethernet 0/43
sonic(config-if-0/43)# link-aggregation-group 1007
sonic(config-if-0/43)# exit
sonic(config)# interface ethernet 0/44
sonic(config-if-0/44)# link-aggregation-group 1007
sonic(config-if-0/44)# exit
sonic(config)# interface ethernet 0/45
sonic(config-if-0/45)# link-aggregation-group 1008
sonic(config-if-0/45)# exit
sonic(config)# interface ethernet 0/47
sonic(config-if-0/47)# link-aggregation-group 1008
sonic(config-if-0/47)# exit
sonic(config)# interface vlan 1007
sonic(config-vlanif-1007)# vrf 1007
sonic(config-vlanif-1007)# ip address 107.0.0.20/24
sonic(config-vlanif-1007)# ip address 107::20/24
sonic(config-vlanif-1007)# vrrp 255
sonic(config-vlanif-1007)# vrrp 255 priority 120
sonic(config-vlanif-1007)# vrrp 255 ip 107.0.0.1/24
sonic(config-vlanif-1007)# vrrp6 100
sonic(config-vlanif-1007)# vrrp6 100 priority 120
sonic(config-vlanif-1007)# vrrp6 100 ipv6 107::1/64
sonic(config-vlanif-1007)# exit
```

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

```plaintext
sonic# configure terminal
sonic(config)# interface vlan 1008
sonic(config-vlanif-1008)# ip address 108.0.0.20/24
sonic(config-vlanif-1008)# ip address 108::20/64
sonic(config-vlanif-1008)# exit
sonic(config)# vrf 1007
sonic(config-vrf)# ip route 65.0.0.0/24 108.0.0.10 nexthop-vrf default
sonic(config-vrf)# ipv6 route 65::/64 108::10 nexthop-vrf default
sonic(config-vrf)# exit-vrf
```

:::Paragraph{indent="1"}
**FW-B**
Configure VRRP.
:::

```plaintext
sonic# configure terminal
sonic(config)# vlan range 1007-1008
sonic(config)# interface link-aggregation 1009
sonic(config-lagif-1009)# switchport trunk vlan 1007
sonic(config-lagif-1009)# exit
sonic(config)# interface link-aggregation 1010
sonic(config-lagif-1010)# switchport trunk vlan 1008
sonic(config-lagif-1010)# exit
sonic(config)# interface ethernet 0/7
sonic(config-if-0/7)# link-aggregation-group 1010
sonic(config-if-0/7)# exit
sonic(config)# interface ethernet 0/45
sonic(config-if-0/45)# link-aggregation-group 1009
sonic(config-if-0/45)# exit
sonic(config)# interface ethernet 0/46
sonic(config-if-0/46)# link-aggregation-group 1009
sonic(config-if-0/46)# exit
sonic(config)# interface ethernet 0/47
sonic(config-if-0/47)# link-aggregation-group 1010
sonic(config-if-0/47)# exit
sonic(config)# interface vlan 1007
sonic(config-vlanif-1007)# vrf 1007
sonic(config-vlanif-1007)# ip address 107.0.0.30/24
sonic(config-vlanif-1007)# ip address 107::30/64
sonic(config-vlanif-1007)# vrrp 255
sonic(config-vlanif-1007)# vrrp 255 ip 107.0.0.1/24
sonic(config-vlanif-1007)# vrrp6 100
sonic(config-vlanif-1007)# vrrp6 100 ipv6 107::1/64
sonic(config-vlanif-1007)# exit
```

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

```plaintext
sonic# configure terminal
sonic(config)# interface vlan 1008
sonic(config-vlanif-1008)# ip address 108.0.0.30/24
sonic(config-vlanif-1008)# ip address 108::30/64
sonic(config-vlanif-1008)# exit
sonic(config)# vrf 1007
sonic(config-vrf)# ip route 65.0.0.0/24 108.0.0.10 nexthop-vrf default
sonic(config-vrf)# ipv6 route 65::/64 108::10 nexthop-vrf default
sonic(config-vrf)# exit-vrf
```

:::Paragraph{indent="1"}
**Switch C**
Configure Route.
:::

```plaintext
sonic# configure terminal
sonic(config)# vrf 1007
sonic(config-vrf)# ip route 65.0.0.0/24 44.0.0.132
sonic(config-vrf)# ip route 65.0.0.0/24 45.0.0.173
sonic(config-vrf)# ipv6 route 65::/64 44::132
sonic(config-vrf)# ipv6 route 65::/64 45::173
sonic(config-vrf)# exit-vrf
sonic(config)# interface ethernet 0/44
sonic(config-if-0/44)# vrf 1007
sonic(config-if-0/44)# ip address 44.0.0.131/24
sonic(config-if-0/44)# ip address 44::131/64
sonic(config-if-0/44)# exit
sonic(config)# interface ethernet 0/45
sonic(config-if-0/45)# vrf 1007
sonic(config-if-0/45)# ip address 45.0.0.131/24
sonic(config-if-0/45)# ip address 45::131/64
sonic(config-if-0/45)# exit
sonic(config)# interface ethernet 0/64
sonic(config-if-0/64)# vrf 1007
sonic(config-if-0/64)# ip address 64.0.0.131/24
sonic(config-if-0/64)# ip address 64::131/64
sonic(config-if-0/64)# exit
```

:::Paragraph{indent="1"}
**Switch D**
Configure Route.
:::

```plaintext
sonic# configure terminal
sonic(config)# router ospf
sonic(config-router)# ospf router-id 10.250.0.131
sonic(config-router)# exit
sonic(config)# router ospf6
sonic(config-ospf6)# ospf6 router-id 10.250.0.131
sonic(config-ospf6)# exit
sonic(config)# interface ethernet 0/46
sonic(config-if-0/46)# ip address 46.0.0.131/24
sonic(config-if-0/46)# ip address 46::131/64
sonic(config-if-0/46)# ip ospf area 1007
sonic(config-if-0/46)# ipv6 ospf6 area 1007
sonic(config-if-0/46)# exit
sonic(config)# interface ethernet 0/47
sonic(config-if-0/47)# ip address 47.0.0.131/24
sonic(config-if-0/47)# ip address 47::131/64
sonic(config-if-0/47)# ip ospf area 1007
sonic(config-if-0/47)# ipv6 ospf6 area 1007
sonic(config-if-0/47)# exit
sonic(config)# interface ethernet 0/65
sonic(config-if-0/65)# ip address 65.0.0.131/24
sonic(config-if-0/65)# ip address 65::131/64
sonic(config-if-0/65)# ip ospf area 1007
sonic(config-if-0/65)# ipv6 ospf6 area 1007
sonic(config-if-0/65)# exit
```

5. Configure Verification

:::Paragraph{indent="1"}
(1) Configuration check
(2) Check VRRP status
:::

```plaintext
show vrrp
```

:::Paragraph{indent="1"}
(3) Check MCLAG status
:::

```plaintext
show mclag state
```

:::Paragraph{indent="1"}
(4) VM-A1 sends traffic to VM-B1, and VM-B1 can receive the traffic sent by VM-A1.
:::



