- Table of Contents
- Related Documents
-
| Title | Size | Download |
|---|---|---|
| 02-H3C S12500 VRRP Configuration Examples | 247.9 KB |
Example: Configuring a single VRRP group
Configuration restrictions and guidelines
Example: Configuring multiple VRRP groups
Configuration restrictions and guidelines
Example: Configuring VRRP load balancing
Configuration restrictions and guidelines
Introduction
This document provides VRRP configuration examples.
Prerequisites
This document is not restricted to specific software or hardware versions.
The configuration examples in this document were created and verified in a lab environment, and all the devices were started with the factory default configuration. When you are working on a live network, make sure you understand the potential impact of every command on your network.
This document assumes that you have basic knowledge of VRRP and STP.
Example: Configuring a single VRRP group
Network requirements
As shown in Figure 1, configure a VRRP group on Device A and Device B as the gateway for Host A to meet the following requirements:
· Device A operates as the master to forward packets from Host A to the external network.
· When Device A or its uplink interface fails, Host A can access the external network through Device B.

Requirements analysis
To meet the network requirements, you must perform the following tasks:
· For Device A to become the master when it recovers from a failure, configure the preemptive mode for the VRRP group.
· For Device A to decrease its priority and become a backup when its uplink interface fails, configure VRRP tracking on Device A.
· To avoid frequent role change in the VRRP group, configure a preemption delay.
Software version used
This configuration example was created and verified on S12500-CMW710-R7328P02.
Configuration restrictions and guidelines
When you configure a single VRRP group, follow these restrictions and guidelines:
· The virtual IP address of a VRRP group cannot be any of the following addresses:
¡ All-zero address (0.0.0.0).
¡ Broadcast address (255.255.255.255).
¡ Loopback address.
¡ IP address of other than Class A, Class B, and Class C.
¡ Invalid IP address (for example, 0.0.0.1).
· IPv4 VRRP can use VRRPv2 or VRRPv3 (default version). For a VRRP group to operate correctly, make sure the VRRP versions on all devices in the VRRP group are the same.
· Removal of the VRRP group on the IP address owner causes IP address collision. To avoid a collision, change the IP address of the interface on the IP address owner before you remove the VRRP group from the interface.
· Configure the same virtual IP addresses for each device in the VRRP group.
· Make sure the decreased priority of the master is lower than the priority of all the other devices in the VRRP group. Another device in the group can then be elected as the master.
Configuration procedures
1. Configure Device A:
# Configure the interface IP addresses.
[DeviceA] interface ten-gigabitethernet 3/0/1
[DeviceA-Ten-GigabitEthernet3/0/1] undo shutdown
[DeviceA-Ten-GigabitEthernet3/0/1] quit
[DeviceA] vlan 2
[DeviceA-vlan2] port ten-gigabitethernet 3/0/1
[DeviceA-vlan2] quit
[DeviceA] interface vlan-interface 2
[DeviceA-Vlan-interface2] undo shutdown
[DeviceA-Vlan-interface2] ip address 192.168.0.2 24
[DeviceA-Vlan-interface2] quit
[DeviceA] interface ten-gigabitethernet 3/0/2
[DeviceA-Ten-GigabitEthernet3/0/2] undo shutdown
[DeviceA-Ten-GigabitEthernet3/0/2] quit
[DeviceA] vlan 3
[DeviceA-vlan3] port ten-gigabitethernet 3/0/2
[DeviceA-vlan3] quit
[DeviceA] interface vlan-interface 3
[DeviceA-Vlan-interface3] undo shutdown
[DeviceA-Vlan-interface3] quit
# Create VRRP group 1, and set its virtual IP address to 192.168.0.1.
[DeviceA] interface vlan-interface 2
[DeviceA-Vlan-interface2] vrrp vrid 1 virtual-ip 192.168.0.1
# Assign Device A higher priority than Device B in VRRP group 1, so Device A can become the master.
[DeviceA-Vlan-interface2] vrrp vrid 1 priority 110
# Configure Device A to operate in preemptive mode, and set the preemption delay to 5 seconds.
[DeviceA-Vlan-interface2] vrrp vrid 1 preempt-mode delay 5
[DeviceA-Vlan-interface2] quit
# Create track entry 1 to monitor the upstream link status of VLAN-interface 3. When the upstream link fails, the track entry transits to Negative.
[DeviceA] track 1 interface vlan-interface 3
# Associate VRRP group 1 with track entry 1 to decrease the weight of Device A by 50 when the track entry transits to Negative.
[DeviceA] interface vlan-interface 2
[DeviceA-Vlan-interface2] vrrp vrid 1 track 1 reduced 50
[DeviceA-Vlan-interface2] quit
2. Configure Device B:
# Configure the interface IP addresses.
[DeviceB] interface ten-gigabitethernet 3/0/1
[DeviceB-Ten-GigabitEthernet3/0/1] undo shutdown
[DeviceB-Ten-GigabitEthernet3/0/1] quit
[DeviceB] vlan 2
[DeviceB-vlan2] port ten-gigabitethernet 3/0/1
[DeviceB-vlan2] quit
[DeviceB] interface vlan-interface 2
[DeviceB-Vlan-interface2] undo shutdown
[DeviceB-Vlan-interface2] ip address 192.168.0.3 24
# Create VRRP group 1, and set its virtual IP address to 192.168.0.1.
[DeviceB-Vlan-interface2] vrrp vrid 1 virtual-ip 192.168.0.1
# Assign a priority of 100 to Device B in VRRP group 1.
[DeviceB-Vlan-interface2] vrrp vrid 1 priority 100
# Configure Device B to operate in preemptive mode, and set the preemption delay to 5 seconds.
[DeviceB-Vlan-interface2] vrrp vrid 1 preempt-mode delay 5
[DeviceB-Vlan-interface2] quit
Verifying the configuration
# Ping Host B from Host A. (Details not shown.)
# Display detailed information about VRRP group 1 on Device A.
[DeviceA-Vlan-interface2] display vrrp verbose
IPv4 Virtual Router Information:
Running Mode : Standard
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 100
Admin Status : Up State : Master
Config Pri : 110 Running Pri : 110
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Virtual IP : 192.168.0.1
Virtual MAC : 0000-5e00-0101
Master IP : 192.168.0.2
VRRP Track Information:
Track Object : 1 State : Positive Pri Reduced : 50
# Display detailed information about VRRP group 1 on Device B.
[DeviceB-Vlan-interface2] display vrrp verbose
IPv4 Virtual Router Information:
Running Mode : Standard
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 100
Admin Status : Up State : Backup
Config Pri : 100 Running Pri : 100
Preempt Mode : Yes Delay Time : 5
Become Master : 401ms left
Auth Type : None
Virtual IP : 192.168.0.1
Master IP : 192.168.0.2
The output shows that Device A is operating as the master in VRRP group 1 to forward packets from Host A to Host B.
# Disconnect the link between Host A and Device A, and verify that Host A can still ping Host B. (Details not shown.)
# Display detailed information about VRRP group 1 on Device B.
[DeviceB-Vlan-interface2] display vrrp verbose
IPv4 Virtual Router Information:
Running Mode : Standard
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 100
Admin Status : Up State : Master
Config Pri : 100 Running Pri : 100
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Virtual IP : 192.168.0.1
Virtual MAC : 0000-5e00-0101
Master IP : 192.168.0.3
The output shows that when Device A fails, Device B takes over to forward packets from Host A to Host B.
# Recover the link between Host A and Device A, and display detailed information about VRRP group 1 on Device A.
[DeviceA-Vlan-interface2] display vrrp verbose
IPv4 Virtual Router Information:
Running Mode : Standard
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 100
Admin Status : Up State : Master
Config Pri : 110 Running Pri : 110
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Virtual IP : 192.168.0.1
Virtual MAC : 0000-5e00-0101
Master IP : 192.168.0.2
VRRP Track Information:
Track Object : 1 State : Positive Pri Reduced : 50
The output shows that after Device A resumes normal operation, it becomes the master to forward packets from Host A to Host B.
Configuration files
· Device A:
#
vlan 2
#
interface Vlan-interface2
ip address 192.168.0.1 255.255.255.0
vrrp vrid 1 virtual-ip 192.168.0.2
vrrp vrid 1 priority 110
vrrp vrid 1 preempt-mode delay 5
vrrp vrid 1 track 1 reduced 50
#
interface Ten-GigabitEthernet3/0/1
port link-mode bridge
port access vlan 2
#
track 1 interface ten-gigabitethernet 3/0/2
#
· Device B:
#
vlan 2
#
interface Vlan-interface2
ip address 192.168.0.1 255.255.255.0
vrrp vrid 1 virtual-ip 192.168.0.2
vrrp vrid 1 priority 100
vrrp vrid 1 preempt-mode delay 5
#
interface Ten-GigabitEthernet3/0/1
port link-mode bridge
port access vlan 2
#
Example: Configuring multiple VRRP groups
Network requirements
As shown in Figure 2, configure two VRRP groups on Device A and Device B as gateways for internal hosts to meet the following requirements:
· Device A operates as the master of VRRP group 1 to forward packets from area A, and Device B operates as the master of VRRP group 2 to forward packets from area B. When one of the devices fails, the other device provides gateway service for both areas.
· When the uplink interface of one device fails, hosts can access the external network through the other device.

