Skip to content
Ask AI

VRRP Configuration

[Command] show vrrp [ ID**] [interface {vlan** vlan_id**|ethernet** interface_num**|link-aggregation** lag_id**}]** show vrrp

[Purpose] View detailed information about the VRRP backup group

[View] System view

[Use Cases]

sonic# show vrrp 1
Virtual Router ID 1
Protocol Version 3
Autoconfigured No
Shutdown No
Interface Vlan10
VRRP interface (v4) vrrp4-1-1
VRRP interface (v6) None
Primary IP (v4) 10.1.1.1
Primary IP (v6) ::
Virtual MAC (v4) 00:00:5e:00:01:01
Virtual MAC (v6) 00:00:5e:00:02:01
Status (v4) Master
Status (v6) Initialize
Priority 100
Effective Priority (v4) 100
Effective Priority (v6) 100
Preempt Mode Yes
Accept Mode Yes
Advertisement Interval 1500 ms
Master Advertisement Interval (v4) 1500 ms
Master Advertisement Interval (v6) 0 ms
Advertisements Tx (v4) 2546
Advertisements Tx (v6) 0
Advertisements Rx (v4) 892
Advertisements Rx (v6) 0
Gratuitous ARP Tx (v4) 2
Neigh. Adverts Tx (v6) 0
State transitions (v4) 4
State transitions (v6) 0
Skew Time (v4) 910 ms
Skew Time (v6) 0 ms
Master Down Interval (v4) 5410 ms
Master Down Interval (v6) 0 ms
IPv4 Addresses 1
.................................. 10.1.1.11
IPv6 Addresses 0

[Command] show vrrp summary

[Purpose] View VRRP backup group information

[View] System view

[Use Cases]

sonic# show vrrp summary
Interface VRID Priority IPv4 IPv6 State (v4) State (v6)
----------------------------------------------------------------------
Vlan10 1 150 1 1 Master Master
Vlan10 2 30 1 1 Backup Backup

[Command] show vrrp default

[Purpose] View default configuration for VRRP backup group

[View] System view

[Use Cases]

sonic# show vrrp default
advertisement-interval Preempt mode Priority shutdown
--------------------------------------------------------------
1000 true 100 false

[Command] vrrp vrrp_ID [version version_ID]

[Purpose] Create a VRRP backup group and specify the VRRP version.

[View] Interface view

[Parameter]

ParameterDescription
vrrp_IDThe range of value is: 1-255
version_IDThe default value is 3

[Use Cases]

sonic(config)# interface ethernet 1
sonic(config-if-1)# vrrp 1 version 2

[Command] vrrp ID priority value

[Purpose] Configure the priority of the device in the VRRP backup group

[View] Interface view

[Parameter]

ParameterDescription
valueThe range of value is: 1-254, the default value is:100. Higher numbers indicate higher priority.

[Use Cases]

sonic(config)# interface ethernet 1
sonic(config-if-1)# vrrp 1 priority 20

[Command] vrrp ID advertisement-interval value

[Purpose] Configure the interval for sending VRRP advertisement packets

[View] Interface view

[Parameter]

ParameterDescription
value”The range is from 10 to 40950 milliseconds, default value is 1000 milliseconds

[Usage Scenario] The master device periodically sends VRRP advertisement packets to the backup devices within the group to notify them of its normal operation. If a backup device does not receive VRRP advertisement packets even after the Master_Down_Interval timer expires, a new master will be elected. When the master device voluntarily relinquishes its master status (such as when it leaves the backup group), it sends an advertisement packet with a priority of 0. This triggers a fast transition of the backup device to become the master, without waiting for the Master_Down_Interval timer to expire. The time taken for this transition is known as the Skew time, calculated as (256 - priority of the backup device) / 256, in centiseconds. When the master device encounters a network failure and cannot send advertisement packets, the backup device cannot immediately determine its working status. Only after the Master_Down_Interval timer expires will the backup device consider the master device as unable to function normally and switch its status to master. The Master_Down_Interval timer is set to 3×Advertisement_Interval + Skew_time, in centiseconds.

[Use Cases]

sonic(config)# interface ethernet 1
sonic(config-if-1)# vrrp 1 advertisement-interval 2500

[Command] vrrp ip A.B.C.D

[Purpose] Create a VRRP backup group and assign a virtual IP address to the backup group

[View] Interface view

[Usage Scenario] VRRP allows multiple devices to form a virtual switch without changing the network topology. By configuring the virtual switch as the gateway, it provides gateway redundancy

[Use Cases]

sonic(config)# interface ethernet 1
sonic(config-if-1)# vrrp 1 ip 192.168.0.1

[Command] vrrp ip send-gratuitous-arp interval value

[Purpose] Configure the interval for Master to send gratuitous ARP packets

[Parameter]

ParameterDescription
valueInterval,The range is from 10 to 600

[View] System view

[Usage Scenario] In a VRRP backup group, to ensure the MAC table entries on downstream switches are correct, the Master device periodically sends gratuitous ARP packets to refresh the MAC address table entries on the downstream switches

[Use Cases]

sonic(config)# vrrp ip send-gratuitous-arp interval 150

[Command] vrrp ID preempt

[Purpose] Configure the switch in VRRP backup group with preempt mode

[Parameter]

ParameterDescription
IDThe range is from 1 to 255

[View] VLAN view

[Usage Scenario] In an unstable network, the backup device may not always receive VRRP packets promptly, causing frequent VRRP state changes and network oscillations. To enhance the stability of the active/standby state, the user configures the switch in VRRP backup group with preempt mode

[Use Cases]

sonic(config-vlanif-10)# vrrp 1 preempt

[Command] vrrp shutdown

[Purpose] Configure the criteria for this backup group to withdraw from the VRRP election

[View] Interface view

[Usage Scenario] Configure the criteria for this backup group to withdraw from the VRRP election and set the interface’s VRRP state to ‘initial’.

[Use Cases]

sonic(config)# interface ethernet 1
sonic(config-if-1)# vrrp shutdown

[Command] ** vrrp default {advertisement-interval ** interval|preempt|priotiry ** value|shutdown}**

[Purpose] Configure default values for VRRP parameters

[View] System configuration view

[Usage Scenario] In the system configuration view, configure default information for VRRP backup groups. Once configured, all backup groups can use this configuration as default. If a backup group specifies specific parameters, those will take precedence over the default configuration.

[Use Cases]

sonic(config)# vrrp default priotiry 10