The vrrp vrid priority command sets the priority of the device in a VRRP group.
The undo vrrp vrid priority command restores the default priority of the device in a VRRP group.
By default, the priority of the device in a VRRP group is 100.
vrrp vrid virtual-router-id priority priority-value
undo vrrp vrid virtual-router-id priority
Parameter | Description | Value |
---|---|---|
vrid virtual-router-id | Specifies the VRID of a VRRP group. | The value is an integer that ranges from 1 to 255. |
priority priority-value | Specifies the priority of the device in a VRRP group. | The value is an integer that ranges from 1 to 254. A larger value indicates a higher priority. |
To configure the device in a VRRP group as the default gateway, run the vrrp vrid priority command to specify the highest priority for the device so that the device can become the master.
PrerequisitesThe vrrp vrid virtual-ip command has been executed to create a VRRP group.
PrecautionsPriority 0 is reserved in the system. Priority 255 is reserved for the IP address owner.
When devices in a VRRP group have the same priority, the device that first changes to master state becomes the master. If devices attempt to be the master simultaneously, the device where the interface with the largest IP address is located becomes the master.
<HUAWEI> system-view [HUAWEI] interface vlanif 100 [HUAWEI-Vlanif100] vrrp vrid 1 virtual-ip 10.1.1.2 [HUAWEI-Vlanif100] vrrp vrid 1 priority 150
<HUAWEI> system-view [HUAWEI] interface gigabitethernet 0/0/1 [HUAWEI-GigabitEthernet0/0/1] undo portswitch [HUAWEI-GigabitEthernet0/0/1] vrrp vrid 1 virtual-ip 10.1.1.2 [HUAWEI-GigabitEthernet0/0/1] vrrp vrid 1 priority 150