HSRP, VRRP

A host has one gateway address, so redundancy cannot be solved at the host: two switches present one virtual router. HSRP shares a virtual IP and a virtual MAC, and the MAC is the half that makes failover invisible, because hosts keep the cached entry. Reload one switch without preemption and the other stays active afterward, with nothing broken and the design document now false.

In Daveth Pro (Network)6 min video · lab: Services

By , founder of Daveth · Updated

Opening frame of the video walkthrough of HSRP, VRRP

Watch this lesson

6 min · Video walkthrough

In Daveth Pro (Network)

The full 6 min walkthrough is in Daveth Pro (Network). See what the plan opens

Upcoming practical lab

Lab C16: Services

What the lab covers

What this page answers

Why does HSRP use a virtual MAC address?

Hosts ARP for the gateway once and cache the answer. Because the routers share a virtual MAC as well as the virtual IP, the cached entry stays correct when the active router changes. Read it in “The half people skip”

What happens to HSRP after a reload without preemption?

The other switch takes over and stays active when the reloaded switch returns. Every VLAN still has a gateway, but it may not be the switch the design names, and nothing reports it. Read it in “Eighteen months, and still nothing is wrong”

A host has one gateway, and it is not negotiable

A laptop on a VLAN has one default gateway address. Not a list. Not a preference order. One address, learned by DHCP or typed in, and the laptop will keep sending to it forever.

So first-hop redundancy cannot be solved at the host. Whatever answers that address has to keep answering it, whichever device is alive, which means the address cannot belong to a device.

Two switches present the appearance of a single virtual router or default gateway to the hosts on a LAN. Both of them sit on both VLANs, which is the whole reason the answer can move without anything on the segment changing.

State 1 Two switches, two VLANs, one design

How many of these switches could answer for VLAN 10, and how would a host on it tell them apart?

Network drawing: CORE, the rest of the network, DSW1, DESIGNED PRIMARY, DSW2, DESIGNED STANDBY, VLAN 10, gateway 10.10.10.1, VLAN 20, gateway 10.10.20.1, HOST-10, HOST-20

The design names DSW1: priority 110 on both VLANs against the documented default of 100 on DSW2. VLAN 10 runs HSRP. VLAN 20 runs VRRPv3. Configured by anybody's reading of that design, the two are the same.

DSW1# configure terminal
DSW1(config)# interface Vlan10
DSW1(config-if)# ip address 10.10.10.2 255.255.255.0
DSW1(config-if)# standby 1 ip 10.10.10.1
DSW1(config-if)# standby 1 priority 110
DSW1(config-if)# end
DSW1# configure terminal
DSW1(config)# fhrp version vrrp v3
DSW1(config)# interface Vlan20
DSW1(config-if)# ip address 10.10.20.2 255.255.255.0
DSW1(config-if)# vrrp 2 address-family ipv4
DSW1(config-if-vrrp)# address 10.10.20.1
DSW1(config-if-vrrp)# priority 110
DSW1(config-if-vrrp)# end

Look at what is not in either block. Neither one says anything about what should happen after a failure recovers. Both protocols have an opinion about that, and neither block shows it.

The half people skip

HSRP provides a virtual Media Access Control (MAC) address and an IP address that is shared among a group of configured routers. The IP is the obvious half.

The MAC is the half that makes failover invisible. A host ARPs for the gateway once and caches what comes back. If the MAC moved with the role, every host on the segment would hold a stale entry until it aged out and the failover would be a visible outage. Sharing it means the cache stays correct.

What does DSW1 say the group's address is? The arrangement of show standby on this page is this course's: the field names are the chapter's, and every value is computed from this scenario, not printed by a device.

DSW1# show standby
Vlan10 - Group 1 (version 1)
  State is Active
  Virtual IP address is 10.10.10.1
  Virtual MAC address is 0000.0c07.ac01
! The group's address, not this switch's. It does not move when the role does.
  Hello time 3 sec, hold time 10 sec
  Priority 110
  Preemption disabled
  Active router is local

The format is 0000.0c07.acXX, where XX is the HSRP group number, so a capture tells you which group a frame belongs to with no other context.

Why this page uses group numbers below ten. The defaults table gives that format and does not say whether XX is decimal or hexadecimal. For group 10 the two readings give different addresses, and this course has not verified which is right, so it does not choose. That is a thing to check on a device rather than assume from a format string.

Here is what each host is holding. No command on either switch prints this: a host is not one of these devices, and this course does not invent host output.

HOST      GATEWAY       CACHED MAC
HOST-10   10.10.10.1    0000.0c07.ac01
HOST-20   10.10.20.1    none published

