3.3.c Configure first-hop redundancy with HSRP and VRRP

ENCOR 350-401 v1.2 · 3.0 Infrastructure

Hosts have one default gateway. A first-hop redundancy protocol lets two or more routers share a virtual IP and MAC address, so the gateway survives the loss of a router. ENCOR expects you to configure HSRP (Cisco) and VRRP (the open standard), control who is active with priority and preemption, and fail over when the upstream path fails, not only the local interface.

What you must know

HSRP

HSRP routers elect one active router, which answers ARP for the virtual IP with the virtual MAC, and one standby. Others listen. The highest priority wins (default 100); a tie goes to the highest interface IP. Preemption is off by default: a router with a better priority that comes back later stays standby until you configure preempt.

interface Vlan10
 ip address 10.1.10.2 255.255.255.0
 standby version 2
 standby 10 ip 10.1.10.1
 standby 10 priority 110
 standby 10 preempt delay minimum 30
 standby 10 track 1 decrement 20

PC1's traffic to its gateway reaches DSW1, the active router (1). If DSW1 fails, DSW2 stops hearing hellos (every 3 s; hold time 10 s), takes over the virtual IP and MAC, and sends a gratuitous ARP so the switches learn the MAC's new port. PC1 never changes anything.

HSRPv1HSRPv2VRRP
StandardCiscoCiscoRFC 5798 (v3)
Groups0–2550–40951–255
Multicast224.0.0.2224.0.0.102224.0.0.18
Virtual MAC0000.0c07.acXX0000.0c9f.fXXX0000.5e00.01XX
RolesActive / standbyActive / standbyMaster / backup
Preempt by defaultNoNoYes
IPv6NoYesYes (v3)

VRRP

VRRP works the same way with different names: one master, the rest backups. The virtual IP may be one router's own interface address; that router is the owner, has priority 255 and is always master when it is up. Preemption is on by default and advertisements go every second.

interface Vlan20
 ip address 10.1.20.3 255.255.255.0
 vrrp 20 ip 10.1.20.1
 vrrp 20 priority 110
 vrrp 20 track 1 decrement 20

Load sharing and tracking

One group has one active router, so the standby idles. Make DSW1 active for VLAN 10 and DSW2 for VLAN 20, and match each to the STP root of that VLAN so traffic does not cross the inter-switch link. Tracking lowers the priority when an object goes down. Track the uplink (track 1 interface Gi1/0/48 line-protocol) or, better, an IP SLA probe through the uplink, so the router gives up the role when the path upstream fails. The other router must have preempt to take over.

Commands

show standby briefEach HSRP group: interface, priority, preemption (P), state, active and standby addresses, virtual IP.
show standbyFull detail, including the virtual MAC, timers and tracked objects.
show vrrp briefEach VRRP group with priority, owner, state and master address.
show trackThe state of tracked objects and which groups follow them.
debug standby eventsState changes as they happen.

Exam traps

Check yourself

DSW1 (priority 110) reboots. DSW2 (100) becomes active. DSW1 comes back. Who is active?
DSW2, unless DSW1 has standby … preempt. HSRP does not preempt by default.
Which virtual MAC does HSRPv2 group 10 use?
0000.0c9f.f00a (group 10 in hex).
DSW1 tracks its uplink with decrement 5, priority 110; DSW2 is 100 with preempt. The uplink fails. What happens?
Nothing: DSW1 drops to 105, still above 100. Use a decrement larger than 10.
Name two differences between HSRP and VRRP.
VRRP is an open standard and preempts by default; HSRP is Cisco's and does not. Also active/standby versus master/backup, different multicast addresses and virtual MACs, and VRRP's owner concept.

Labs

Try it live: HSRPv2 with object tracking and IP SLA

More topics in 3.0 Infrastructure