Lab 5-1 VRRP Configuration
Lab 5-1 VRRP Configuration
Learning Objectives
The objectives of this lab are to learn and understand:
How to configure a Virtual Router Redundancy Protocol
(VRRP) group and the virtual IP address
How to configure the VRRP priority
How to check the VRRP configuration
How to configure VRRP to monitor the uplink
How to configure load balancing for multiple VRRP groups
Topology
Figure 1-1 VRRP topology
Scenario
R1 functions as the gateway for a LAN and an external network. R1 connects to R2 and R3 through S5,
and R2, R3, R4, and R5 connect to a LAN through S1. VRRPv2 needs to be enabled on interfaces of R2
and R3 connecting to S1 to implement first-hop redundancy. R2 is the master router and R3 is the
backup router. No extra configurations are required for switches. The switches only transparently
forward packets.
Tasks
Step 1 Perform basic configurations and configure IP addresses.
Configure IP addresses for all routers.
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R1
[R1]interface loopback 0
[R1-LoopBack0]ip address 1.1.1.1 32
[R1-LoopBack0]quit
[R1]interface GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0]ip address 10.0.123.1 24
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R2
[R2]interface GigabitEthernet 0/0/0
[R2-GigabitEthernet0/0/0]ip address 10.0.123.2 24
[R2-GigabitEthernet0/0/0]quit
[R2]interface GigabitEthernet 0/0/1
[R2-GigabitEthernet0/0/1]ip address 192.168.1.2 24
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R3
[R3]interface GigabitEthernet 0/0/0
[R3-GigabitEthernet0/0/0]ip address 10.0.123.3 24
[R3-GigabitEthernet0/0/0]quit
[R3]interface GigabitEthernet 0/0/1
[R3-GigabitEthernet0/0/1]ip address 192.168.1.3 24
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R4
[R4]interface GigabitEthernet 0/0/1
[R4-GigabitEthernet0/0/1]ip address 192.168.1.4 24
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R5
[R5]interface GigabitEthernet 0/0/1
[R5-GigabitEthernet0/0/1]ip address 192.168.1.5 24
After the configuration is complete, test the connectivity between R1 and R2 and between R1 and R3.
[R1]ping 10.0.123.2
PING 10.0.123.2: 56 data bytes, press CTRL_C to break
Reply from 10.0.123.2: bytes=56 Sequence=1 ttl=255 time=1 ms
Reply from 10.0.123.2: bytes=56 Sequence=2 ttl=255 time=1 ms
Reply from 10.0.123.2: bytes=56 Sequence=3 ttl=255 time=1 ms
Reply from 10.0.123.2: bytes=56 Sequence=4 ttl=255 time=1 ms
Reply from 10.0.123.2: bytes=56 Sequence=5 ttl=255 time=1 ms
[R1]ping 10.0.123.3
PING 10.0.123.3: 56 data bytes, press CTRL_C to break
Reply from 10.0.123.3: bytes=56 Sequence=1 ttl=255 time=1 ms
Reply from 10.0.123.3: bytes=56 Sequence=2 ttl=255 time=1 ms
Reply from 10.0.123.3: bytes=56 Sequence=3 ttl=255 time=1 ms
Reply from 10.0.123.3: bytes=56 Sequence=4 ttl=255 time=1 ms
Reply from 10.0.123.3: bytes=56 Sequence=5 ttl=255 time=1 ms
Test the connectivity between R2, R3, R4, and R5. R2 is used as an example.
[R2]ping 192.168.1.3
PING 192.168.1.3: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.3: bytes=56 Sequence=1 ttl=255 time=27 ms
Reply from 192.168.1.3: bytes=56 Sequence=2 ttl=255 time=1 ms
Reply from 192.168.1.3: bytes=56 Sequence=3 ttl=255 time=1 ms
Reply from 192.168.1.3: bytes=56 Sequence=4 ttl=255 time=1 ms
Reply from 192.168.1.3: bytes=56 Sequence=5 ttl=255 time=1 ms
[R2]ping 192.168.1.4
PING 192.168.1.4: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.4: bytes=56 Sequence=1 ttl=255 time=1 ms
Reply from 192.168.1.4: bytes=56 Sequence=2 ttl=255 time=1 ms
Reply from 192.168.1.4: bytes=56 Sequence=3 ttl=255 time=1 ms
Reply from 192.168.1.4: bytes=56 Sequence=4 ttl=255 time=1 ms
Reply from 192.168.1.4: bytes=56 Sequence=5 ttl=255 time=1 ms
[R2]ping 192.168.1.5
PING 192.168.1.5: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.5: bytes=56 Sequence=1 ttl=255 time=1 ms
Reply from 192.168.1.5: bytes=56 Sequence=2 ttl=255 time=1 ms
Reply from 192.168.1.5: bytes=56 Sequence=3 ttl=255 time=1 ms
Reply from 192.168.1.5: bytes=56 Sequence=4 ttl=255 time=1 ms
Reply from 192.168.1.5: bytes=56 Sequence=5 ttl=255 time=1 ms
[R2]ospf 1
[R2-ospf-1]silent-interface GigabitEthernet 0/0/1
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 10.0.123.0 0.0.0.255
[R2-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[R3]ospf 1
[R3-ospf-1]silent-interface GigabitEthernet 0/0/1
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 10.0.123.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
After the configuration is complete, check the routing table ofR1, R2, and R4.
[R1]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 9 Routes : 10
[R2]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 12 Routes : 12
[R4]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 9 Routes : 9
The preceding output shows that R1 can learn routes to 192.168.1.0/24, R2 can learn routes to
1.1.1.1/32, and R4 has a default static route to 192.168.1.1.
R2 is configured first and becomes the master router if there is no other member in the VRRP group
after a period of time.
[R3]interface GigabitEthernet 0/0/1
[R3-GigabitEthernet0/0/1]vrrp vrid 1 virtual-ip 192.168.1.1
After the configuration is complete, check the VRRP status on R2 and R3.
[R2]display vrrp
GigabitEthernet0/0/1 | Virtual Router 1
State : Master
Virtual IP : 192.168.1.1
Master IP : 192.168.1.2
PriorityRun : 100
PriorityConfig : 100
MasterPriority : 100
Preempt : YES Delay Time : 0 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Backup-forward : disabled
Create time : 2016-07-22 18:00:03
Last change time : 2016-07-22 18:00:07
[R3]display vrrp
GigabitEthernet0/0/1 | Virtual Router 1
State : Backup
Virtual IP : 192.168.1.1
Master IP : 192.168.1.2
PriorityRun : 100
PriorityConfig : 100
MasterPriority : 100
Preempt : YES Delay Time : 0 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Backup-forward : disabled
Create time : 2016-07-22 18:03:16
Last change time : 2016-07-22 18:03:16
R2 is selected as the master router and R3 as the backup router. The priorities of master and slave
routers are both 100. When R3 is started first, it becomes the master router, which is not expected.
[R3]display vrrp
GigabitEthernet0/0/1 | Virtual Router 1
State : Backup
Virtual IP : 192.168.1.1
Master IP : 192.168.1.2
PriorityRun : 110
PriorityConfig : 110
MasterPriority : 120
Preempt : YES Delay Time : 0 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Backup-forward : disabled
Create time : 2016-07-22 18:03:16
Last change time : 2016-07-22 18:03:16
The preceding output shows that priorities of R2 and R3 have been changed successfully. By default,
VRRP preemption is enabled. When the priority of R3 is changed to be higher, an active/standby
switchover will be triggered.
Test the connectivity between R4 and R1.
[R4]ping 1.1.1.1
PING 1.1.1.1: 56 data bytes, press CTRL_C to break
Reply from 1.1.1.1: bytes=56 Sequence=1 ttl=254 time=57 ms
Reply from 1.1.1.1: bytes=56 Sequence=2 ttl=254 time=1 ms
Reply from 1.1.1.1: bytes=56 Sequence=3 ttl=254 time=1 ms
Reply from 1.1.1.1: bytes=56 Sequence=4 ttl=254 time=1 ms
Reply from 1.1.1.1: bytes=56 Sequence=5 ttl=254 time=1 ms
The preceding output shows that the virtual gateway works properly and can forward data of the LAN
where R4 is located to R1. Normally, the master router forwards data, so traffic passes through R2. To
verify the switching status, perform the ping operation from R4 to R1 for a long time and shut down the
interface of R2 connected to S1.
[R2]interface GigabitEthernet 0/0/1
[R2-GigabitEthernet0/0/1]shutdown
R4 discards two data packets during the switchover, and subsequent data is forwarded normally.
[R4]ping -c 1000 1.1.1.1
PING 1.1.1.1: 56 data bytes, press CTRL_C to break
Reply from 1.1.1.1: bytes=56 Sequence=1 ttl=254 time=1 ms
Reply from 1.1.1.1: bytes=56 Sequence=2 ttl=254 time=1 ms
Reply from 1.1.1.1: bytes=56 Sequence=3 ttl=254 time=1 ms
Reply from 1.1.1.1: bytes=56 Sequence=4 ttl=254 time=1 ms
Reply from 1.1.1.1: bytes=56 Sequence=5 ttl=254 time=1 ms
Reply from 1.1.1.1: bytes=56 Sequence=6 ttl=254 time=1 ms
Request time out
Request time out
Reply from 1.1.1.1: bytes=56 Sequence=9 ttl=254 time=1 ms
Reply from 1.1.1.1: bytes=56 Sequence=10 ttl=254 time=1 ms
Reply from 1.1.1.1: bytes=56 Sequence=11 ttl=254 time=1 ms
Reply from 1.1.1.1: bytes=56 Sequence=12 ttl=254 time=1 ms
Reply from 1.1.1.1: bytes=56 Sequence=13 ttl=254 time=1 ms
Reply from 1.1.1.1: bytes=56 Sequence=14 ttl=254 time=1 ms
Reply from 1.1.1.1: bytes=56 Sequence=15 ttl=254 time=1 ms
Reply from 1.1.1.1: bytes=56 Sequence=16 ttl=254 time=1 ms
Reply from 1.1.1.1: bytes=56 Sequence=17 ttl=254 time=1 ms
Reply from 1.1.1.1: bytes=56 Sequence=18 ttl=254 time=1 ms
Reply from 1.1.1.1: bytes=56 Sequence=19 ttl=254 time=1 ms
Reply from 1.1.1.1: bytes=56 Sequence=20 ttl=254 time=1 ms
Perform the ping operation on R4 for a long time and shut down the uplink interface on R2.
[R2]interface GigabitEthernet 0/0/0
[R2-GigabitEthernet0/0/0]shutdown
[R2]display vrrp
GigabitEthernet0/0/1 | Virtual Router 1
State : Backup
Virtual IP : 192.168.1.1
Master IP : 192.168.1.3
PriorityRun : 90
PriorityConfig : 120
MasterPriority : 110
Preempt : YES Delay Time : 0 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Backup-forward : disabled
Track IF : GigabitEthernet0/0/0 Priority reduced : 30
IF state : DOWN
Create time : 2016-07-25 17:14:56 UTC-08:00
Last change time : 2016-07-25 19:57:46 UTC-08:00
[R3]display vrrp
GigabitEthernet0/0/1 | Virtual Router 1
State : Master
Virtual IP : 192.168.1.1
Master IP : 192.168.1.3
PriorityRun : 110
PriorityConfig : 110
MasterPriority : 110
Preempt : YES Delay Time : 0 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Backup-forward : disabled
Create time : 2016-07-25 17:20:00 UTC-08:00
Last change time : 2016-07-25 19:56:24 UTC-08:00
[R2]display vrrp
GigabitEthernet0/0/1 | Virtual Router 1
State : Master
Virtual IP : 192.168.1.1
Master IP : 192.168.1.2
PriorityRun : 120
PriorityConfig : 120
MasterPriority : 120
Preempt : YES Delay Time : 0 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Backup-forward : disabled
Track IF : GigabitEthernet0/0/0 Priority reduced : 30
IF state : UP
Create time : 2016-07-25 17:14:56 UTC-08:00
Last change time : 2016-07-25 20:04:40 UTC-08:00
When the interface goes Up, the OSPF neighbor relationship needs to be reestablished on the uplink
interface of R2. If OSPF fast convergence is not configured, data cannot be forwarded for several
seconds. You are advised to set the preemption delay to be longer than the OSPF convergence time
during the switchback.
[R2]interface GigabitEthernet 0/0/1
[R2-GigabitEthernet0/0/1]vrrp vrid 1 preempt-mode timer delay 10
Check the VRRP configurations again. You can see that the preemption delay has been configured
successfully.
[R2]display vrrp
GigabitEthernet0/0/1 | Virtual Router 1
State : Master
Virtual IP : 192.168.1.1
Master IP : 192.168.1.2
PriorityRun : 120
PriorityConfig : 120
MasterPriority : 120
Preempt : YES Delay Time : 10 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Backup-forward : disabled
Track IF : GigabitEthernet0/0/0 Priority reduced : 30
IF state : UP
Create time : 2016-07-25 17:14:56 UTC-08:00
Last change time : 2016-07-25 20:04:40 UTC-08:00
<R3>display vrrp
GigabitEthernet0/0/1 | Virtual Router 1
State : Backup
Virtual IP : 192.168.1.1
Master IP : 192.168.1.2
PriorityRun : 110
PriorityConfig : 110
MasterPriority : 120
Preempt : YES Delay Time : 0 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Backup-forward : disabled
Create time : 2016-07-25 17:20:00 UTC-08:00
Last change time : 2016-07-25 20:03:15 UTC-08:00
Perform the tracert operation to check the gateways that process data destined for the two default
routes. You can see that data sent by R4 is forwarded by the master device in VRRP group 1 and data
sent by R5 is forwarded by the master device in VRRP group 2.
# Enable R1 to send ICMP Port Unreachable packets.
[R1]icmp port-unreachable send
<R4>tracert 1.1.1.1
1 192.168.1.2 80 ms 40 ms 40 ms
2 10.0.123.1 100 ms 70 ms 70 ms
<R5>tracert 1.1.1.1
1 192.168.1.3 50 ms 30 ms 50 ms
2 10.0.123.1 60 ms 90 ms 60 ms
<R4>tracert 1.1.1.1
1 192.168.1.3 50 ms 40 ms 50 ms
2 10.0.123.1 70 ms 80 ms 50 ms
<R5>tracert 1.1.1.1
1 192.168.1.3 40 ms 50 ms 40 ms
2 10.0.123.1 70 ms 100 ms 90 ms
<R3>display vrrp
GigabitEthernet0/0/1 | Virtual Router 1
State : Master
Virtual IP : 192.168.1.1
Master IP : 192.168.1.3
PriorityRun : 110
PriorityConfig : 110
MasterPriority : 110
Preempt : YES Delay Time : 0 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Backup-forward : disabled
Create time : 2016-07-25 17:20:00 UTC-08:00
Last change time : 2016-07-25 20:46:42 UTC-08:00
Normally, R2 and R3 load balance traffic. When R2 is faulty, R3 takes over all traffic on R2. In this case,
load balancing of two VRRP groups is configured.
Device Configuration
<R1>display current-configuration
sysname R1
interface GigabitEthernet0/0/0
interface LoopBack0
ospf 1
area 0.0.0.0
return
<R2>display current-configuration
sysname R2
interface GigabitEthernet0/0/0
shutdown
ip address 10.0.123.2 255.255.255.0
interface GigabitEthernet0/0/1
ospf 1
silent-interface GigabitEthernet0/0/1
area 0.0.0.0
return
<R3>display current-configuration
sysname R3
interface GigabitEthernet0/0/0
interface GigabitEthernet0/0/1
ospf 1
silent-interface GigabitEthernet0/0/1
area 0.0.0.0
return
<R4>display current-configuration
sysname R4
interface GigabitEthernet0/0/1
return
<R5>display current-configuration
sysname R5
interface GigabitEthernet0/0/1
return