Network Bytes · Episode 48 · CCNA 3.5
HSRP / first-hop redundancy
Every PC depends on one default gateway, so one router failure can cut off a whole office. HSRP lets two routers share a virtual IP gateway; the active router forwards traffic and the standby takes over when the hellos stop.
One gateway, one weak spot
A PC sends anything that is not on its own subnet to its default gateway, a single router address it was given by hand or by DHCP. That makes the gateway router a single point of failure: if it dies, every PC in the office loses the internet and every other network, even though the PCs themselves are fine. Adding a second router does not help on its own, because the PCs still point at the first router's address. A first hop redundancy protocol (FHRP) solves this.
The virtual IP: a pretend gateway
HSRP is Cisco's FHRP. The routers in an HSRP group agree on a virtual IP address, for example 10.1.1.1, that belongs to no single router. The PCs use that address as their default gateway. Behind it there is also a virtual MAC address (0000.0c07.acXX in HSRPv1, where XX is the group number), so when a PC sends ARP for the gateway, it learns a MAC that can move between routers.
Active and standby
The routers compare their HSRP priority (0-255, default 100). The highest priority becomes the active router: it answers for the virtual IP and forwards all the traffic. If priorities tie, the highest interface IP address wins. The next router becomes the standby router, which forwards nothing for the group and just listens. The active router sends hello messages every 3 seconds by default.
Failover: 10 seconds of silence
If the standby hears no hellos for the hold time, 10 seconds by default, it decides the active router is gone and takes over the virtual IP and the virtual MAC. The PCs keep sending to the same gateway address and the same MAC, so traffic keeps flowing and no PC has to change anything. Switches simply learn that the virtual MAC now lives on a different port.
Try it yourself
In Cisco Packet Tracer (free with a Cisco Networking Academy account), connect two routers and two PCs to one switch. Give the routers 10.1.1.2/24 and 10.1.1.3/24, then on each router's LAN interface enter standby 1 ip 10.1.1.1. Set both PCs' default gateway to 10.1.1.1 and run show standby brief on each router to see which one is Active and which is Standby. Now shut down the active router's LAN interface (shutdown), wait about 10 seconds and run show standby brief again on the other router: it is now Active, and a PC can still ping 10.1.1.1 without any change to its settings.
Good to know
- HSRP is Cisco proprietary; RFC 2281 documents version 1. VRRP (RFC 5798, an open standard) and GLBP are the other first hop redundancy protocols on the CCNA list.
- Defaults: priority 100 (range 0-255), hello 3 seconds, hold 10 seconds. Highest priority wins; the highest interface IP address breaks a tie.
- Preemption is off by default: a higher-priority router that comes up later does not take over unless
standby preemptis configured. - Virtual MAC:
0000.0c07.acXXin HSRPv1 (XX = group number) and0000.0c9f.fXXXin HSRPv2. - Only the active router forwards for a group, so one HSRP group does not share the load between routers.
- "Pretend address" in the video is an analogy for the virtual IP.
For CCNA learners
This lines up with CCNA 200-301 exam topic 3.5, first hop redundancy protocols: know why a single default gateway is a weak spot, how a shared virtual IP and MAC fix it, and how HSRP picks the active and standby routers.
Answer to the comment question
Router A. The highest HSRP priority becomes active, and 110 is higher than Router B's default of 100, so Router A is active and Router B is standby. (This assumes both routers start together; with preemption off, a higher-priority router that boots later would not take over unless standby preempt is set.)
Test your knowledge
Quick quiz: HSRP / first-hop redundancy
4 multiple-choice questions. Pick one answer for each, then check how you did.
Sources
- IETF, "RFC 2281, Cisco Hot Standby Router Protocol (HSRP)": virtual IP and MAC shared by a group; active and standby routers; hello and hold timers; priority
- Cisco Community, "HSRP Overview and Basic Configuration": default priority 100, hello 3 s, hold 10 s, preempt off by default, virtual MAC 0000.0c07.acXX
- IETF, "RFC 5798, Virtual Router Redundancy Protocol (VRRP) Version 3": the open-standard alternative
- Cisco, CCNA 200-301 v1.1 exam topics: 3.5 describe the purpose, functions, and concepts of first hop redundancy protocols
Video transcript
Your default gateway just died. Why did nobody notice?
Every PC sends off-network traffic to one gateway. If that router fails, the whole office is cut off. So we add a spare router.
With HSRP, the Hot Standby Router Protocol, both routers share one pretend address, called a virtual IP. Every PC uses it as its gateway.
The highest-priority router becomes active and does the work. The other waits on standby. The active router says hello every 3 seconds.
If the standby hears nothing for 10 seconds, it takes over the virtual IP and virtual MAC. Traffic keeps flowing, and no PC notices.
Router A has priority 110. Router B keeps the default, 100. Which becomes active? Comment your answer below!
That's your byte.