VRRP Configuration Guide
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
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
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
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
- 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
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
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
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
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 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)# exitConfigure VLAN and IP.
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)# exitConfigure VRRP.
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)# exitConfigure OSPF.
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)# exitSwitch B Configure MSTP.
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)# exitConfigure VLAN and IP.
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)# exitConfigure VRRP.
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)# exitConfigure OSPF.
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)# exitSwitch C Configure MSTP.
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/64Configure VLAN.
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)# exitSwitch D Configure IP.
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)# exitConfigure OSPF.
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- 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
- 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 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)# exitConfigure VRRP.
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)# exitConfigure Routing protocols.
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)# exitSwitch B Configure MCLAG.
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)# exitConfigure VRRP.
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)# exitConfigure Routing protocols.
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)# exitSwitch C Configure MCLAG.
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)# exitConfigure VRRP.
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)# exitConfigure Routing protocols.
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)# exitSwitch D Configure MCLAG.
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)# exitConfigure VRRP.
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)# exitConfigure Routing protocols.
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)# exitSwitch E
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)# exitSwitch F
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)# exitSwitch G
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)# exitSwitch H
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- 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
- 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 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)# exitConfigure Route.
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)# exitSwitch B Configure MCLAG.
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)# exitConfigure Route.
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)# exitFW-A Configure VRRP.
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)# exitConfigure Route.
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-vrfFW-B Configure VRRP.
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)# exitConfigure Route.
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-vrfSwitch C Configure Route.
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)# exitSwitch D Configure Route.
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- 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.