Requirements analysis
To meet the network requirements, you must perform the following tasks:
· To avoid frequent role change in the VRRP group, configure a preemption delay.
· To avoid loops between Device A, Device B, and the Layer 2 switches, use the spanning tree feature to block a port in the two VRRP groups.
Software version used
This configuration example was created and verified on S12500-CMW710-R7328P02.
Configuration restrictions and guidelines
When you configure multiple VRRP groups, follow these restrictions and guidelines:
· The virtual IP address of a VRRP group cannot be any of the following addresses:
¡ All-zero address (0.0.0.0).
¡ Broadcast address (255.255.255.255).
¡ Loopback address.
¡ IP address of other than Class A, Class B, and Class C.
¡ Invalid IP address (for example, 0.0.0.1).
· IPv4 VRRP can use VRRPv2 or VRRPv3 (default version). For a VRRP group to operate correctly, make sure the VRRP versions on all devices in the VRRP group are the same.
· Removal of the VRRP group on the IP address owner causes IP address collision. To avoid a collision, change the IP address of the interface on the IP address owner before you remove the VRRP group from the interface.
· Make sure the decreased priority of the master is lower than the priority of all the other devices in the VRRP group. Another device in the group can then be elected as the master.
· Make sure the following configurations are the same on the members of a VRRP group:
¡ Number of virtual IP addresses.
¡ Virtual IP addresses.
¡ Advertisement interval.
Configuration procedures
1. Configure Device A:
# Configure interface IP addresses. (Take one interface as example. Configure other interfaces as shown in Figure 2 in the same way.)
<DeviceA> system-view
[DeviceA] interface ten-gigabitethernet 3/0/1
[DeviceA-Ten-GigabitEthernet3/0/1] undo shutdown
[DeviceA-Ten-GigabitEthernet3/0/1] quit
[DeviceA] vlan 101
[DeviceA-vlan101] port ten-gigabitethernet 3/0/1
[DeviceA-vlan101] quit
[DeviceA] interface vlan-interface 101
[DeviceA-Vlan-interface101] undo shutdown
[DeviceA-Vlan-interface101] ip address 10.0.0.2 24
[DeviceA-Vlan-interface101] quit
# Configure Ten-GigabitEthernet 3/0/24 as a trunk port and assign it to VLAN 101 and VLAN 102.
[DeviceA] interface ten-gigabitethernet 3/0/24
[DeviceA-Ten-GigabitEthernet3/0/24] port link-type trunk
[DeviceA-Ten-GigabitEthernet3/0/24] undo port trunk permit vlan 1
[DeviceA-Ten-GigabitEthernet3/0/24] port trunk permit vlan 101 to 102
[DeviceA-Ten-GigabitEthernet3/0/24] port trunk pvid vlan 101
[DeviceA-Ten-GigabitEthernet3/0/24] quit
# Disable the spanning tree feature on Ten-GigabitEthernet 3/0/2.
[DeviceA] interface ten-gigabitethernet 3/0/2
[DeviceA-Ten-GigabitEthernet3/0/2] undo stp enable
[DeviceA-Ten-GigabitEthernet3/0/2] quit
# Create VRRP group 1, and set its virtual IP address to 10.0.0.1. Assign Device A higher priority than Device B in VRRP group 1, so Device A can become the master.
[DeviceA] interface vlan-interface 101
[DeviceA-Vlan-interface101] vrrp vrid 1 virtual-ip 10.0.0.1
[DeviceA-Vlan-interface101] vrrp vrid 1 priority 120
[DeviceA-Vlan-interface101] quit
# Create VRRP group 2, and set its virtual IP address to 11.0.0.1.
[DeviceA] interface vlan-interface 102
[DeviceA-Vlan-interface102] vrrp vrid 2 virtual-ip 11.0.0.1
[DeviceA-Vlan-interface102] quit
# Configure Device A to operate in preemptive mode, and set the preemption delay to 5 seconds.
[DeviceA] interface vlan-interface 101
[DeviceA-Vlan-interface101] vrrp vrid 1 preempt-mode delay 5
[DeviceA-Vlan-interface101] quit
# Create track entry 1 to monitor the upstream link status of VLAN-interface 4094. When the upstream link fails, the track entry transits to Negative.
[DeviceA] track 1 interface vlan-interface 4094
# Associate VRRP group 1 with track entry 1 to decrease the weight of Device A by 50 when the track entry transits to Negative.
[DeviceA] interface vlan-interface 101
[DeviceA-Vlan-interface101] vrrp vrid 1 track 1 reduced 50
[DeviceA-Vlan-interface101] quit
# Configure MSTP, and map VLAN 101 to MSTI 1 and VLAN 102 to MSTI 2. Configure Device A as the root bridge of MSTI 1.
[DeviceA] stp region-configuration
[DeviceA-mst-region] region-name vrrp
[DeviceA-mst-region] instance 1 vlan 101
[DeviceA-mst-region] instance 2 vlan 102
[DeviceA-mst-region] active region-configuration
[DeviceA-mst-region] quit
[DeviceA] stp instance 1 root primary
[DeviceA] stp instance 2 root secondary
[DeviceA] stp global enable
2. Configure Device B:
# Configure interface IP addresses. (Take one interface as example. Configure other interfaces as shown in Figure 2 in the same way.)
<DeviceB> system-view
[DeviceB] interface ten-gigabitethernet 3/0/1
[DeviceB-Ten-GigabitEthernet3/0/1] undo shutdown
[DeviceB-Ten-GigabitEthernet3/0/1] quit
[DeviceB] vlan 101
[DeviceB-vlan101] port ten-gigabitethernet 3/0/1
[DeviceB-vlan101] quit
[DeviceB] interface vlan-interface 101
[DeviceB-Vlan-interface101] undo shutdown
[DeviceB-Vlan-interface101] ip address 10.0.0.3 24
[DeviceB-Vlan-interface101] quit
# Configure Ten-GigabitEthernet 3/0/24 as a trunk port and assign it to VLAN 101 and VLAN 102.
[DeviceB] interface ten-gigabitethernet 3/0/24
[DeviceB-Ten-GigabitEthernet3/0/24] port link-type trunk
[DeviceB-Ten-GigabitEthernet3/0/24] undo port trunk permit vlan 1
[DeviceB-Ten-GigabitEthernet3/0/24] port trunk permit vlan 101 to 102
[DeviceB-Ten-GigabitEthernet3/0/24] port trunk pvid vlan 101
[DeviceB-Ten-GigabitEthernet3/0/24] quit
# Disable the spanning tree feature on Ten-GigabitEthernet 3/0/2.
[DeviceB] interface ten-gigabitethernet 3/0/2
[DeviceB-Ten-GigabitEthernet3/0/2] undo stp enable
[DeviceB-Ten-GigabitEthernet3/0/2] quit
# Create VRRP group 1, and set its virtual IP address to 10.0.0.1.
[DeviceB] interface vlan-interface 101
[DeviceB-Vlan-interface101] vrrp vrid 1 virtual-ip 10.0.0.1
[DeviceB-Vlan-interface101] quit
# Create VRRP group 2, and set its virtual IP address to 11.0.0.1. Assign Device B higher priority than Device A in VRRP group 2, so Device B can become the master.
[DeviceB] interface vlan-interface 102
[DeviceB-Vlan-interface102] vrrp vrid 2 virtual-ip 11.0.0.1
[DeviceB-Vlan-interface102] vrrp vrid 2 priority 120
# Configure Device B to operate in preemptive mode, and set the preemption delay to 5 seconds.
[DeviceB-Vlan-interface102] vrrp vrid 2 preempt-mode delay 5
[DeviceB-Vlan-interface102] quit
# Create track entry 2 to monitor the upstream link status of VLAN-interface 4094. When the upstream link fails, the track entry transits to Negative.
[DeviceB] track 2 interface vlan-interface 4094
# Associate VRRP group 2 with track entry 2 to decrease the weight of Device A by 50 when the track entry transits to Negative.
[DeviceB] interface vlan-interface 102
[DeviceB-Vlan-interface102] vrrp vrid 2 track 2 reduced 50
[DeviceB-Vlan-interface102] quit
# Configure MSTP, and map VLAN 101 to MSTI 1 and VLAN 102 to MSTI 2. Configure Device B as the root bridge of MSTI 2.
[DeviceB] stp region-configuration
[DeviceB-mst-region] region-name vrrp
[DeviceB-mst-region] instance 1 vlan 101
[DeviceB-mst-region] instance 2 vlan 102
[DeviceB-mst-region] active region-configuration
[DeviceB-mst-region] quit
[DeviceB] stp instance 2 root primary
[DeviceB] stp instance 1 root secondary
[DeviceB] stp global enable
3. Configure L2SwitchA:
# Configure MSTP, and map VLAN 101 to MSTI 1. Activate the MST region configuration, and enable the spanning tree feature globally.
<L2SwitchA> system-view
[L2SwitchA] stp region-configuration
[L2SwitchA-mst-region] region-name vrrp
[L2SwitchA-mst-region] instance 1 vlan 101
[L2SwitchA-mst-region] active region-configuration
[L2SwitchA-mst-region] quit
[L2SwitchA] stp global enable
4. Configure L2SwitchB:
# Configure MSTP, and map VLAN 102 to MSTI 1. Activate the MST region configuration, and enable the spanning tree feature globally.
<L2SwitchB> system-view
[L2SwitchB] stp region-configuration
[L2SwitchB-mst-region] region-name vrrp
[L2SwitchB-mst-region] instance 1 vlan 102
[L2SwitchB-mst-region] active region-configuration
[L2SwitchB-mst-region] quit
[L2SwitchB] stp global enable
Verifying the configuration
1. Ping the external network to verify the network connectivity:
# Ping 100.0.0.1 from Host A in area A.
<host A> ping 100.0.0.1
PING 100.0.0.1 (100.0.0.1): 56 data bytes
56 bytes from 100.0.0.1: seq=0 ttl=128 time=22.43 ms
56 bytes from 100.0.0.1: seq=1 ttl=128 time=7.17 ms
56 bytes from 100.0.0.1: seq=2 ttl=128 time=8.91 ms
56 bytes from 100.0.0.1: seq=3 ttl=128 time=7.45 ms
56 bytes from 100.0.0.1: seq=4 ttl=128 time=9.11 ms
--- 100.0.0.1 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 7.17/11.01/22.43 ms
The output shows that Host A can ping the external network successfully.
# Ping 100.1.0.1 from Host C in area B.
<host C> ping 100.1.0.1
PING 100.1.0.1 (100.1.0.1): 56 data bytes
56 bytes from 100.1.0.1: seq=0 ttl=128 time=22.43 ms
56 bytes from 100.1.0.1: seq=1 ttl=128 time=7.17 ms
56 bytes from 100.1.0.1: seq=2 ttl=128 time=8.91 ms
56 bytes from 100.1.0.1: seq=3 ttl=128 time=7.45 ms
56 bytes from 100.1.0.1: seq=4 ttl=128 time=9.11 ms
--- 100.1.0.1 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 7.17/11.01/22.43 ms
The output shows that Host C can ping the external network successfully.
2. Verify the VRRP group configuration:
# Display detailed information about the VRRP groups on Device A.
[DeviceA] display vrrp verbose
IPv4 Virtual Router Information:
Running Mode : Standard
Total number of virtual routers : 2
Interface Vlan-interface101
VRID : 1 Adver Timer : 100
Admin Status : Up State : Master
Config Pri : 120 Running Pri : 120
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Virtual IP : 10.0.0.1
Virtual MAC : 0000-5e00-0101
Master IP : 10.0.0.2
VRRP Track Information:
Track Object : 1 State : Positive Pri Reduced : 50
Interface Vlan-interface102
VRID : 2 Adver Timer : 100
Admin Status : Up State : Backup
Config Pri : 100 Running Pri : 100
Preempt Mode : Yes Delay Time : 0
Auth Type : None
Virtual IP : 11.0.0.1
Master IP : 11.0.0.3
The output shows that Device A is operating as the master in VRRP group 1 and backup in VRRP group 2.
# Display detailed information about the VRRP groups on Device B.
[DeviceB] display vrrp verbose
IPv4 Virtual Router Information:
Running Mode : Standard
Total number of virtual routers : 2
Interface Vlan-interface101
VRID : 1 Adver Timer : 100
Admin Status : Up State : Backup
Config Pri : 100 Running Pri : 100
Preempt Mode : Yes Delay Time : 0
Auth Type : None
Virtual IP : 10.0.0.1
Master IP : 10.0.0.2
Interface Vlan-interface102
VRID : 2 Adver Timer : 100
Admin Status : Up State : Master
Config Pri : 120 Running Pri : 120
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Virtual IP : 11.0.0.1
Virtual MAC : 0000-5e00-0102
Master IP : 11.0.0.3
VRRP Track Information:
Track Object : 2 State : Positive Pri Reduced : 50
The output shows that Device B is operating as the backup in VRRP group 1 and master in VRRP group 2.
# When Device A fails, display detailed information about the VRRP groups on Device B.
[DeviceB] display vrrp verbose
IPv4 Virtual Router Information:
Running Mode : Standard
Total number of virtual routers : 2
Interface Vlan-interface101
VRID : 1 Adver Timer : 100
Admin Status : Up State : Master
Config Pri : 100 Running Pri : 100
Preempt Mode : Yes Delay Time : 0
Auth Type : None
Virtual IP : 10.0.0.1
Virtual MAC : 0000-5e00-0101
Master IP : 10.0.0.3
Interface Vlan-interface102
VRID : 2 Adver Timer : 100
Admin Status : Up State : Master
Config Pri : 120 Running Pri : 120
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Virtual IP : 11.0.0.1
Virtual MAC : 0000-5e00-0102
Master IP : 11.0.0.3
VRRP Track Information:
Track Object : 2 State : Positive Pri Reduced : 50
The output shows that Device B becomes the master in VRRP group 1. Hosts in area A and area B can still ping the external network successfully.
# When Device A recovers, display detailed information about the VRRP groups on Device A.
[DeviceA] display vrrp verbose
IPv4 Virtual Router Information:
Running Mode : Standard
Total number of virtual routers : 2
Interface Vlan-interface101
VRID : 1 Adver Timer : 100
Admin Status : Up State : Master
Config Pri : 120 Running Pri : 120
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Virtual IP : 10.0.0.1
Virtual MAC : 0000-5e00-0101
Master IP : 10.0.0.2
VRRP Track Information:
Track Object : 1 State : Positive Pri Reduced : 50
Interface Vlan-interface102
VRID : 2 Adver Timer : 100
Admin Status : Up State : Backup
Config Pri : 100 Running Pri : 100
Preempt Mode : Yes Delay Time : 0
Become Master : 3550ms left
Auth Type : None
Virtual IP : 11.0.0.1
Master IP : 11.0.0.3
The output shows that after Device A resumes normal operation, it becomes the master in VRRP group 1. Hosts in VLAN 101 access the external network through Device A.
Configuration files
· Device A:
#
vlan 101 to 102
#
vlan 4094
#
stp region-configuration
region-name vrrp
instance 1 vlan 101
instance 2 vlan 102
active region-configuration
#
stp instance 1 root primary
stp global enable
#
interface Vlan-interface101
ip address 10.0.0.2 255.255.255.0
vrrp vrid 1 virtual-ip 10.0.0.1
vrrp vrid 1 priority 120
vrrp vrid 1 track 1 reduced 50
#
interface Vlan-interface102
ip address 11.0.0.2 255.255.255.0
vrrp vrid 2 virtual-ip 11.0.0.1
#
interface Vlan-interface4094
ip address 100.0.0.2 255.255.255.0
#
interface Ten-GigabitEthernet3/0/1
port link-mode bridge
port access vlan 101
#
interface Ten-GigabitEthernet3/0/2
port link-mode bridge
port access vlan 4094
undo stp enable
#
interface Ten-GigabitEthernet3/0/3
port link-mode bridge
port access vlan 102
#
interface Ten-GigabitEthernet3/0/24
port link-mode bridge
port link-type trunk
undo port trunk permit vlan 1
port trunk permit vlan 101 to 102
port trunk pvid vlan 101
#
track 1 interface ten-gigabitethernet 3/0/2
#
· Device B:
#
vlan 101 to 102
#
vlan 4094
#
stp region-configuration
region-name vrrp
instance 1 vlan 101
instance 2 vlan 102
active region-configuration
#
stp instance 2 root primary
stp global enable
#
interface Vlan-interface101
ip address 10.0.0.3 255.255.255.0
vrrp vrid 1 virtual-ip 10.0.0.1
#
interface Vlan-interface102
ip address 11.0.0.3 255.255.255.0
vrrp vrid 2 virtual-ip 11.0.0.1
vrrp vrid 2 priority 120
vrrp vrid 2 track 2 reduced 50
#
interface Vlan-interface4094
ip address 100.1.0.2 255.255.255.0
#
interface Ten-GigabitEthernet3/0/1
port link-mode bridge
port access vlan 101
#
interface Ten-GigabitEthernet3/0/2
port link-mode bridge
port access vlan 4094
undo stp enable
#
interface Ten-GigabitEthernet3/0/3
port link-mode bridge
port access vlan 102
#
interface Ten-GigabitEthernet3/0/24
port link-mode bridge
port link-type trunk
undo port trunk permit vlan 1
port trunk permit vlan 101 to 102
port trunk pvid vlan 101
#
track 2 interface ten-gigabitethernet 3/0/2
#
Example: Configuring VRRP load balancing
Network requirements
As shown in Figure 3, configure a load-balanced VRRP group on Device A, Device B, and Device C as the gateway for the hosts to meet the following requirements:
· Packets from the hosts are load balanced among the devices.
· When one device fails, hosts can access the external network through the other devices.