One row has no MAC in it. The VRRPv3 chapter this course verified gives no virtual MAC format, checked explicitly: its one show vrrp detail sample prints a single address for group 3, and one sample is not a format. That absence is worth noticing precisely because HSRP's is printed in its defaults table and a candidate will expect the pair. Nothing is invented to fill it.

The HSRP defaults, as that chapter prints them. Read the table for what is missing from it as much as for what is in it.

FeatureDefault
HSRP versionVersion 1
Standby group number0
Standby priority100
Standby hello time3 seconds
Standby holdtime10 seconds
Standby track interface priority10
Standby MAC address0000.0c07.acXX, where XX is the HSRP group number

Preemption is not a row in that table. Hold on to that through the next section.

One reload, watched on two VLANs

DSW1 is reloaded for a software upgrade. DSW2 takes over both VLANs: no priority is compared and no preemption question arises, because there is nobody else left. What does DSW2 report while it is alone?

DSW2# show standby brief
Interface  Grp  Pri  P  State     Active          Virtual IP
Vl10       1    100     Active    local           10.10.10.1

Nothing is broken. Both VLANs have a gateway, both hosts hold the same cached MAC they always did, and no alarm has fired. Now put a number on what happens when the upgrade finishes.

DSW1 comes back. Same hardware, same configuration, priority 110 on both VLANs: and it takes back exactly one of them. Which role does it report for VLAN 10?

DSW1# show standby brief
Interface  Grp  Pri  P  State     Active          Virtual IP
Vl10       1    110     Standby   10.10.10.3      10.10.10.1
! Standby. On a switch whose priority is higher than the one that is active.

That output has one row, because show standby is HSRP's command. VLAN 20 is not missing from it by accident and it is not hidden. VRRP's command is show vrrp; the VRRPv3 chapter prints one show vrrp detail sample, for another network, and this page computes no VRRP output. Here is the state instead, from the model:

VLAN 10   HSRP   DSW2, not the switch the design names
VLAN 20   VRRP   DSW1, as designed

Why they differ, in one line each. VRRP: "a preemptive scheme is enabled whereby a higher priority virtual device backup that becomes available takes over", and "preemption is enabled by default". HSRP: standby preempt is a command, absent from the defaults table, and nobody typed it.

A priority of 110 made it eligible. It gave it no mechanism. Higher priority decides an election; it does not displace a working holder.

Eighteen months, and still nothing is wrong

State 2 The same two switches, and the design is false

What would have made this visible?

Network drawing: CORE, the rest of the network, DSW1, DESIGNED PRIMARY, DSW2, DESIGNED STANDBY, VLAN 10, gateway 10.10.10.1, VLAN 20, gateway 10.10.20.1, HOST-10, HOST-20, 10.10.10.1 answered by DSW2, 10.10.20.1 answered by DSW1

This is the state the network has been in since that maintenance window. One of the two VLANs is served by the switch the design did not name, every VLAN has a working gateway, and no command reports a problem, because there is not one.

Nothing would have made it visible, because nothing was wrong. The network was fully redundant throughout. What was false was the design document, and with it the capacity planning that assumed one switch carried the load, the firewall rules written around expected source interfaces, and every monitoring baseline.

The design instinct. A redundancy protocol's job is to keep the service running, not to keep the design true. Those are different goals and the protocol only guarantees the first. If your operations depend on which device is active, and somewhere they do, that is a property you configure and monitor deliberately, because failover will not restore it and nothing will complain.

The repair is one command, and its definition is worth reading for a single word.

DSW1# configure terminal
DSW1(config)# interface Vlan10
DSW1(config-if)# standby 1 preempt
DSW1(config-if)# end

It configures the router to preempt, which means that when the local router has a higher priority than the active router, it becomes the active router, and 110 is higher than 100, so the role should come back at once. Did it?

DSW1# show standby
Vlan10 - Group 1 (version 1)
  State is Active
  Virtual IP address is 10.10.10.1
  Virtual MAC address is 0000.0c07.ac01
  Hello time 3 sec, hold time 10 sec
  Priority 110
  Preemption enabled
! Now a configured property. It will hold through the next reload as well.
  Active router is local

The word is higher. Not "at least as high". A router whose priority merely equals the holder's does not preempt, and that one word decides everything in the next section.

Proves: show standby proves the current role, this switch's priority, and whether preemption is configured. The third is the only one of the three that says anything about the next recovery: role and priority describe now.
Does not prove: that the peer holds a compatible configuration, that hosts are using the virtual address, or that the interface being tracked is the one whose failure matters. And show standby brief across the estate is the only thing that answers is the design still true: which is a question no single device asks itself.