Hands-On Lab: Implementing HSRP

This hands-on lab configures HSRP between two routers sharing a virtual gateway address, sets priority and preempt to control which router is active, and verifies automatic failover when the active router fails.

HSRP ConfigurationActive Standby FailoverHSRP Preempt

~3 min read · Updated Sep 22, 2026

Lab Objective

Configure HSRP on two routers sharing a virtual IP address, set priority and preempt so a specific router becomes active, and verify traffic automatically fails over to the standby router when the active router goes down.

Lab Purpose

HSRP eliminates a single default gateway from being a single point of failure, discussed earlier in this series, by letting two routers share a virtual IP address that hosts use as their gateway, with one router actively forwarding while the other stands ready.

Lab Topology

R1 (intended active) ---- Gi0/1 ---- Switch1
R2 (intended standby) ---- Gi0/1 ---- Switch1

R1: 192.168.15.2/24
R2: 192.168.15.3/24
Virtual IP: 192.168.15.1/24

PC: 192.168.15.10/24, gateway 192.168.15.1

Task 1: Configure Basic Addressing

Configure both routers' interfaces on the shared segment.

Task 2: Configure HSRP on Both Routers

Configure the virtual IP address on both routers using HSRP group 1.

Task 3: Configure Priority and Preempt on R1

Set R1's priority higher than the default and enable preempt so R1 becomes and remains active.

Task 4: Verify Active and Standby Roles

Confirm R1 shows as active and R2 as standby.

Task 5: Simulate a Failure and Verify Failover

Shut down R1's interface and confirm R2 automatically becomes active, then restore R1 and confirm it reclaims the active role.

Solution and Verification

R1(config)# interface gigabitethernet0/1
R1(config-if)# ip address 192.168.15.2 255.255.255.0
R1(config-if)# no shutdown

R2(config)# interface gigabitethernet0/1
R2(config-if)# ip address 192.168.15.3 255.255.255.0
R2(config-if)# no shutdown

R1(config)# interface gigabitethernet0/1
R1(config-if)# standby 1 ip 192.168.15.1
R1(config-if)# standby 1 priority 150
R1(config-if)# standby 1 preempt

R2(config)# interface gigabitethernet0/1
R2(config-if)# standby 1 ip 192.168.15.1

R1# show standby brief

Interface  Grp  Pri P State   Active    Standby   Virtual IP
Gi0/1      1    150 P Active  local     192.168.15.3  192.168.15.1

R2# show standby brief

Interface  Grp  Pri P State   Active        Standby   Virtual IP
Gi0/1      1    100   Standby 192.168.15.2  local     192.168.15.1

R1(config)# interface gigabitethernet0/1
R1(config-if)# shutdown

R2# show standby brief

Interface  Grp  Pri P State   Active   Standby   Virtual IP
Gi0/1      1    100   Active  local    unknown   192.168.15.1
-- R2 automatically became active within
-- a few seconds of R1 going down

R1(config-if)# no shutdown

R1# show standby brief
Gi0/1      1    150 P Active  local    192.168.15.3  192.168.15.1
-- R1 reclaimed the active role because
-- preempt was configured and its priority
-- (150) is higher than R2's (100)

Key Takeaway

Without preempt, R1 would remain standby indefinitely after recovering from its outage, even with a higher priority, since HSRP does not automatically reclaim the active role unless explicitly told to — this is the same behavior noted for Spanning Tree's root bridge election earlier in this series, and it is a detail worth double-checking whenever a "primary" device unexpectedly stays in a backup role after coming back online.

Written & researched by Dr. Shahin Siami

Related Articles

Hands-On Lab: Configuring Standard Numbered ACLs

This hands-on lab configures a standard numbered ACL to permit traffic from a specific subnet while denying everything else, applies it to the correct interface and direction, and verifies both permitted and denied traffic behave as expected.

Continue

Hands-On Lab: Configuring VRRP

This hands-on lab configures VRRP between two routers as the open-standard alternative to HSRP, using a real interface address as the virtual IP, and verifies Master/Backup roles and automatic failover behavior.

Continue

Hands-On Lab: Configure GLBP Redundancy

This hands-on lab configures GLBP between two routers to achieve load balancing across both routers simultaneously, verifying that different hosts receive different virtual MAC addresses and therefore route through different physical gateways.

Continue

Hands-On Lab: Verifying the EIGRP Database

This hands-on lab examines the EIGRP topology table directly, identifying the successor and feasible successor for a destination network, and demonstrates how this underlying data explains what appears in the IP routing table.

Continue

Hands-On Lab: Summarizing Routes with EIGRP

This hands-on lab manually configures interface-level route summarization in EIGRP, advertising a single aggregated route instead of several specific subnets, and verifies the automatically created Null0 discard route that prevents summarization-related loops.

Continue

Hands-On Lab: Passive Interfaces for EIGRP Updates

This hands-on lab configures a passive interface in EIGRP to stop routing updates from being sent out a LAN-facing interface while the network remains advertised, mirroring the same security and efficiency rationale covered earlier for OSPF passive interfaces.

Continue