03 VRRP Configuration
03 VRRP Configuration
Table of Contents
i
Operation Manual – VRRP
H3C S9500 Series Routing Switches Chapter 1 VRRP Configuration
When configuring VRRP, go to these sections for information you are interested in:
z Introduction to VRRP
z Configuring VRRP
z Displaying and Debugging VRRP
z VRRP Configuration Examples
z Troubleshooting VRRP
Network
Switch
10.100.10.1
Ethernet
VRRP, designed for LANs with multicast and broadcast capabilities (such as Ethernet)
settles the above problem. VRRP integrates a group of LAN switches (including a
Master and several Backups) into a virtual router. The diagram below is taken as an
example to explain how VRRP works.
1-1
Operation Manual – VRRP
H3C S9500 Series Routing Switches Chapter 1 VRRP Configuration
Network
Master Backup
This virtual router has its own IP address: 10.100.10.1 (which can be the interface
address of a switch within the virtual router). The switches within the virtual router have
their own IP addresses (such as 10.100.10.2 for the Master switch and 10.100.10.3 for
the Backup switch). The hosts on the LAN only know the IP address of this virtual router
10.100.10.1 (usually called as virtual IP address of the virtual router), but not the
specific IP addresses 10.100.10.2 of the Master switch and 10.100.10.3 of the Backup
switch. A default route with the next hop 10.100.10.1 is configured on the hosts.
Therefore, hosts within the network will communicate with the external network through
this virtual router. If the Master switch in the virtual group breaks down, another Backup
switch will function as the new Master switch to continue serving the hosts without any
interruption.
1-2
Operation Manual – VRRP
H3C S9500 Series Routing Switches Chapter 1 VRRP Configuration
This task is to enable/disable the function of pinging the IP address of the virtual router.
With this function enabled, you can ping the virtual IP address of the virtual router or
telnet to the virtual IP address of the virtual router.
Perform the following configuration in system view to enable/disable the ping function:
By default, the ping function is enabled, that is, you can ping or telnet to the virtual IP
address of the virtual router.
You should enable the ping function before configuring the virtual router. If VRRP is
already configured on the switch, it is not allowed to modify the configuration.
This task is to enable/disable the TTL value check for VRRP packets on the backup
switch. The TTL value must be 225. If the backup switch finds the TTL of a VRRP
packet is not 225, the packet will be discarded.
Perform the following configuration in VLAN interface view to enable/disable the TTL
value check for VRRP packets:
1.2.3 Configuring the Mapping Mode between Virtual IP Address and MAC
Address
This task is to configure the mapping mode between virtual lP address and MAC
address. In VRRP, the virtual IP address of the virtual router corresponds to the virtual
MAC address, to ensure correct data forwarding.
Depending on the chips installed, some switches support mapping one virtual IP
address to multiple MAC addresses.
S9500 series not only guarantee correct data forwarding in the subnet, but also allow
you to specify a mapping mode, either virtual IP address to real MAC address mapping
or virtual IP address to virtual MAC address mapping.
Perform the following configuration in system view to configure IP-to-MAC mappings:
1-3
Operation Manual – VRRP
H3C S9500 Series Routing Switches Chapter 1 VRRP Configuration
By default, the virtual IP address of the virtual router corresponds to the virtual MAC
address.
You should perform this configuration only before configuring the virtual router.
The status of each switch in the virtual router will be determined by its priority in VRRP.
The switch with the highest priority will become the master.
Perform the following configuration in VLAN interface view to configure a priority for the
switch in the virtual router:
1-4
Operation Manual – VRRP
H3C S9500 Series Routing Switches Chapter 1 VRRP Configuration
The priority ranges from 0 to 255. The greater the number, the higher the priority.
However the value can only be taken from 1 to 254. The priority 0 is reserved for special
use and priority 255 is reserved for the IP address owner by the system.
By default, the priority is 100.
Note:
The priority for IP address owner is always 255, which cannot be configured.
Once a switch in the VRRP group becomes the master, as long as it still functions
properly, other switches, even configured with a higher priority later, cannot become the
master unless they are configured to work in preemption mode. The switch in
preemption mode will become the master switch, when it finds its own priority is higher
than that of the current master switch. Accordingly, the former master switch will
become a backup switch.
Together with the preemption setting, a delay can also be set. In this way, a backup will
wait for a period of time before becoming the new master. In an unstable network if the
backup switch has not received the packets from the master switch punctually, it will
become the master switch. However, the receiving failure may be due to network
congestion, instead of the malfunction of the master switch. In this case, the backup will
receive the packets after a while. The delay setting can thereby avoid the frequent
status changing.
Perform the following configuration in VLAN interface view to configure preemption and
delay for a switch within a virtual router:
1-5
Operation Manual – VRRP
H3C S9500 Series Routing Switches Chapter 1 VRRP Configuration
The delay in seconds ranges from 0 to 255. By default, the preemption mode is enabled
with a delay of 0 seconds.
Note:
If preemption mode is disabled, the delay will automatically become 0 seconds.
1-6
Operation Manual – VRRP
H3C S9500 Series Routing Switches Chapter 1 VRRP Configuration
Note:
The same authentication type and authentication key should be configured for all VLAN
interfaces that belong to the virtual router.
1.2.8 Configuring the Interval for Sending VRRP Packets on the Master
The master switch advertises its normal operation state to the backup switch by
sending VRRP packets regularly (at adver-interval). And the backup switch only
receives VRRP packets. If the backup has not received any VRRP packet from the
master within a period of time (specified by master-down-interval), it will consider the
master as down, and then take its place and become the Master.
You can use the following command to set a timer and adjust the interval (adver-interval)
at which Master transmits VRRP packets. The master-down-interval of the Backup
switch is three times that of the adver-interval. The excessive network traffic or the
differences between different switch timers will result in master-down-interval timing out
and state changing abnormally. Such problems can be solved through prolonging the
adver-interval and preemption delay time. adver-interval is measured in seconds.
Perform the following configuration in VLAN interface view to configure the interval for
the master to send VRRP packets:
By default, adver-interval is 1.
Note:
You must configure the same interval for switches within the VRRP group.
The VRRP interface track function extends the function of a VRRP group. It enables
redundancy between VRRP interfaces, and between other switch interfaces.
You can use the following command to track a specified interface on the master switch.
If the interface is down, the priority of the switch will reduce automatically by the value
1-7
Operation Manual – VRRP
H3C S9500 Series Routing Switches Chapter 1 VRRP Configuration
specified by value-reduced. Then the backup switch with the highest priority becomes
the new master.
Perform the following configuration in VLAN interface view to configure the switch to
track a specified interface:
Note:
z If the switch is an IP address owner, its interfaces cannot be tracked.
z If the interface is up again, the corresponding priority of the switch, will be restored
automatically.
z On each virtual router, a maximum of eight interfaces can be tracked.
This task allows you to configure the backup VRRP device to monitor the link to the
master. When the monitored link goes down, the backup device immediately switches
to the master state.
The monitored link can be an Ethernet interface, or a manual aggregation group or
static aggregation group.
If the monitored link is an Ethernet interface, the backup device immediately switches
to the master state when the link goes down; if the monitored link is an aggregation
group, the backup device switches to the master state after all the ports in the
aggregation group go down.
1-8
Operation Manual – VRRP
H3C S9500 Series Routing Switches Chapter 1 VRRP Configuration
Caution:
z Before you configure VRRP link monitoring, it is required that no physical loop exists
and the spanning tree protocol (STP) is not enabled on the network.
z If all the physical links in between are down, the backup device considers that the
master device is down, and then the backup device switches to the master state. At
this time, two master devices may exist, and you need to ensure communication
through networking.
z Make sure that all the links between the master and backup devices are monitored.
Perform the following configuration in VLAN interface view to configure the switch to
monitor a specified link:
Note:
z When you configure the device to monitor a specified interface, the interface cannot
belong to any aggregation group (including dynamic aggregation groups).
z After you configure the device to monitor an aggregation group, the aggregation
group cannot be removed directly.
z You cannot configure the device to monitor multiple links.
z After you configure the device to monitor a specified link, you need to use a board
that supports reporting connection failures and configure the link-status hold 0
command globally to meet the performance requirements.
As a special card on softswitch devices, the IP forwarding module (IFM) is the portal of
softswitch, which is used to distribute IP signals. The disconnection with the IFM means
the termination of softswitch; therefore, the reliability of IFM has great importance.
1-9
Operation Manual – VRRP
H3C S9500 Series Routing Switches Chapter 1 VRRP Configuration
As shown in Figure 1-3, the two Layer 3 switches form a VRRP group. Each switch is
enabled to track the status of the corresponding IFM device through the OAM module.
When receiving signals from the IFM device, the priority of the corresponding interface
on a switch will increase by the value specified by value-increased. The switch with a
higher priority becomes the master. When the link of the master is down, the priority will
decrease by a specified value. As a result, the backup will have a higher priority and
become the master switch. Thus, the cooperation between IFM and VRRP through
OAM is implemented.
Perform the following configuration in VLAN interface view to enable/disable IFM
tracking:
In VRRP, a backup device can switch to the master state after the specified timer
expires. This mechanism causes delay in state switching and is not applicable to
network environments that require fast state switching because it may interrupt traffic
temporarily. To solve this problem, S9500 series switches support the fast switch
function for the virtual router.
z If the uplink virtual interface tracked by the master goes down, the master device
immediately decreases its priority and sends an advertisement packet.
z Upon receiving the advertisement packet, the backup device compares the priority
in the packet with that of its own. If the backup device has a higher priority, it
switches to the master state immediately.
1-10
Operation Manual – VRRP
H3C S9500 Series Routing Switches Chapter 1 VRRP Configuration
Perform the following configuration in VLAN interface view to enable/disable the fast
switch function for a virtual router:
1-11
Operation Manual – VRRP
H3C S9500 Series Routing Switches Chapter 1 VRRP Configuration
I. Network requirements
Host A takes the VRRP virtual router containing switch A and switch B as its default
gateway to access host B on the Internet.
It is required that:
z The virtual router ID is 1;
z The virtual IP address is 202.38.160.111;
z Switch A is the master and switch B is the backup:
z Preemption is allowed.
Host B
10.2.3.1
Internet
VLAN-
- interface3: 10.100.10.2
Switch_B
Switch_A
Virtual IP address:
VLAN- interface2: 202.38.160.1 VLAN- interface2: 202.38.160.2
202.38.160.111
202.38.160.3
Host A
1) Configure switch A
# Configure VLAN 2.
[LSW-A] vlan 2
[LSW-A-vlan2] interface vlan 2
[LSW-A-vlan-interface2] ip address 202.38.160.1 255.255.255.0
[LSW-A-vlan-interface2] quit
# Configure VRRP.
[LSW-A] vrrp ping-enable
[LSW-A] interface vlan 2
[LSW_A-vlan-interface2] vrrp vrid 1 virtual-ip 202.38.160.111
1-12
Operation Manual – VRRP
H3C S9500 Series Routing Switches Chapter 1 VRRP Configuration
# Configure VRRP.
[LSW-B] vrrp ping-enable
[LSW-B] interface vlan 2
[LSW-B-vlan-interface2] vrrp vrid 1 virtual-ip 202.38.160.111
[LSW-B-vlan-interface2] vrrp vrid 1 preempt-mode
The virtual router can be used soon after configuration. Host A can be configured with
the default gateway 202.38.160.111.
Under normal conditions, switch A functions as the gateway. Once switch A breaks
down, switch B will function as the gateway instead.
Configure the preemption mode for switch A, so that it can become the master again
after recovery.
I. Network requirements
See Figure 1-4. If the interface of switch A connected to the Internet is down, switch B
should function as the gateway. This can be implemented by tracking the
corresponding interface.
The virtual router ID is 1. In addition, the MD5 authentication and VRRP packet sending
interval are configured.
1) Configure switch A
# Configure VLAN2.
[LSW-A] vlan 2
[LSW-A-vlan2] interface vlan 2
[LSW-A-vlan-interface2] ip address 202.38.160.1 255.255.255.0
[LSW-A-vlan-interface2] quit
# Enable the function to ping the virtual IP address of the virtual router.
1-13
Operation Manual – VRRP
H3C S9500 Series Routing Switches Chapter 1 VRRP Configuration
# Set the authentication mode and authentication key for the virtual router.
[LSW_A-vlan-interface2] vrrp vrid 1 authentication-mode md5 switch
# Track VLAN-interface 3.
[LSW_A-vlan-interface2] vrrp vrid 1 track interface vlan-interface 3 reduced
30
2) Configure switch B
# Configure VLAN2.
[LSW-B] vlan 2
[LSW-B-vlan2] interface vlan 2
[LSW-B-vlan-interface2] ip address 202.38.160.2 255.255.255.0
[LSW-B-vlan-interface2] quit
# Enable the function to ping the virtual IP address of the virtual router.
[H3CLSW-B] vrrp ping-enable
# Set the authentication mode and authentication key for the virtual router.
[LSW_B-vlan-interface2] vrrp vrid 1 authentication-mode md5 switch
I. Network requirements
1-14
Operation Manual – VRRP
H3C S9500 Series Routing Switches Chapter 1 VRRP Configuration
z No physical loops exist between Switch A, Switch B and Host Server, and STP is
not enabled.
z Switch A is the master while Switch B is the backup. No physical link is available
between Switch A and Host Server.
Normally, Switch A acts as the gateway. The traffic sent from Host Server is forwarded
at Layer 2 through Switch B to Switch A which then forwards the traffic at Layer 3 to the
IP network.
It is required to configure Switch B to monitor the link to Switch A. If Switch A fails or the
link between Switch A and Switch B fails, Switch B becomes the master and acts as the
gateway instead of Switch A. Then, the traffic from Host Server is forwarded to the IP
network directly through Switch B. The state switching delay should be in milliseconds.
1) Configure Switch A
# Configure VLAN 2.
<LSW-A> system-view
[LSW-A] vlan 2
[LSW-A-vlan2] interface vlan 2
[LSW-A-vlan-interface2] ip address 10.1.1.1 255.255.255.0
[LSW-A-vlan-interface2] quit
1-15
Operation Manual – VRRP
H3C S9500 Series Routing Switches Chapter 1 VRRP Configuration
I. Network requirements
1-16
Operation Manual – VRRP
H3C S9500 Series Routing Switches Chapter 1 VRRP Configuration
1) Configure Switch A
# Configure VLAN 2.
[Switch A] vlan 2
[Switch A-vlan2] interface vlan-interface 2
[Switch A-Vlan-interface2] ip address 202.38.160.1 255.255.255.0
[Switch A-Vlan-interface2] quit
# Enable OAM.
[Switch A] Ethernet3/1/1
[Switch A-Ethernet3/1/1] oam ethernet mode passive
[Switch A-Ethernet3/1/1] oam ethernet enable
[Switch A-Ethernet3/1/1] quit
# Enable the function of pinging the virtual IP address of the virtual router.
[Switch A] vrrp ping-enable
# Set the authentication mode and authentication key for the virtual router.
[Switch A-Vlan-interface2] vrrp vrid 1 authentication-mode md5 switch
# Enable OAM.
[Switch B] Ethernet3/1/1
[Switch B-Ethernet3/1/1] oam ethernet mode passive
[Switch B-Ethernet3/1/1] oam ethernet enable
[Switch B-Ethernet3/1/1] quit
# Enable the function to ping the virtual IP address of the virtual router.
[Switch B] vrrp ping-enable
1-17
Operation Manual – VRRP
H3C S9500 Series Routing Switches Chapter 1 VRRP Configuration
# Set the authentication mode and authentication key for the virtual router.
[Switch B-Vlan-interface2] vrrp vrid 1 authentication-mode md5 switch
Note:
Switch A acts as the gateway in normal cases. When Switch B tracks the state of the
IFM device being Master through OAM, the priority of Switch B will be increased by 10,
greater than that of Switch A (105), and Switch B will turn the Master and act as the
gateway.
I. Network requirements
A switch can function as a backup switch for multiple virtual routers to implement load
balancing. See Figure 1-4. For example, Switch A, the master switch of virtual router 1,
can be the backup switch for virtual router 2, and Switch B can be the backup switch for
virtual router 1. Some hosts employ virtual router 1 as the gateway, while others employ
virtual router 2 as the gateway. In this way, both load balancing and backup are
implemented.
1) Configure switch A
# Configure VLAN2.
[LSW-A] vlan 2
[LSW-A-vlan2] interface vlan 2
[LSW-A-vlan-interface2] ip address 202.38.160.1 255.255.255.0
1-18
Operation Manual – VRRP
H3C S9500 Series Routing Switches Chapter 1 VRRP Configuration
Note:
Multiple virtual routers are often used in actual network applications.
This indicates that incorrect VRRP packets have been received. It may be because of
the inconsistent configuration of another switch within the virtual router, or the attempts
of some devices to send out illegal VRRP packets. The first possible fault can be solved
through modifying the configuration. And as the second possibility is caused by the
malicious attempt of some devices, non-technical measures should be resorted to.
II. Symptom 2: More than one Master existing within the same virtual router
There are also 2 reasons. One is short time coexistence of many master switches,
which is normal and needs no manual intervention. Another is the long time
coexistence of many Master switches, which may be because switches in the virtual
router cannot receive VRRP packets from each other, or receive some illegal packets.
To solve such problems, an attempt should be made to ping the master switches. If
such an attempt fails, check the device connectivity. If they can be pinged, check the
1-19
Operation Manual – VRRP
H3C S9500 Series Routing Switches Chapter 1 VRRP Configuration
VRRP configuration. For the configuration of the same VRRP virtual router, complete
consistency for the number of virtual IP addresses, each virtual IP address, timer
duration and authentication type must be guaranteed.
Such problem occurs when the virtual router timer duration is too short. So the problem
can be solved through prolonging this duration or the preemption delay.
1-20