VRRP Configuration Guide
Introduction
Section titled “Introduction”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.
Basic Concepts
Section titled “Basic Concepts”Master Device
Section titled “Master Device”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.
Backup Device
Section titled “Backup Device”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.
VRRP Working Process
Section titled “VRRP Working Process”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.
VRRP Configuration
Section titled “VRRP Configuration”- This feature is only supported by the CX308P-48Y-N-V2 and CX532P-N-V2 models; other models are not currently supported.
VRRP Default Setting
Section titled “VRRP Default Setting”The default setting of VRRP is shown in the following table.
Table 1 Default setting of VRRP
| Parameters | Default value |
|---|---|
| Protocol Running Version | 3 |
| Message Announcement Interval | 1000ms |
| Preemption Mode | Enable |
| Priority | 100 |
| Checksum Calculation with IPv4 Packet Pseudo-header | Enable |
Configure VRRP Instance
Section titled “Configure VRRP Instance”Table 2 Configure VRRP Instance
| 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]|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 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 vrid 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 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. |
Display and Maintenance
Section titled “Display and Maintenance”Table 3 VRRP Display and Maintenance
| 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] | - |
Typical Configuration Example
Section titled “Typical Configuration Example”VRRP and MSTP Integrated Configuration Scenario
Section titled “VRRP and MSTP Integrated Configuration Scenario”- Networking Requirements SwitchA and SwitchB implement gateway redundancy through VRRP and eliminate Layer 2 loops through MSTP.
- Topology

