Lab 8 — HSRP

Two routers, one gateway.

Give two routers a shared virtual IP, let them elect an active router, and then prove the gateway survives when a link — or a whole router interface — goes down. Work through it in order — check steps off, copy the commands, and finish with the show commands that prove the election and the failover.

Interactive lab — play with it

A simulated CLI for this lab. Click a router, type the commands, and watch the active role move only when the rules say it should — no preempt, no takeover.

A simulated CLI for this lab — click a router or a PC, type the commands, and watch the active router move only when the election really changes. The PCs point at the virtual IP 10.10.10.1, so their pings keep working through a failover. This models Lab 8’s commands only, not real routers: unsupported commands say so instead of faking it. Type ? for help and use Tab to complete a command.

Setting up…
Topologydrag to pan · double-click a device for its console
G0/1 · 10.10.10.0/24 (HSRP group 1)
G0/0 · 203.0.113.0/24
SP1203.0.113.1 · ISP
100%
Windows
Microsoft Windows [Version 10.0.19045.0]
(c) Microsoft Corporation. All rights reserved.
C:\>

Up/down arrows recall commands. The full command list is in the walkthrough below.

Interactive lab

Lab 8 — HSRP

Two routers, one virtual gateway. Make the LAN’s default gateway survive a router dying — first with priority and preemption, then with a tracked uplink.

Click a device to open its console, type the real commands, and check your work when you think it’s done. The lab checks each step as you go.

Walkthrough — commands in order

Two routers, one gateway. Give them a shared virtual IP, let them elect an active router, and then prove the gateway survives when a link — or a whole router interface — goes down.

  PC1 10.10.10.10 ──┐
  PC2 10.10.10.11 ──┤  10.10.10.0/24 — HSRP group 1, virtual 10.10.10.1
  R1 G0/1 10.10.10.2 ┘  R2 G0/1 10.10.10.3
  R1 G0/0 203.0.113.2 ──┐
  R2 G0/0 203.0.113.3 ──┤  203.0.113.0/24 ── SP1 203.0.113.1
        The lab pack uses Fa0/0/Fa0/1; the simulator uses G0/0/G0/1.

Where this shows up in the data center

I don’t configure HSRP on the data-center fabric — the fabric handles gateway redundancy its own way — but the failure mode is one I chase constantly: a host that suddenly can’t reach its gateway. The skill is the same: prove which router is active, prove the virtual IP answers, and prove traffic survives when a link drops. Same verify-before-you-change-it discipline as checking LLDP neighbors and optical levels before touching a fiber link.

R2(config)# interface g0/1
R2(config-if)# ip address 10.10.10.3 255.255.255.0
R2(config-if)# no shutdown
R2(config-if)# standby 1 ip 10.10.10.1
R1(config)# interface g0/1
R1(config-if)# ip address 10.10.10.2 255.255.255.0
R1(config-if)# no shutdown
R1(config-if)# standby 1 ip 10.10.10.1

The uplinks (G0/0) and the default routes to SP1 are already configured — the pack’s startup config.

R1# show standby
R2# show standby
C:\> ping 10.10.10.1
C:\> ping 203.0.113.1

Run the pings from PC1. Both should succeed — R2 is forwarding for the group.

R1(config)# interface g0/1
R1(config-if)# standby 1 priority 110
R1# show standby

R2 is still active. If R1 had taken over already, preempt would already be on.

R1(config)# interface g0/1
R1(config-if)# standby 1 preempt
R1(config-if)# standby 1 track g0/0
R2(config)# interface g0/1
R2(config-if)# standby 1 track g0/0

After preempt, R1 is active. Tracking decrements priority by 10 when the tracked interface goes down.

R1(config)# interface g0/0
R1(config-if)# shutdown
C:\> ping 10.10.10.1
R1(config)# interface g0/0
R1(config-if)# no shutdown

Bring G0/0 back up and R1 preempts back to active — its priority is 110 again and preempt is on.

R1(config)# interface g0/1
R1(config-if)# shutdown
C:\> ping 10.10.10.1
R1(config)# interface g0/1
R1(config-if)# no shutdown

The lab pack reboots R1 for this test; the simulator shuts the interface instead — same election, less waiting.

Verify it worked

Don’t trust the config until a show command proves it. These are the outputs you should see — if yours differ, that’s the troubleshooting.

R1# show standby

GigabitEthernet0/1 - Group 1
State is Active
6 state changes, last state change 00:00:00
Virtual IP address is 10.10.10.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
Next hello sent in 1.275 secs
Preemption enabled
Active router is local
Standby router is 10.10.10.3, priority 100 (expires in 8 sec)
Priority 110 (configured 110)
Track interface GigabitEthernet0/0 state Up decrement 10
Group name is hsrp-Gig0/1-1 (default)

R1# show standby brief

                     P indicates configured to preempt.
                     |
Interface   Grp  Pri P State   Active          Standby         Virtual IP
Gi0/1       1    110 P Active  local           10.10.10.3      10.10.10.1

Check yourself

Three questions from the exam angle. Tap to reveal the answer — say it out loud first.

Q1. R1 has priority 110 and R2 has priority 100. Why is R2 still active?

Q2. R1 tracks G0/0 and the uplink goes down. What happens to its priority, and why does that matter?

Q3. The active router changes from R2 to R1. Why don’t the PCs need to re-ARP for the gateway?

Next labs:

Keep going: Lab 9 — IPv6 Addressing & Static Routing addresses three routers and routes a ping end to end, or go back to Lab 7 — DHCP. All labs are on the labs hub.