Week 6 · Lab

LAB: HSRP

A single default gateway is a single point of failure. In this lab two routers share a virtual IP with HSRP, a PC points at that virtual IP, and you prove the whole point of the lesson: pull the active router and the PC never notices.

CCNA 200-301 Domain 3.0 · IP Connectivity Verified 2026-10-11
Learning objectives
Part 1

Overview and goal

HSRP (Hot Standby Router Protocol) is Cisco-proprietary. Both routers join HSRP group 1 and agree on the virtual IP 10.0.0.1. One router becomes Active (it answers ARP and forwards) and the other becomes Standby, sending periodic Hellos. The PC's default gateway is the virtual IP, so whichever router owns the role, the PC is happy.

Definition — HSRP virtual address HSRP shares a virtual IP (10.0.0.1) and a virtual MAC (0000.0C07.AC01 for group 1). Hosts use the virtual IP as their gateway; the active router responds to ARP with the virtual MAC. When the active router fails, the standby takes over both addresses.

To prove the gateway actually forwards traffic rather than merely saying “hello”, we add a remote network behind R2 (loopback 2.2.2.2/32) advertised into OSPF, so the PC pings across the virtual gateway to a real destination. R1 and R2 run OSPF between themselves on a transit link.

In this lesson · select a part to jump

Key ideas & exam traps · select one

Part 2

Topology

PC1 10.0.0.10 /24 gw 10.0.0.1 (virtual) S1 R1 ACTIVE G0/0 10.0.0.2 priority 150 R2 STANDBY G0/0 10.0.0.3 priority 100 G0/1 link 10.99.0.0/30 R1 10.99.0.1 — R2 10.99.0.2 R2 loopback 2.2.2.2/32 R1 loopback 1.1.1.1/32 Virtual IP 10.0.0.1, group 1 Virtual MAC 0000.0C07.AC01
Both routers face the same LAN through S1 and run HSRP group 1. The PC uses the virtual gateway 10.0.0.1. OSPF on the transit link gives the gateway a real remote network to forward toward (2.2.2.2 on R2's loopback).
Part 3

Addressing plan

DeviceInterfaceIP address / maskRole in HSRP group 1
PC1NIC10.0.0.10 /24, gateway 10.0.0.1—
S1SwitchUnmanaged for the LAN 10.0.0.0/24—
R1GigabitEthernet 0/010.0.0.2 /24HSRP standby 1, priority 150, preempt → Active
R1GigabitEthernet 0/110.99.0.1 /30—
R1Loopback 01.1.1.1 /32—
R2GigabitEthernet 0/010.0.0.3 /24HSRP standby 1, default priority 100 → Standby
R2GigabitEthernet 0/110.99.0.2 /30—
R2Loopback 02.2.2.2 /32—
Exam tip — who wins? Higher priority becomes Active; on a tie, the higher real interface address on the LAN wins. Default priority is 100. Here R1 (150) is Active and R2 (100) is Standby.
Reference table · select a row

Part 4

Step 1 — Build the topology

  1. Add 2 routers (4321), 1 switch (2960), and 1 PC.
  2. PC1 → S1, R1 G0/0 → S1, R2 G0/0 → S1: copper straight-through. These all live on the 10.0.0.0/24 LAN.
  3. R1 G0/1 → R2 G0/1: router-to-router, so use a cross-over cable, fibre, or a serial pair with DCE clock.
Only one panel per router If Packet Tracer gives you three Ethernet ports on one router, use GigabitEthernet0/0 on the LAN and GigabitEthernet0/1 for the transit link, and keep the switch on the LAN side only.
Part 5

Step 2 — Configure R1 (active)

Router> enable
Router# configure terminal
Router(config)# hostname R1

! LAN interface with HSRP group 1
R1(config)# interface gigabitEthernet 0/0
R1(config-if)# ip address 10.0.0.2 255.255.255.0
R1(config-if)# no shutdown
R1(config-if)# standby 1 ip 10.0.0.1
R1(config-if)# standby 1 priority 150
R1(config-if)# standby 1 preempt

! transit link and loopback
R1(config-if)# interface gigabitEthernet 0/1
R1(config-if)# ip address 10.99.0.1 255.255.255.252
R1(config-if)# no shutdown
R1(config-if)# interface loopback 0
R1(config-if)# ip address 1.1.1.1 255.255.255.255

! OSPF so both routers know each loo
R1(config-if)# end
R1(config)# router ospf 1
R1(config-router)# router-id 1.1.1.1
R1(config-router)# network 10.99.0.0 0.0.0.3 area 0
R1(config-router)# network 1.1.1.1 0.0.0.0 area 0
R1(config-router)# passive-interface GigabitEthernet0/0
R1(config-router)# end

Two commands do the HSRP work: standby 1 ip 10.0.0.1 creates group 1 with the virtual IP, and does not require group 1 to match the subnet's real addresses. standby 1 priority 150 and standby 1 preempt make R1 the preferred Active router that reclaims the role when it is healthy. The OSPF block shares the transit link and lets the PC reach 2.2.2.2 (and R1's own 1.1.1.1) through the gateway.

