The set protocols vrrp interface vrid priority command sets the priority of the device in a VRRP group.
This command applies to both VRRPv2 and VRRPv3 configuration.
set protocols vrrp interface <interface-name> vrid <virtual-router-id> priority <priority-value>
Specifies the Layer 3 interface name of VRRP device. The value is a string.
Specifies the VRID of a VRRP group. The value is an integer that ranges from 1 to 254.
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. The default value is 100.
VRRP determines the device role in the VRRP group based on device priority and VLAN interface by exchanging VRRP advertisement packets. The device with a higher priority is more likely to become the master. If two devices have the same priority, the device with a larger VLAN interface IP address becomes the master.
The IP address owner's running priority is always 255, and no user configuration is required; the IP address owner always works in preemptive mode, regardless of whether the preemption function is enabled. If the VRRP device is the IP address owner, it will switch to the master state immediately after receiving the interface Up message.
For the backup device, if it has a higher priority than the master, the working mode of the backup (preemptive or non-preemptive) determines whether the master is re-selected.
- Preemptive mode: If the priority of the backup router is higher than the priority of the current master router, the backup router automatically becomes the master router.
- Non-preemptive mode: As long as the master router is working properly, the backup router with a higher priority cannot become the master router.
- Set the priority of the switch in VRRP group 2 to 150 on the VLAN interface.
admin@Xorplus# set protocols vrrp interface vlan100 vrid 2 priority 150 admin@Xorplus# commit