- 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.
- Procedure Switch A Configure MSTP.
sonic# configure terminalsonic(config)# vlan 107sonic(config-vlan-107)# exitsonic(config)# mstp enablesonic(config)# mstp name test1sonic(config)# mstp instance 1sonic(config-mstp-instance-1)# vlan 107sonic(config-mstp-instance-1)# priority 0sonic(config-mstp-instance-1)# exitConfigure VLAN and IP.
sonic(config)# interface ethernet 0/128sonic(config-if-0/128)# switchport trunk vlan 107sonic(config-if-0/128)# exitsonic(config)# interface ethernet 0/129sonic(config-if-0/129)# switchport trunk vlan 107sonic(config-if-0/129)# exitsonic(config)# interface vlan 107sonic(config-vlanif-107)# ip address 107.0.0.171/24sonic(config-vlanif-107)# ip address 107::171/64sonic(config-vlanif-107)# exitsonic(config)# interface ethernet 0/4sonic(config-if-0/4)# ip address 4.0.0.171/24sonic(config-if-0/4)# ip address 4::171/2464sonic(config-if-0/4)# exitConfigure VRRP.
sonic(config)# interface vlan 107sonic(config-vlanif-107)# vrrp 1 ip 107.0.0.1/24sonic(config-vlanif-107)# vrrp6 2 ipv6 107::1/64sonic(config-vlanif-107)# vrrp 1 priority 120sonic(config-vlanif-107)# vrrp6 2 priority 120sonic(config-vlanif-107)# vrrp 1 track-interface ethernet 0/4 priority-dec 50sonic(config-vlanif-107)# vrrp6 2 track-interface ethernet 0/4 priority-dec 50sonic(config-vlanif-107)# exitConfigure OSPF.
sonic(config)# router ospfsonic(config-router)# router-id 10.250.0.171sonic(config-router)# exitsonic(config)# router ospf6sonic(config-ospf6)# ospf6 router-id 10.250.0.171sonic(config-ospf6)# exitsonic(config)# interface vlan 107sonic(config-vlanif-107)# ip ospf area 107sonic(config-vlanif-107)# ipv6 ospf6 area 107sonic(config-vlanif-107)# exitsonic(config)# interface ethernet 0/4sonic(config-if-0/4)# ip ospf area 107sonic(config-if-0/4)# ipv6 ospf6 area 107sonic(config-if-0/4)# exitSwitch B Configure MSTP.
sonic# configure terminalsonic(config)# vlan 107sonic(config-vlan-107)# exitsonic(config)# mstp enablesonic(config)# mstp name test1sonic(config)# mstp instance 1sonic(config-mstp-instance-1)# vlan 107sonic(config-mstp-instance-1)# exitConfigure VLAN and IP.
sonic(config)# interface ethernet 0/0sonic(config-if-0/0)# switchport trunk vlan 107sonic(config-if-0/0)# exitsonic(config)# interface ethernet 0/45sonic(config-if-0/45)# switchport trunk vlan 107sonic(config-if-0/45)# exitsonic(config)# interface vlan 107sonic(config-vlanif-107)# ip address 107.0.0.173/24sonic(config-vlanif-107)# ip address 107::173/64sonic(config-vlanif-107)# exitsonic(config)# interface ethernet 0/46sonic(config-if-0/46)# ip address 46.0.0.173/24sonic(config-if-0/46)# ip address 46::173/24sonic(config-if-0/46)# exitConfigure VRRP.
sonic(config)# interface vlan 107sonic(config-vlanif-107)# vrrp 1 ip 107.0.0.1/24sonic(config-vlanif-107)# vrrp6 2 ipv6 107::1/64sonic(config-vlanif-107)# exitConfigure OSPF.
sonic(config)# router ospfsonic(config-router)# ospf router-id 10.250.0.173sonic(config-router)# exitsonic(config)# router ospf6sonic(config-ospf6)# router ospf6 vrf 1007sonic(config-ospf6)# ospf6 router-id 10.250.0.173sonic(config-ospf6)# exitsonic(config)# interface vlan 107sonic(config-vlanif-107)# ip ospf area 107sonic(config-vlanif-107)# ipv6 ospf6 area 107sonic(config-vlanif-107)# exitsonic(config)# interface ethernet 0/46sonic(config-if-0/46)# ip ospf area 107sonic(config-if-0/46)# ipv6 ospf6 area 107sonic(config-if-0/46)# exitSwitch C Configure MSTP.
sonic# configure terminalsonic(config)# vlan 107sonic(config-vlan-107)# exitsonic(config)# mstp enablesonic(config)# mstp name test1sonic(config)# mstp instance 1sonic(config-mstp-instance-1)# vlan 107sonic(config-mstp-instance-1)# exitsonic(config)# mstp edge-port enable interface ethernet 0/64Configure VLAN.
sonic(config)# interface ethernet 0/64sonic(config-if-0/64)# switchport access vlan 107sonic(config-if-0/64)# exitsonic(config)# interface ethernet 0/47sonic(config-if-0/47)# switchport trunk vlan 107sonic(config-if-0/47)# exitsonic(config)# interface ethernet 0/45sonic(config-if-0/45)# switchport trunk vlan 107sonic(config-if-0/45)# exitSwitch D Configure IP.
sonic(config)# interface ethernet 0/76sonic(config-if-0/76)# ip address 4.0.0.131/24sonic(config-if-0/76)# ip address 4::131/64sonic(config-if-0/76)# exitsonic(config)# interface ethernet 0/46sonic(config-if-0/46)# ip address 46.0.0.131/24sonic(config-if-0/46)# ip address 46::131/64sonic(config-if-0/46)# exitsonic(config)# interface ethernet 0/65sonic(config-if-0/65)# ip address 65.0.0.131/24sonic(config-if-0/65)# ip address 65::131/64sonic(config-if-0/65)# exitConfigure OSPF.
sonic(config)# router ospfsonic(config-router)# ospf router-id 10.250.0.131sonic(config-router)# exitsonic(config)# router ospf6sonic(config-ospf6)# ospf6 router-id 10.250.0.131sonic(config-ospf6)# exitsonic(config)# interface ethernet 0/76sonic(config-if-0/76)# ip ospf area 107sonic(config-if-0/76)# ipv6 ospf6 area 107sonic(config-if-0/76)# exitsonic(config)# interface ethernet 0/46sonic(config-if-0/46)# ip ospf area 107sonic(config-if-0/46)# ipv6 ospf6 area 107sonic(config-if-0/46)# exitsonic(config)# interface ethernet 0/65sonic(config-if-0/65)# ip ospf area 107sonic(config-if-0/65)# ipv6 ospf6 area 107sonic(config-if-0/65)# end- Configure Verification
(1) Configuration check (2) Check VRRP/VRRP6 status
show vrrp/vrrp6(3) Check MSTP status
show mstp(4) VM-A1’s gateway is configured with the VRRP address, and it can ping VM-B1 successfully.
MC-LAG Device Configuration with VRRP Scenari
Section titled “MC-LAG Device Configuration with VRRP Scenari”- 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.
- Topology

