< Home

vrrp vrid virtual-ip

Function

The vrrp vrid virtual-ip command creates a VRRP group and assigns a virtual IP address to the group.

The undo vrrp vrid virtual-ip command deletes the virtual IP address of a VRRP group.

By default, no VRRP group is created.

Format

vrrp vrid virtual-router-id virtual-ip virtual-address

undo vrrp vrid virtual-router-id [ virtual-ip virtual-address ]

Parameters

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.

virtual-ip virtual-address Specifies the virtual IP address of a VRRP group.

The value is in dotted decimal notation.

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

In practice, hosts use the default gateway to communicate with external networks. As value-added services such as IPTV or video conferencing services are widely deployed, hosts may fail to communicate with external networks if the default gateway fails. Configuring dynamic routing protocols such as RIP, OSPF, or ICMP can improve system reliability. However, it is difficult to configure dynamic routing protocols and some hosts may not support dynamic routing protocols. VRRP virtualizes multiple routing devices into a virtual router without changing the networking. The virtual router IP address is configured as the default gateway address.

If users on a network have the same reliability requirements, configure multiple virtual IP addresses for a VRRP group. By doing this, one virtual IP address serves one separate user group, and the default gateway address remains consistent regardless of changes in VRRP device locations. A VRRP group can be assigned a maximum of 16 virtual IP addresses.

Precautions

The MAC address of the VBDIF must differ from the virtual MAC address of the VRRP group. (The last two bits of the VRRP virtual MAC address are determined by the VRID. For example, The VRID of the virtual router composed of SwitchA and SwitchB is 3, so the MAC address of the VRRP group is 00-00-5E-00-01-03).

If all the virtual IP addresses in a VRRP group are deleted, the VRRP group is deleted automatically.

After the vrrp vrid virtual-ip command is run on an interface, when the ARP entries learned by the interface are aged, the device sends ARP aging probe packets with the source IP address being the interface's IP address. The virtual IP address of the interface is not used as the source IP address.

When VRRP and static ARP are configured simultaneously, note the following points:
  • When VRRP is configured on a VLANIF interface or Ethernet interface, the IP address corresponding to the VLANIF interface or Ethernet interface in a static ARP entry cannot be set to the virtual IP address of a VRRP group. Otherwise, services cannot be forwarded between devices. For example, if a static ARP entry contains IP address 10.1.1.1, the IP address 10.1.1.1 cannot be used as the virtual IP address.
  • When VRRP is configured on a VLANIF interface or Ethernet interface, the virtual IP address of a VRRP group cannot be used as the IP address corresponding to the VLANIF interface or Ethernet interface in a static ARP entry. Otherwise, services cannot be forwarded between devices. For example, if the VRRP group uses virtual IP address 10.1.1.1, the IP address 10.1.1.1 cannot be used in a static ARP entry.
  • VRRP groups must use different virtual IP addresses.
  • Two devices in a VRRP group must be configured with the same VRID.
  • VRRP groups on different interfaces of a device can be configured with the same VRID.
  • A virtual IP address must be different from the IP address of a user host. If the user host IP address is the same as the virtual IP address, all packets on the local network segment are sent to the user host. As a result, data of this network segment cannot be forwarded correctly.

Example

# Create a VRRP group on VLANIF 100 with ID 1 and virtual IP address 10.10.10.10.
<HUAWEI> system-view
[HUAWEI] interface vlanif 100
[HUAWEI-Vlanif100] vrrp vrid 1 virtual-ip 10.10.10.10
# Create a VRRP group with VRID 1 and virtual IP address 10.10.10.10 on GE0/0/1.
<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.10.10.10
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >