The vrrp command binds a virtual server to a VRRP group.
The undo vrrp command unbinds a virtual server from a VRRP group.
| Parameter | Description | Value |
|---|---|---|
| virtual-router-id | Specifies the VRRP group ID. | The value is an integer ranging from 1 to 255. |
SLB does not apply to load balancing scenarios in hot standby deployment. If the device works in active/standby mode or mirroring mode and the IP address of the virtual server is not on the same network segment as that of the VRRP group, you do not need to run this command. If these two IP addresses are on the same network segment, you need to run this command and set virtual-router-id to the ID of the VRRP group corresponding to the inbound interface.
Before changing the VRRP group to which a virtual server is bound, cancel the binding between the virtual and real servers. Then run the vrrp virtual-router-id command to bind the virtual server to a new VRRP group.
# Bind virtual server vs1 to VRRP group 1.
<sysname> system-view [sysname] slb [sysname-slb] vserver 1 vs1 [sysname-slb-vserver-1] vrrp 1
# Change the VRRP group to which virtual server vs1 is bound from VRRP group 1 to VRRP group 2.
<sysname> system-view [sysname] slb [sysname-slb] vserver 1 vs1 [sysname-slb-vserver-1] display this # vserver 0 test vip 0 10.1.1.20 protocol any group grp1 vrrp 1 # return [sysname-slb-vserver-1] undo group grp1 [sysname-slb-vserver-1] vrrp 2 [sysname-slb-vserver-1] group grp1 [sysname-slb-vserver-1] display this # vserver 0 test vip 0 10.1.1.20 protocol any group grp1 vrrp 2 # return