Part 6

Step 3 — Configure R2 (standby)

Router> enable
Router# configure terminal
Router(config)# hostname R2

! LAN interface with HSRP group 1 — same virtual IP, default priority
R2(config)# interface gigabitEthernet 0/0
R2(config-if)# ip address 10.0.0.3 255.255.255.0
R2(config-if)# no shutdown
R2(config-if)# standby 1 ip 10.0.0.1

! transit link and loopback
R2(config-if)# interface gigabitEthernet 0/1
R2(config-if)# ip address 10.99.0.2 255.255.255.252
R2(config-if)# no shutdown
R2(config-if)# interface loopback 0
R2(config-if)# ip address 2.2.2.2 255.255.255.255
R2(config-if)# end

R2(config)# router ospf 1
R2(config-router)# router-id 2.2.2.2
R2(config-router)# network 10.99.0.0 0.0.0.3 area 0
R2(config-router)# network 2.2.2.2 0.0.0.0 area 0
R2(config-router)# passive-interface GigabitEthernet0/0
R2(config-router)# end

R2 gets the same standby 1 ip 10.0.0.1 (the virtual IP must match) but keeps the default priority of 100, so it is the Standby. If R1 ever disappears, R2 seizes the virtual MAC and becomes Active. Because its G0/1 is passive for OSPF, it did not send Hellos into the LAN toward hosts — but it still advertises 10.0.0.0/24 into OSPF on the transit side.

Symmetry is the point The virtual IP must be identical on both routers; the real interface addresses must differ (10.0.0.2 vs 10.0.0.3). Priority is the only thing separating Active from Standby.
Part 7

Step 4 — Configure the PC

Point the PC at the virtual gateway, never at R1 or R2's real addresses:

C:\> ipconfig /ip 10.0.0.10 255.255.255.0 10.0.0.1

The PC should resolve 10.0.0.1 in its ARP cache to the virtual MAC 0000.0C07.AC01 once traffic flows. That address belongs to whichever router owns the HSRP role — which is exactly the property we are about to test.

Part 8

Step 5 — Verify the HSRP roles

On both routers:

R1# show standby brief
P indicates configured to preempt.
Interface   Grp  Pri P State    Active       Standby      Virtual IP
Gi0/0        1   150 P Active   local        10.0.0.3     10.0.0.1

R2# show standby brief
Interface   Grp  Pri P State   Active       Standby      Virtual IP
Gi0/0        1   100   Standby  10.0.0.2     local        10.0.0.1

Exactly one Active, one Standby. The full show standby adds the detail we care about: group 1, state, virtual IP and MAC, plus the timers:

R1# show standby
GigabitEthernet0/0 - Group 1
  State is Active
    4 state changes, last state change 00:02:11
  Virtual IP address is 10.0.0.1
  Active virtual MAC address is 0000.0c07.ac01
    Local virtual MAC address is 0000.0c07.ac01 (v1 default)
  Hello time 3 sec, hold time 10 sec
  Priority 150 (configured 150)
    Preemption enabled

Note the virtual MAC 0000.0c07.ac01 — group 1 encoded in the last two hex digits — and the hello 3 s / hold 10 s timers. If HSRP is stuck in Init or one router shows Active on both, compare priorities and the standby 1 ip statements.

Part 9

Step 6 — Baseline connectivity test

R1's G0/0 is the active gateway, and OSPF already knows both loopbacks. From the PC:

C:\> ping 10.0.0.1
Reply from 10.0.0.1: bytes=32 time=1ms TTL=255
Reply from 10.0.0.1: bytes=32 time=1ms TTL=255
Reply from 10.0.0.1: bytes=32 time=1ms TTL=255
Reply from 10.0.0.1: bytes=32 time=1ms TTL=255