- 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.
- Procedure Switch A Configure MCLAG.
sonic# configure terminalsonic(config)# vlan range 1,1007sonic(config)# interface vlan 1sonic(config-vlanif-1)# ip address 1.0.0.173/24sonic(config-vlanif-1)# exitsonic(config)# interface vlan 1007sonic(config-vlanif-1007)# mac-address 60:eb:5a:00:01:07sonic(config-vlanif-1007)# ip address 107.0.0.10/24sonic(config-vlanif-1007)# exitsonic(config)# interface ethernet 0/1sonic(config-if-0/1)# switchport trunk vlan 1sonic(config-if-0/1)# switchport trunk vlan 1007sonic(config-if-0/1)# exitsonic(config)# interface link-aggregation 1007sonic(config-lagif-1007)# switchport trunk vlan 1007sonic(config-lagif-1007)# exitsonic(config)# interface ethernet 0/0sonic(config-if-0/0)# link-aggregation-group 1007sonic(config-if-0/0)# exitsonic(config)# mclag domain 1007sonic(mclag-domain)# local-address 1.0.0.173sonic(mclag-domain)# peer-address 1.0.0.174sonic(mclag-domain)# peer-link ethernet 0/1sonic(mclag-domain)# commitsonic(mclag-domain)# member lag 1007sonic(mclag-domain)# exitConfigure VRRP.
sonic# configure terminalsonic(config)# interface vlan 1007sonic(config-vlanif-1007)# vrrp 255sonic(config-vlanif-1007)# vrrp 255 priority 120sonic(config-vlanif-1007)# vrrp 255 track-interface ethernet 0/2 priority-dec 50sonic(config-vlanif-1007)# vrrp 255 ip 107.0.0.1/24sonic(config-vlanif-1007)# exitConfigure Routing protocols.
sonic# configure terminalsonic(config)# router ospfsonic(config-router)# ospf router-id 10.1.0.173sonic(config-router)# exitsonic(config)# interface ethernet 0/2sonic(config-if-0/2)# ip address 2.0.0.173/24sonic(config-if-0/2)# ip ospf area 1007sonic(config-if-0/2)# exitsonic(config)# interface vlan 1007sonic(config-vlanif-1007)# ip ospf area 1007sonic(config-vlanif-1007)# exitSwitch B Configure MCLAG.
sonic# configure terminalsonic(config)# vlan range 1,1007sonic(config)# interface vlan 1sonic(config-vlanif-1)# ip address 1.0.0.174/24sonic(config-vlanif-1)# exitsonic(config)# interface vlan 1007sonic(config-vlanif-1007)# mac-address 60:eb:5a:00:01:07sonic(config-vlanif-1007)# ip address 107.0.0.10/24sonic(config-vlanif-1007)# exitsonic(config)# interface ethernet 0/1sonic(config-if-0/1)# switchport trunk vlan 1sonic(config-if-0/1)# switchport trunk vlan 1007sonic(config-if-0/1)# exitsonic(config)# interface link-aggregation 1007sonic(config-lagif-1007)# switchport trunk vlan 1007sonic(config-lagif-1007)# exitsonic(config)# interface ethernet 0/46sonic(config-if-0/46)# link-aggregation-group 1007sonic(config-if-0/46)# exitsonic(config)# mclag domain 1007sonic(mclag-domain)# local-address 1.0.0.174sonic(mclag-domain)# peer-address 1.0.0.173sonic(mclag-domain)# peer-link ethernet 0/1sonic(mclag-domain)# commitsonic(mclag-domain)# member lag 1007sonic(mclag-domain)# exitConfigure VRRP.
sonic# configure terminalsonic(config)# interface vlan 1007sonic(config-vlanif-1007)# vrrp 255sonic(config-vlanif-1007)# vrrp 255 priority 120sonic(config-vlanif-1007)# vrrp 255 track-interface ethernet 0/0 priority-dec 50sonic(config-vlanif-1007)# vrrp 255 ip 107.0.0.1/24sonic(config-vlanif-1007)# exitConfigure Routing protocols.
sonic# configure terminalsonic(config)# router ospfsonic(config-router)# ospf router-id 10.250.0.174sonic(config-router)# exitsonic(config)# interface ethernet 0/0sonic(config-if-0/0)# ip address 46.0.0.174/24sonic(config-if-0/0)# ip ospf area 1007sonic(config-if-0/0)# exitsonic(config)# interface vlan 1007sonic(config-vlanif-1007)# ip ospf area 1007sonic(config-vlanif-1007)# exitSwitch C Configure MCLAG.
sonic# configure terminalsonic(config)# vlan range 1,1007sonic(config)# interface vlan 1sonic(config-vlanif-1)# ip address 1.0.0.132/24sonic(config-vlanif-1)# exitsonic(config)# interface vlan 1007sonic(config-vlanif-1007)# mac-address 60:eb:5a:00:01:08sonic(config-vlanif-1007)# ip address 107.0.0.20/24sonic(config-vlanif-1007)# exitsonic(config)# interface ethernet 0/45sonic(config-if-0/45)# switchport trunk vlan 1sonic(config-if-0/45)# switchport trunk vlan 1007sonic(config-if-0/45)# exitsonic(config)# interface link-aggregation 1007sonic(config-lagif-1007)# switchport trunk vlan 1007sonic(config-lagif-1007)# exitsonic(config)# interface ethernet 0/44sonic(config-if-0/44)# link-aggregation-group 1007sonic(config-if-0/44)# exitsonic(config)# mclag domain 107sonic(mclag-domain)# local-address 1.0.0.132sonic(mclag-domain)# peer-address 1.0.0.180sonic(mclag-domain)# peer-link ethernet 0/45sonic(mclag-domain)# commitsonic(mclag-domain)# member lag 1007sonic(mclag-domain)# exitConfigure VRRP.
sonic# configure terminalsonic(config)# interface vlan 1007sonic(config-vlanif-1007)# vrrp 255sonic(config-vlanif-1007)# vrrp 255 ip 107.0.0.1/24sonic(config-vlanif-1007)# exitConfigure Routing protocols.
sonic# configure terminalsonic(config)# router ospfsonic(config-router)# ospf router-id 10.250.0.132sonic(config-router)# exitsonic(config)# interface ethernet 0/0sonic(config-if-0/0)# ip address 7.0.0.132/24sonic(config-if-0/0)# ip ospf area 1007sonic(config-if-0/0)# exitsonic(config)# interface vlan 1007sonic(config-vlanif-1007)# ip ospf area 1007sonic(config-vlanif-1007)# exitSwitch D Configure MCLAG.
sonic# configure terminalsonic(config)# vlan range 1,1007sonic(config)# interface vlan 1sonic(config-vlanif-1)# ip address 1.0.0.180/24sonic(config-vlanif-1)# exitsonic(config)# interface vlan 1007sonic(config-vlanif-1007)# mac-address 60:eb:5a:00:01:08sonic(config-vlanif-1007)# ip address 107.0.0.20/24sonic(config-vlanif-1007)# exitsonic(config)# interface ethernet 0/40sonic(config-if-0/40)# switchport trunk vlan 1sonic(config-if-0/40)# switchport trunk vlan 1007sonic(config-if-0/40)# exitsonic(config)# interface link-aggregation 1007sonic(config-lagif-1007)# switchport trunk vlan 1007sonic(config-lagif-1007)# exitsonic(config)# interface ethernet 0/42sonic(config-if-0/42)# link-aggregation-group 1007sonic(config-if-0/42)# exitsonic(config)# mclag domain 107sonic(mclag-domain)# local-address 1.0.0.180sonic(mclag-domain)# peer-address 1.0.0.132sonic(mclag-domain)# peer-link ethernet 0/40sonic(mclag-domain)# commitsonic(mclag-domain)# member lag 1007sonic(mclag-domain)# exitConfigure VRRP.
sonic# configure terminalsonic(config)# interface vlan 1007sonic(config-vlanif-1007)# vrrp 255sonic(config-vlanif-1007)# vrrp 255 ip 107.0.0.1/24sonic(config-vlanif-1007)# exitConfigure Routing protocols.
sonic# configure terminalsonic(config)# router ospfsonic(config-router)# ospf router-id 10.250.0.180sonic(config-router)# exitsonic(config)# interface ethernet 0/38sonic(config-if-0/38)# ip address 47.0.0.180/24sonic(config-if-0/38)# ip ospf area 1007sonic(config-if-0/38)# exitsonic(config)# interface vlan 1007sonic(config-vlanif-1007)# ip ospf area 1007sonic(config-vlanif-1007)# exitSwitch E
sonic# configure terminalsonic(config)# vlan range 1007sonic(config)# interface link-aggregation 1007sonic(config-lagif-1007)# switchport trunk vlan 1007sonic(config-lagif-1007)# exitsonic(config)# interface ethernet 0/45sonic(config-if-0/45)# link-aggregation-group 1007sonic(config-if-0/45)# exitsonic(config)# interface ethernet 0/46sonic(config-if-0/46)# link-aggregation-group 1007sonic(config-if-0/46)# exitsonic(config)# interface ethernet 0/44sonic(config-if-0/44)# switchport trunk vlan 1007sonic(config-if-0/44)# exitSwitch F
sonic# configure terminalsonic(config)# vlan range 1007sonic(config)# interface ethernet 0/44sonic(config-if-0/44)# link-aggregation-group 1007sonic(config-if-0/44)# exitsonic(config)# interface ethernet 0/47sonic(config-if-0/47)# link-aggregation-group 1007sonic(config-if-0/47)# exitsonic(config)# interface link-aggregation 1007sonic(config-lagif-1007)# switchport trunk vlan 1007sonic(config-lagif-1007)# exitsonic(config)# interface ethernet 0/7sonic(config-if-0/7)# switchport trunk vlan 1007sonic(config-if-0/7)# exitSwitch G
sonic# configure terminalsonic(config)# interface ethernet 0/8sonic(config-if-0/8)# switchport trunk vlan 1007sonic(config-if-0/8)# exitsonic(config)# interface ethernet 0/9sonic(config-if-0/9)# switchport trunk vlan 1007sonic(config-if-0/9)# exitsonic(config)# interface ethernet 0/72sonic(config-if-0/72)# switchport access vlan 1007sonic(config-if-0/72)# exitSwitch H
sonic# configure terminalsonic(config)# interface ethernet 0/7sonic(config-if-0/7)# ip address 7.0.0.133/24sonic(config-if-0/7)# ip ospf area 1007sonic(config-if-0/7)# exitsonic(config)# interface ethernet 0/45sonic(config-if-0/45)# ip address 2.0.0.133/24sonic(config-if-0/45)# ip ospf area 1007sonic(config-if-0/45)# exitsonic(config)# interface ethernet 0/46sonic(config-if-0/46)# ip address 46.0.0.133/24sonic(config-if-0/46)# ip ospf area 1007sonic(config-if-0/46)# exitsonic(config)# interface ethernet 0/47sonic(config-if-0/47)# ip address 47.0.0.133/24sonic(config-if-0/47)# ip ospf area 1007sonic(config-if-0/47)# exitsonic(config)# interface ethernet 0/73sonic(config-if-0/73)# ip address 73.0.0.133/24sonic(config-if-0/73)# ip ospf area 1007sonic(config-if-0/73)# exit- Configure Verification
(1) Configuration check (2) Check VRRP status
show vrrp(3) Check MCLAG status
show mclag state(4) VM-A1’s gateway is configured with the VRRP address, and it can ping VM-B1 successfully.
MCLAG Interconnection with Enabled VRRP/VRRP6 FW Scenario
Section titled “MCLAG Interconnection with Enabled VRRP/VRRP6 FW Scenario”- Networking Requirements MCLAG interconnects with FW devices enabled for VRRP/VRRP6, and traffic is processed by the FW before being sent to other networks.
- Topology