Requirements analysis
To meet the network requirements, you must perform the following tasks:
· To avoid frequent role change in the VRRP group, configure a preemption delay.
· For traffic to be switched to the other two devices when the uplink interface of one device fails, configure VF tracking on Device A, Device B, and Device C. When the uplink interface of one device fails, the weights of the VFs (including the AVF) on the device decrease by a specified value.
· For the failed device to become the master when it recovers, configure the preemptive mode for the VRRP group.
Software version used
This configuration example was created and verified on S12500-CMW710-R7328P02.
Configuration restrictions and guidelines
When you configure VRRP load balancing, follow these restrictions and guidelines:
· The virtual IP address of a VRRP group cannot be any of the following addresses:
¡ All-zero address (0.0.0.0).
¡ Broadcast address (255.255.255.255).
¡ Loopback address.
¡ IP address of other than Class A, Class B, and Class C.
¡ Invalid IP address (for example, 0.0.0.1).
· IPv4 VRRP can use VRRPv2 or VRRPv3 (default version). For a VRRP group to operate correctly, make sure the VRRP versions on all devices in the VRRP group are the same.
· Removal of the VRRP group on the IP address owner causes IP address collision. To avoid a collision, change the IP address of the interface on the IP address owner before you remove the VRRP group from the interface.
· In load balancing mode, the virtual IP address of a VRRP group cannot be the IP address of any interface in the VRRP group. Otherwise, VRRP load balancing cannot operate correctly.
· When the upstream link of the VF owner fails, an LVF must take over as the AVF. The switchover occurs when the weight of the VF owner drops below the lower limit of failure. This requires the reduced weight for the VF owner to be higher than 245.
· Configure the same virtual IP addresses for each device in the VRRP group.
· Make sure the decreased priority of the master is lower than the priority of all the other devices in the VRRP group. Another device in the group can then be elected as the master.
Configuration procedures
Configuring Device A
1. Configure interface IP addresses:
<DeviceA> system-view
[DeviceA] interface ten-gigabitethernet 3/0/1
[DeviceA-Ten-GigabitEthernet3/0/1] undo shutdown
[DeviceA-Ten-GigabitEthernet3/0/1] quit
[DeviceA] vlan 2
[DeviceA-vlan2] port ten-gigabitethernet 3/0/1
[DeviceA-vlan2] quit
[DeviceA] interface vlan-interface 2
[DeviceA-Vlan-interface2] undo shutdown
[DeviceA-Vlan-interface2] ip address 10.1.1.2 24
[DeviceA-Vlan-interface2] quit
[DeviceA] vlan 3
[DeviceA-vlan3] port ten-gigabitethernet 3/0/2
[DeviceA-vlan3] quit
[DeviceA] interface vlan-interface 3
[DeviceA-Vlan-interface3] quit
2. Configure VRRP:
# Configure VRRP to operate in load balancing mode.
[DeviceA] vrrp mode load-balance
# Create VRRP group 1, and set its virtual IP address to 10.1.1.1.
[DeviceA] interface vlan-interface 2
[DeviceA-Vlan-interface2] vrrp vrid 1 virtual-ip 10.1.1.1
# Assign Device A the highest priority in VRRP group 1, so Device A can become the master.
[DeviceA-Vlan-interface2] vrrp vrid 1 priority 120
# Configure Device A to operate in preemptive mode, and set the preemption delay to 5 seconds.
[DeviceA-Vlan-interface2] vrrp vrid 1 preempt-mode delay 5
[DeviceA-Vlan-interface2] quit
3. Configure Track:
# Create track entry 1 to monitor the upstream link status of VLAN-interface 3. When the upstream link fails, the track entry transits to Negative.
[DeviceA] track 1 interface vlan-interface 3
# Configure the VFs in VRRP group 1 to monitor track entry 1, and decrease their weights by 250 when the track entry transits to Negative.
[DeviceA] interface vlan-interface 2
[DeviceA-Vlan-interface2] vrrp vrid 1 weight track 1 reduced 250
[DeviceA-Vlan-interface2] quit
Configuring Device B
1. Configure interface IP addresses:
<DeviceB> system-view
[DeviceB] interface ten-gigabitethernet 3/0/1
[DeviceB-Ten-GigabitEthernet3/0/1] undo shutdown
[DeviceB-Ten-GigabitEthernet3/0/1] quit
[DeviceB] vlan 2
[DeviceB-vlan2] port ten-gigabitethernet 3/0/1
[DeviceB-vlan2] quit
[DeviceB] interface vlan-interface 2
[DeviceB-Vlan-interface2] undo shutdown
[DeviceB-Vlan-interface2] ip address 10.1.1.3 24
[DeviceB-Vlan-interface2] quit
[DeviceB] vlan 3
[DeviceB-vlan3] port ten-gigabitethernet 3/0/2
[DeviceB-vlan3] quit
[DeviceB] interface vlan-interface 3
[DeviceB-Vlan-interface3] quit
2. Configure VRRP:
# Configure VRRP to operate in load balancing mode.
[DeviceB] vrrp mode load-balance
# Create VRRP group 1, and set its virtual IP address to 10.1.1.1.
[DeviceB] interface vlan-interface 2
[DeviceB-Vlan-interface2] vrrp vrid 1 virtual-ip 10.1.1.1
# Assign Device B higher priority than Device C in VRRP group 1, so Device B can become the master when Device A fails.
[DeviceB-Vlan-interface2] vrrp vrid 1 priority 110
# Configure Device B to operate in preemptive mode, and set the preemption delay to 5 seconds.
[DeviceB-Vlan-interface2] vrrp vrid 1 preempt-mode delay 5
[DeviceB-Vlan-interface2] quit
3. Configure Track:
# Create track entry 1 to monitor the upstream link status of VLAN-interface 3. When the upstream link fails, the track entry transits to Negative.
[DeviceB] track 1 interface vlan-interface 3
# Configure the VFs in VRRP group 1 to monitor track entry 1, and decrease their weights by 250 when the track entry transits to Negative.
[DeviceB] interface vlan-interface 2
[DeviceB-Vlan-interface2] vrrp vrid 1 weight track 1 reduced 250
[DeviceB-Vlan-interface2] quit
Configuring Device C
1. Configure interface IP addresses:
<DeviceC> system-view
[DeviceC] interface ten-gigabitethernet 3/0/1
[DeviceC-Ten-GigabitEthernet3/0/1] undo shutdown
[DeviceC-Ten-GigabitEthernet3/0/1] quit
[DeviceC] vlan 2
[DeviceC-vlan2] port ten-gigabitethernet 3/0/1
[DeviceC-vlan2] quit
[DeviceC] interface vlan-interface 2
[DeviceC-Vlan-interface2] undo shutdown
[DeviceC-Vlan-interface2] ip address 10.1.1.4 24
[DeviceC-Vlan-interface2] quit
[DeviceC] vlan 3
[DeviceC-vlan3] port ten-gigabitethernet 3/0/2
[DeviceC-vlan3] quit
[DeviceC] interface vlan-interface 3
[DeviceC-Vlan-interface3] quit
2. Configure VRRP:
# Configure VRRP to operate in load balancing mode.
[DeviceC] vrrp mode load-balance
# Create VRRP group 1, and set its virtual IP address to 10.1.1.1.
[DeviceC] interface vlan-interface 2
[DeviceC-Vlan-interface2] vrrp vrid 1 virtual-ip 10.1.1.1
# Configure Device C to operate in preemptive mode, and set the preemption delay to 5 seconds.
[DeviceC-Vlan-interface2] vrrp vrid 1 preempt-mode delay 5
[DeviceC-Vlan-interface2] quit
3. Configure Track:
# Create track entry 1 to monitor the upstream link status of VLAN-interface 3. When the upstream link fails, the track entry transits to Negative.
[DeviceC] track 1 interface vlan-interface 3
# Configure the VFs in VRRP group 1 to monitor track entry 1, and decrease their weights by 250 when the track entry transits to Negative.
[DeviceC] interface vlan-interface 2
[DeviceC-Vlan-interface2] vrrp vrid 1 weight track 1 reduced 250
[DeviceC-Vlan-interface2] quit
Verifying the configuration
# Verify that Host A can ping the external network. (Details not shown.)
# Display detailed information about VRRP group 1 on Device A.
[DeviceA] display vrrp verbose
IPv4 Virtual Device Information:
Running Mode : Load Balance
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 100
Admin Status : Up State : Master
Config Pri : 120 Running Pri : 120
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Virtual IP : 10.1.1.1
Member IP List : 10.1.1.2 (Local, Master)
10.1.1.3 (Backup)
10.1.1.4 (Backup)
Forwarder Information: 3 Forwarders 1 Active
Config Weight : 255
Running Weight : 255
Forwarder 01
State : Active
Virtual MAC : 000f-e2ff-0011 (Owner)
Owner ID : 0000-5e01-1101
Priority : 255
Active : local
Forwarder 02
State : Listening
Virtual MAC : 000f-e2ff-0012 (Learnt)
Owner ID : 0000-5e01-1103
Priority : 127
Active : 10.1.1.3
Forwarder 03
State : Listening
Virtual MAC : 000f-e2ff-0013 (Learnt)
Owner ID : 0000-5e01-1105
Priority : 127
Active : 10.1.1.4
Forwarder Weight Track Information:
Track Object : 1 State : Positive Weight Reduced : 250
# Display detailed information about VRRP group 1 on Device B.
[DeviceB] display vrrp verbose
IPv4 Virtual Device Information:
Running Mode : Load Balance
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 100
Admin Status : Up State : Backup
Config Pri : 110 Running Pri : 110
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Virtual IP : 10.1.1.1
Member IP List : 10.1.1.3 (Local, Backup)
10.1.1.2 (Master)
10.1.1.4 (Backup)
Forwarder Information: 3 Forwarders 1 Active
Config Weight : 255
Running Weight : 255
Forwarder 01
State : Listening
Virtual MAC : 000f-e2ff-0011 (Learnt)
Owner ID : 0000-5e01-1101
Priority : 127
Active : 10.1.1.2
Forwarder 02
State : Active
Virtual MAC : 000f-e2ff-0012 (Owner)
Owner ID : 0000-5e01-1103
Priority : 255
Active : local
Forwarder 03
State : Listening
Virtual MAC : 000f-e2ff-0013 (Learnt)
Owner ID : 0000-5e01-1105
Priority : 127
Active : 10.1.1.4
Forwarder Weight Track Information:
Track Object : 1 State : Positive Weight Reduced : 250
# Display detailed information about VRRP group 1 on Device C.
[DeviceC] display vrrp verbose
IPv4 Virtual Device Information:
Running Mode : Load Balance
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 100
Admin Status : Up State : Backup
Config Pri : 100 Running Pri : 100
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Virtual IP : 10.1.1.1
Member IP List : 10.1.1.4 (Local, Backup)
10.1.1.2 (Master)
10.1.1.3 (Backup)
Forwarder Information: 3 Forwarders 1 Active
Config Weight : 255
Running Weight : 255
Forwarder 01
State : Listening
Virtual MAC : 000f-e2ff-0011 (Learnt)
Owner ID : 0000-5e01-1101
Priority : 127
Active : 10.1.1.2
Forwarder 02
State : Listening
Virtual MAC : 000f-e2ff-0012 (Learnt)
Owner ID : 0000-5e01-1103
Priority : 127
Active : 10.1.1.3
Forwarder 03
State : Active
Virtual MAC : 000f-e2ff-0013 (Owner)
Owner ID : 0000-5e01-1105
Priority : 255
Active : local
Forwarder Weight Track Information:
Track Object : 1 State : Positive Weight Reduced : 250
The output shows that Device A is the master in VRRP group 1, and each of the three devices has one AVF and two LVFs.
# Disconnect the link of VLAN-interface 3 on Device A, and display detailed information about VRRP group 1 on Device A.
[DeviceA] display vrrp verbose
IPv4 Virtual Device Information:
Running Mode : Load Balance
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 100
Admin Status : Up State : Master
Config Pri : 120 Running Pri : 120
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Virtual IP : 10.1.1.1
Member IP List : 10.1.1.2 (Local, Master)
10.1.1.3 (Backup)
10.1.1.4 (Backup)
Forwarder Information: 3 Forwarders 0 Active
Config Weight : 255
Running Weight : 5
Forwarder 01
State : Initialize
Virtual MAC : 000f-e2ff-0011 (Owner)
Owner ID : 0000-5e01-1101
Priority : 0
Active : 10.1.1.4
Forwarder 02
State : Initialize
Virtual MAC : 000f-e2ff-0012 (Learnt)
Owner ID : 0000-5e01-1103
Priority : 0
Active : 10.1.1.3
Forwarder 03
State : Initialize
Virtual MAC : 000f-e2ff-0013 (Learnt)
Owner ID : 0000-5e01-1105
Priority : 0
Active : 10.1.1.4
Forwarder Weight Track Information:
Track Object : 1 State : Negative Weight Reduced : 250
# Display detailed information about VRRP group 1 on Device C.
[DeviceC] display vrrp verbose
IPv4 Virtual Device Information:
Running Mode : Load Balance
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 100
Admin Status : Up State : Backup
Config Pri : 100 Running Pri : 100
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Become Master : 3550ms left
Virtual IP : 10.1.1.1
Member IP List : 10.1.1.4 (Local, Backup)
10.1.1.2 (Master)
10.1.1.3 (Backup)
Forwarder Information: 3 Forwarders 2 Active
Config Weight : 255
Running Weight : 255
Forwarder 01
State : Active
Virtual MAC : 000f-e2ff-0011 (Take Over)
Owner ID : 0000-5e01-1101
Priority : 85
Active : local
Redirect Time : 93 secs
Time-out Time : 1293 secs
Forwarder 02
State : Listening
Virtual MAC : 000f-e2ff-0012 (Learnt)
Owner ID : 0000-5e01-1103
Priority : 85
Active : 10.1.1.3
Forwarder 03
State : Active
Virtual MAC : 000f-e2ff-0013 (Owner)
Owner ID : 0000-5e01-1105
Priority : 255
Active : local
Forwarder Weight Track Information:
Track Object : 1 State : Positive Weight Reduced : 250
The output shows that when the uplink interface of Device A fails, the weights of the VFs on Device A drop below the lower limit of failure. All VFs on Device A transit to Initialized state and cannot forward traffic. The VF for MAC address 000f-e2ff-0011 on Device C becomes the AVF to forward traffic.
# When the timeout timer (about 1800 seconds) expires, display detailed information about VRRP group 1 on Device C.
[DeviceC] display vrrp verbose
IPv4 Virtual Device Information:
Running Mode : Load Balance
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 100
Admin Status : Up State : Backup
Config Pri : 100 Running Pri : 100
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Become Master : 3550ms left
Virtual IP : 10.1.1.1
Member IP List : 10.1.1.4 (Local, Backup)
10.1.1.2 (Master)
10.1.1.3 (Backup)
Forwarder Information: 2 Forwarders 1 Active
Config Weight : 255
Running Weight : 255
Forwarder 02
State : Listening
Virtual MAC : 000f-e2ff-0012 (Learnt)
Owner ID : 0000-5e01-1103
Priority : 127
Active : 10.1.1.3
Forwarder 03
State : Active
Virtual MAC : 000f-e2ff-0013 (Owner)
Owner ID : 0000-5e01-1105
Priority : 255
Active : local
Forwarder Weight Track Information:
Track Object : 1 State : Positive Weight Reduced : 250
The output shows that when the timeout timer expires, the VF for virtual MAC address 000f-e2ff-0011 is removed. The VF no longer forwards the packets destined for the MAC address.
# When Device A fails, display detailed information about VRRP group 1 on Device B.
[DeviceB] display vrrp verbose
IPv4 Standby Information:
Run Mode : Load Balance
Run Method : Virtual MAC
Total number of virtual routers : 1
Interface Vlan-interface2
VRID : 1 Adver Timer : 1
Admin Status : Up State : Master
Config Pri : 110 Running Pri : 110
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Virtual IP : 10.1.1.1
Member IP List : 10.1.1.3 (Local, Master)
10.1.1.4 (Backup)
Forwarder Information: 2 Forwarders 1 Active
Config Weight : 255
Running Weight : 255
Forwarder 02
State : Active
Virtual MAC : 000f-e2ff-0012 (Owner)
Owner ID : 0000-5e01-1103
Priority : 255
Active : local
Forwarder 03
State : Listening
Virtual MAC : 000f-e2ff-0013 (Learnt)
Owner ID : 0000-5e01-1105
Priority : 127
Active : 10.1.1.4
Forwarder Weight Track Information:
Track Object : 1 State : Positive Weight Reduced : 250
The output shows that when Device A fails, Device B becomes the master because it has higher priority than Device C.
Configuration files
· Device A:
#
vrrp mode load-balance
#
vlan 2 to 3
#
interface Vlan-interface2
ip address 10.1.1.2 255.255.255.0
vrrp vrid 1 virtual-ip 10.1.1.1
vrrp vrid 1 priority 120
vrrp vrid 1 preempt-mode delay 5
vrrp vrid 1 weight track 1 reduced 250
#
interface Vlan-interface3
#
interface Ten-GigabitEthernet3/0/1
port link-mode bridge
port access vlan 2
#
interface Ten-GigabitEthernet3/0/2
port link-mode bridge
port access vlan 3
#
track 1 interface vlan-interface3
· Device B:
#
vrrp mode load-balance
#
vlan 2 to 3
#
interface Vlan-interface2
ip address 10.1.1.3 255.255.255.0
vrrp vrid 1 virtual-ip 10.1.1.1
vrrp vrid 1 priority 110
vrrp vrid 1 preempt-mode delay 5
vrrp vrid 1 weight track 1 reduced 250
#
interface Vlan-interface3
#
interface Ten-GigabitEthernet3/0/1
port link-mode bridge
port access vlan 2
#
interface Ten-GigabitEthernet3/0/2
port link-mode bridge
port access vlan 3
#
track 1 interface vlan-interface3
· Device C:
#
vrrp mode load-balance
#
vlan 2 to 3
#
interface Vlan-interface2
ip address 10.1.1.4 255.255.255.0
vrrp vrid 1 virtual-ip 10.1.1.1
vrrp vrid 1 preempt-mode delay 5
vrrp vrid 1 weight track 1 reduced 250
#
interface Vlan-interface3
#
interface Ten-GigabitEthernet3/0/1
port link-mode bridge
port access vlan 2
#
interface Ten-GigabitEthernet3/0/2
port link-mode bridge
port access vlan 3
#
track 1 interface vlan-interface3
#
Related documentation
· H3C S12500 Routing Switch Series High Availability Command Reference-Release 7328
· H3C S12500 Routing Switch Series High Availability Configuration Guide-Release 7328
· H3C S12500 Routing Switch Series Layer 2—LAN Switching Command Reference-Release 7328
· H3C S12500 Routing Switch Series Layer 2—LAN Switching Configuration Guide-Release 7328