C:\> ping 2.2.2.2
Reply from 2.2.2.2: bytes=32 time=1ms TTL=254
Reply from 2.2.2.2: bytes=32 time=1ms TTL=254
Reply from 2.2.2.2: bytes=32 time=1ms TTL=254
Reply from 2.2.2.2: bytes=32 time=1ms TTL=254

The TTL of 254 for 2.2.2.2 tells you the packet crossed two Layer 3 hops from the PC: PC → R1 (HSRP active) → R2 loopback. The gateway itself is one hop, hence 255. Save this baseline: after the failover the path changes but the ping must not.

Part 10

Step 7 — Fail over

Kill the active gateway exactly the way a real incident would: the router dies, or at least its LAN interface disappears from the segment.

R1(config)# interface gigabitEthernet 0/0
R1(config-if)# shutdown
R1(config-if)# end

Within seconds (default hold time 10 s, though a Hello will be missed immediately), R2 takes over:

R2# show standby brief
Interface   Grp  Pri P State   Active      Standby      Virtual IP
Gi0/0        1   100   Active  local       unknown      10.0.0.1

R2 is now Active and answers for the virtual IP and MAC. Retest connectivity from the PC — it must not change:

C:\> ping 10.0.0.1
Reply from 10.0.0.1: bytes=32 time=1ms TTL=255
Reply from 10.0.0.1: bytes=32 time=1ms TTL=255
Reply from 10.0.0.1: bytes=32 time=2ms TTL=255

C:\> ping 2.2.2.2
Reply from 2.2.2.2: bytes=32 time=1ms TTL=254
Reply from 2.2.2.2: bytes=32 time=1ms TTL=254

The reply for 2.2.2.2 still comes back at TTL 254, but the path is different: PC → R2 (as Active gateway) → R2's loopback, which is now only one forwarding decision by a remote router after the gateway — in real life you would see the path shift to whatever upstream R2 offers. The PC never re-configured; that is HSRP working.

Restore R1 and watch it reclaim the role:

R1(config)# interface gigabitEthernet 0/0
R1(config-if)# no shutdown
R1(config-if)# end
R1# show standby brief
Interface   Grp  Pri P State  Active     Standby     Virtual IP
Gi0/0        1   150 P Active local      10.0.0.3    10.0.0.1

Because R1 is configured with preempt, its higher priority (150) reclaims the Active role without an outage. Had preempt been missing, R2 would have stayed Active forever even though R1 was healthy again.

Exam tip — the failover vocabulary Standby → Active on failure; preempt is what lets a higher-priority router take the role back. Priority default 100, hello 3 s, hold 10 s, virtual MAC 0000.0C07.ACxx for group xx. Memorise these and failover questions answer themselves.
Part 11

Step 8 — Troubleshooting guide

SymptomProbablyTo check
HSRP stuck in InitThe interface is down or has no IP, or the virtual IP is on the wrong interface.show ip interface brief; the standby 1 ip statement must be on the LAN interface.
Both routers claim ActiveThey cannot hear each other's Hellos — different VLAN, or a filter dropping multicast HSRP traffic.Confirm both in the same broadcast domain; ping real addresses; check show standby timers.
Standby never becomes Active on failoverHSRP group or virtual IP mismatch, or the group is configured with different parameters on each side.show standby on both routers; group number and virtual IP must match.
PC cannot ping the virtual IPHost pointing at a real router address instead of 10.0.0.1, or the switch blocks the virtual MAC (sticky/MAC security).ipconfig on the PC; show mac address-table on S1 for 0000.0c07.ac01.
Higher-priority router does not become Activepreempt is missing.Add standby 1 preempt and re-verify.
PC reaches gateway but not 2.2.2.2OSPF not enabled or the passive interface hides the wrong side.show ip route for OSPF routes on both routers; show ip protocols.
Real-world caution Make the PC's gateway the virtual IP on every host. Configuring half the hosts with 10.0.0.1 and half with a router's real address defeats redundancy and creates split behaviour that is very hard to debug later.
Key terms

The vocabulary you need

Every term below appears in the lesson text above. Select one to read its definition, then use the quiz at the end to check what stuck.

Key terms · select a term

Part 12 · Your turn

Review

Check what you have learned with these review questions.

Review · 4 questions

Sources

Sources & references

  1. Cisco. CCNA (200-301) Exam Topics. cisco.com.
  2. IETF. Request for Comments (RFCs). rfc-editor.org.
  3. IANA. Internet Assigned Numbers Authority registries. iana.org.

Target exams: CCNA 200-301 v1.1 · CyberOps Associate 200-201. Last content verification: 2026-10-11.