- 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.
- Procedure Switch A Configure MCLAG.
sonic# configure terminalsonic(config)# vlan range 1,1007-1008sonic(config)# interface vlan 1sonic(config-vlanif-1)# ip address 1.0.0.173/24sonic(config-vlanif-1)# exitsonic(config)# interface vlan 1007sonic(config-vlanif-1007)# mac-address 60:eb:5a:00:01:07sonic(config-vlanif-1007)# vrf 1007sonic(config-vlanif-1007)# ip address 107.0.0.10/24sonic(config-vlanif-1007)# ip address 107::10/64sonic(config-vlanif-1007)# exitsonic(config)# interface vlan 1008sonic(config-vlanif-1008)# mac-address 60:eb:5a:00:01:08sonic(config-vlanif-1008)# ip address 108.0.0.10/24sonic(config-vlanif-1008)# ip address 108::10/64sonic(config-vlanif-1008)# exitsonic(config)# interface ethernet 0/2sonic(config-if-0/2)# switchport trunk vlan 1sonic(config-if-0/2)# switchport trunk vlan 1007sonic(config-if-0/2)# switchport trunk vlan 1008sonic(config-if-0/2)# exitsonic(config)# interface link-aggregation 1007sonic(config-lagif-1007)# switchport trunk vlan 1007sonic(config-lagif-1007)# exitsonic(config)# interface link-aggregation 1008sonic(config-lagif-1008)# switchport trunk vlan 1008sonic(config-lagif-1008)# exitsonic(config)# interface link-aggregation 1009sonic(config-lagif-1009)# switchport trunk vlan 1007sonic(config-lagif-1009)# exitsonic(config)# interface link-aggregation 1010sonic(config-lagif-1010)# switchport trunk vlan 1008sonic(config-lagif-1010)# exitsonic(config)# interface ethernet 0/3sonic(config-if-0/3)# link-aggregation-group 1007sonic(config-if-0/3)# exitsonic(config)# interface ethernet 0/4sonic(config-if-0/4)# link-aggregation-group 1008sonic(config-if-0/4)# exitsonic(config)# interface ethernet 0/5sonic(config-if-0/5)# link-aggregation-group 1009sonic(config-if-0/5)# exitsonic(config)# interface ethernet 0/6sonic(config-if-0/6)# link-aggregation-group 1010sonic(config-if-0/6)# exitsonic(config)# mclag domain 1007sonic(mclag-domain)# local-address 1.0.0.173sonic(mclag-domain)# peer-address 1.0.0.132sonic(mclag-domain)# peer-link ethernet 0/2sonic(mclag-domain)# commitsonic(mclag-domain)# member lag 1007sonic(mclag-domain)# member lag 1008sonic(mclag-domain)# member lag 1009sonic(mclag-domain)# member lag 1010sonic(mclag-domain)# exitConfigure Route.
sonic# configure terminalsonic(config)# router ospfsonic(config-router)# ospf router-id 10.1.0.173sonic(config-router)# exitsonic(config)# router ospf6sonic(config-ospf6)# ospf6 router-id 10.1.0.173sonic(config-ospf6)# exitsonic(config)# vrf 1007sonic(config-vrf)# ip route 65.0.0.0/24 107.0.0.1sonic(config-vrf)# ipv6 route 65::/64 107::1sonic(config-vrf)# exit-vrfsonic(config)# interface ethernet 0/0sonic(config-if-0/0)# vrf 1007sonic(config-if-0/0)# ip address 45.0.0.173/24sonic(config-if-0/0)# ip address 45::173/24sonic(config-if-0/0)# exitsonic(config)# interface ethernet 0/1sonic(config-if-0/1)# ip address 46.0.0.173/24sonic(config-if-0/1)# ip address 46::173/64sonic(config-if-0/1)# ip ospf area 1007sonic(config-if-0/1)# ipv6 ospf6 area 1007sonic(config-if-0/1)# exitSwitch B Configure MCLAG.
sonic# configure terminalsonic(config)# vlan range 1,1007-1008sonic(config)# interface vlan 1sonic(config-vlanif-1)# ip address 1.0.0.132/24sonic(config-vlanif-1)# exitsonic(config)# interface vlan 1007sonic(config-vlanif-1007)# mac-address 60:eb:5a:00:01:07sonic(config-vlanif-1007)# vrf 1007sonic(config-vlanif-1007)# ip address 107.0.0.10/24sonic(config-vlanif-1007)# ip address 107::10/64sonic(config-vlanif-1007)# exitsonic(config)# interface vlan 1008sonic(config-vlanif-1008)# mac-address 60:eb:5a:00:01:08sonic(config-vlanif-1008)# ip address 108.0.0.10/24sonic(config-vlanif-1008)# ip address 108::10/64sonic(config-vlanif-1008)# exitsonic(config)# interface ethernet 0/40sonic(config-if-0/40)# switchport trunk vlan 1sonic(config-if-0/40)# switchport trunk vlan 1007sonic(config-if-0/40)# switchport trunk vlan 1008sonic(config-if-0/40)# exitsonic(config)# interface link-aggregation 1007sonic(config-lagif-1007)# switchport trunk vlan 1007sonic(config-lagif-1007)# exitsonic(config)# interface link-aggregation 1008sonic(config-lagif-1008)# switchport trunk vlan 1008sonic(config-lagif-1008)# exitsonic(config)# interface link-aggregation 1009sonic(config-lagif-1009)# switchport trunk vlan 1007sonic(config-lagif-1009)# exitsonic(config)# interface link-aggregation 1010sonic(config-lagif-1010)# switchport trunk vlan 1008sonic(config-lagif-1010)# exitsonic(config)# interface ethernet 0/0sonic(config-if-0/0)# link-aggregation-group 1010sonic(config-if-0/0)# exitsonic(config)# interface ethernet 0/41sonic(config-if-0/41)# link-aggregation-group 1007sonic(config-if-0/41)# exitsonic(config)# interface ethernet 0/42sonic(config-if-0/42)# link-aggregation-group 1009sonic(config-if-0/42)# exitsonic(config)# interface ethernet 0/43sonic(config-if-0/43)# link-aggregation-group 1008sonic(config-if-0/43)# exitsonic(config)# mclag domain 1007sonic(mclag-domain)# local-address 1.0.0.132sonic(mclag-domain)# peer-address 1.0.0.173sonic(mclag-domain)# peer-link ethernet 0/40sonic(mclag-domain)# commitsonic(mclag-domain)# member lag 1007sonic(mclag-domain)# member lag 1008sonic(mclag-domain)# member lag 1009sonic(mclag-domain)# member lag 1010sonic(mclag-domain)# exitConfigure Route.
sonic# configure terminalsonic(config)# vrf 1007sonic(config-vrf)# ip route 65.0.0.0/24 107.0.0.1sonic(config-vrf)# ipv6 route 65::/64 107::1sonic(config-vrf)# exit-vrfsonic(config)# router ospfsonic(config-router)# ospf router-id 10.250.0.132sonic(config-router)# exitsonic(config)# router ospf6sonic(config-ospf6)# ospf6 router-id 10.250.0.132sonic(config-ospf6)# exitsonic(config)# interface ethernet 0/44sonic(config-if-0/44)# vrf 1007sonic(config-if-0/44)# ip address 44.0.0.132/24sonic(config-if-0/44)# ip address 44::132/64sonic(config-if-0/44)# exitsonic(config)# interface ethernet 0/45sonic(config-if-0/45)# ip address 47.0.0.132/24sonic(config-if-0/45)# ip address 47::132/64sonic(config-if-0/45)# ip ospf area 1007sonic(config-if-0/45)# ipv6 ospf6 area 1007sonic(config-if-0/45)# exitFW-A Configure VRRP.
sonic# configure terminalsonic(config)# vlan range 1007-1008sonic(config)# interface link-aggregation 1007sonic(config-lagif-1007)# switchport trunk vlan 1007sonic(config-lagif-1007)# exitsonic(config)# interface link-aggregation 1008sonic(config-lagif-1008)# switchport trunk vlan 1008sonic(config-lagif-1008)# exitsonic(config)# interface ethernet 0/43sonic(config-if-0/43)# link-aggregation-group 1007sonic(config-if-0/43)# exitsonic(config)# interface ethernet 0/44sonic(config-if-0/44)# link-aggregation-group 1007sonic(config-if-0/44)# exitsonic(config)# interface ethernet 0/45sonic(config-if-0/45)# link-aggregation-group 1008sonic(config-if-0/45)# exitsonic(config)# interface ethernet 0/47sonic(config-if-0/47)# link-aggregation-group 1008sonic(config-if-0/47)# exitsonic(config)# interface vlan 1007sonic(config-vlanif-1007)# vrf 1007sonic(config-vlanif-1007)# ip address 107.0.0.20/24sonic(config-vlanif-1007)# ip address 107::20/24sonic(config-vlanif-1007)# vrrp 255sonic(config-vlanif-1007)# vrrp 255 priority 120sonic(config-vlanif-1007)# vrrp 255 ip 107.0.0.1/24sonic(config-vlanif-1007)# vrrp6 100sonic(config-vlanif-1007)# vrrp6 100 priority 120sonic(config-vlanif-1007)# vrrp6 100 ipv6 107::1/64sonic(config-vlanif-1007)# exitConfigure Route.
sonic# configure terminalsonic(config)# interface vlan 1008sonic(config-vlanif-1008)# ip address 108.0.0.20/24sonic(config-vlanif-1008)# ip address 108::20/64sonic(config-vlanif-1008)# exitsonic(config)# vrf 1007sonic(config-vrf)# ip route 65.0.0.0/24 108.0.0.10 nexthop-vrf defaultsonic(config-vrf)# ipv6 route 65::/64 108::10 nexthop-vrf defaultsonic(config-vrf)# exit-vrfFW-B Configure VRRP.
sonic# configure terminalsonic(config)# vlan range 1007-1008sonic(config)# interface link-aggregation 1009sonic(config-lagif-1009)# switchport trunk vlan 1007sonic(config-lagif-1009)# exitsonic(config)# interface link-aggregation 1010sonic(config-lagif-1010)# switchport trunk vlan 1008sonic(config-lagif-1010)# exitsonic(config)# interface ethernet 0/7sonic(config-if-0/7)# link-aggregation-group 1010sonic(config-if-0/7)# exitsonic(config)# interface ethernet 0/45sonic(config-if-0/45)# link-aggregation-group 1009sonic(config-if-0/45)# exitsonic(config)# interface ethernet 0/46sonic(config-if-0/46)# link-aggregation-group 1009sonic(config-if-0/46)# exitsonic(config)# interface ethernet 0/47sonic(config-if-0/47)# link-aggregation-group 1010sonic(config-if-0/47)# exitsonic(config)# interface vlan 1007sonic(config-vlanif-1007)# vrf 1007sonic(config-vlanif-1007)# ip address 107.0.0.30/24sonic(config-vlanif-1007)# ip address 107::30/64sonic(config-vlanif-1007)# vrrp 255sonic(config-vlanif-1007)# vrrp 255 ip 107.0.0.1/24sonic(config-vlanif-1007)# vrrp6 100sonic(config-vlanif-1007)# vrrp6 100 ipv6 107::1/64sonic(config-vlanif-1007)# exitConfigure Route.
sonic# configure terminalsonic(config)# interface vlan 1008sonic(config-vlanif-1008)# ip address 108.0.0.30/24sonic(config-vlanif-1008)# ip address 108::30/64sonic(config-vlanif-1008)# exitsonic(config)# vrf 1007sonic(config-vrf)# ip route 65.0.0.0/24 108.0.0.10 nexthop-vrf defaultsonic(config-vrf)# ipv6 route 65::/64 108::10 nexthop-vrf defaultsonic(config-vrf)# exit-vrfSwitch C Configure Route.
sonic# configure terminalsonic(config)# vrf 1007sonic(config-vrf)# ip route 65.0.0.0/24 44.0.0.132sonic(config-vrf)# ip route 65.0.0.0/24 45.0.0.173sonic(config-vrf)# ipv6 route 65::/64 44::132sonic(config-vrf)# ipv6 route 65::/64 45::173sonic(config-vrf)# exit-vrfsonic(config)# interface ethernet 0/44sonic(config-if-0/44)# vrf 1007sonic(config-if-0/44)# ip address 44.0.0.131/24sonic(config-if-0/44)# ip address 44::131/64sonic(config-if-0/44)# exitsonic(config)# interface ethernet 0/45sonic(config-if-0/45)# vrf 1007sonic(config-if-0/45)# ip address 45.0.0.131/24sonic(config-if-0/45)# ip address 45::131/64sonic(config-if-0/45)# exitsonic(config)# interface ethernet 0/64sonic(config-if-0/64)# vrf 1007sonic(config-if-0/64)# ip address 64.0.0.131/24sonic(config-if-0/64)# ip address 64::131/64sonic(config-if-0/64)# exitSwitch D Configure Route.
sonic# configure terminalsonic(config)# router ospfsonic(config-router)# ospf router-id 10.250.0.131sonic(config-router)# exitsonic(config)# router ospf6sonic(config-ospf6)# ospf6 router-id 10.250.0.131sonic(config-ospf6)# exitsonic(config)# interface ethernet 0/46sonic(config-if-0/46)# ip address 46.0.0.131/24sonic(config-if-0/46)# ip address 46::131/64sonic(config-if-0/46)# ip ospf area 1007sonic(config-if-0/46)# ipv6 ospf6 area 1007sonic(config-if-0/46)# exitsonic(config)# interface ethernet 0/47sonic(config-if-0/47)# ip address 47.0.0.131/24sonic(config-if-0/47)# ip address 47::131/64sonic(config-if-0/47)# ip ospf area 1007sonic(config-if-0/47)# ipv6 ospf6 area 1007sonic(config-if-0/47)# exitsonic(config)# interface ethernet 0/65sonic(config-if-0/65)# ip address 65.0.0.131/24sonic(config-if-0/65)# ip address 65::131/64sonic(config-if-0/65)# ip ospf area 1007sonic(config-if-0/65)# ipv6 ospf6 area 1007sonic(config-if-0/65)# exit- Configure Verification
(1) Configuration check (2) Check VRRP status
show vrrp(3) Check MCLAG status
show mclag state(4) VM-A1 sends traffic to VM-B1, and VM-B1 can receive the traffic sent by VM-A1.