Building a resilient network infrastructure is fundamental for any modern enterprise. When a primary gateway fails, traffic must seamlessly shift to a backup router to prevent downtime. This project guides IT students and junior engineers through designing and verifying a redundant Hot Standby Router Protocol (HSRP) setup using Cisco Packet Tracer. We will cover subnetting, VLANs, routing protocols, and the specific configuration required to enable high availability. By the end of this guide, you will understand how to configure HSRP groups, manage virtual IP addresses, and use Wireshark or packet analysis tools to verify failover behavior.
Prerequisites and Lab Topology Design
Before configuring devices, ensure your environment is set up correctly. You will need Cisco Packet Tracer installed with a license that supports advanced features like HSRP. The lab scenario involves two Layer 3 switches acting as gateways for a single VLAN containing end-user PCs.
Lab Components:
* Router/Switch A (Active): Assigned the virtual IP address of 192.168.10.1 with an HSRP priority of 110.
* Router/Switch B (Standby): Assigned the same virtual IP address of 192.168.10.1 but with a default priority of 100.
* VLAN Configuration: Both switches must have VLAN 10 created and active on all relevant interfaces.
* DHCP Server: One of the devices should act as a DHCP server, handing out addresses in the 192.168.10.0/24 range with the virtual gateway as the default route.
Subnetting Note: Ensure the subnet mask is consistent (e.g., 255.255.255.0) across all interfaces involved in the HSRP group. Misconfigured subnets will break communication between the routers and the clients.
Configuring VLANs and Basic Inter-VLAN Routing
The foundation of this project is a switched network where Layer 3 routing occurs at the gateway interface. First, configure the physical interfaces to trunk or access modes as needed, then create VLAN 10.
On Switch A and Switch B, enter global configuration mode:
enable
configure terminal
vlan 10
name Sales
exit
interface range gigabitethernet 0/1 - 2
switchport mode access
switchport access vlan 10
no shutdown
exit
Next, configure the SVI (Switch Virtual Interface) for VLAN 10 on both devices. This interface will hold the real IP addresses before HSRP takes over:
interface vlan 10
ip address 192.168.10.10 255.255.255.0
no shutdown
exit
Do the same for Switch B, assigning it a different real IP (e.g., 192.168.10.11) to ensure they are on the same broadcast domain but distinct L3 interfaces. Connect your PC hosts to these access ports and assign them static IPs in the .20-.30 range for testing, or configure a DHCP server.
Implementing HSRP Group 10 with Priority Tuning
HSRP allows multiple routers to share a virtual IP address. Clients only know the virtual IP, not which physical device is serving them. To create redundancy, we must assign priorities so one router becomes active and the other standby.
On Switch A (the intended Active router):
interface vlan 10
standby 10 ip 192.168.10.1
standby 10 priority 110
standby 10 preempt
exit
On Switch B (the Standby router):
interface vlan 10
standby 10 ip 192.168.10.1
standby 10 priority 100
standby 10 preempt
exit
Command Explanation:
* standby 10 ip: Defines the virtual MAC and IP address shared by both routers. Group ID ’10’ must match on both devices.
* priority: Determines election eligibility. Higher values win. Switch A has 110; Switch B has 100.
* preempt: Allows a router to reclaim the active role if its priority is higher than the current active router. Without this, a rebooted high-priority router might remain standby.
Verifying HSRP State and Failover Logic
Once configured, verify that the states are correct using the show standby brief command on both devices. You should see Switch A as “Active” and Switch B as “Standby.” Both will share the same virtual MAC address (derived from the group ID).
show standby brief
Expected Output Interpretation:
* Group: 10
* State: Active (on Switch A) / Standby (on Switch B)
* Virtual IP: 192.168.10.1
* Local IP: The real IP of the SVI on each device.
To test failover, manually shut down the active interface on Switch A:
interface vlan 10
shutdown
Check the status again. Switch B should transition to “Active” within a few seconds (default holdtime is typically 3 seconds). Traffic from clients will now flow through Switch B without dropping connections, demonstrating high availability.
Troubleshooting and Common Configuration Errors
Even in simulations like Packet Tracer, misconfigurations occur frequently. Here are common errors and how to fix them:
- Mismatched Group IDs: If the group number differs (e.g., one device uses group 10, the other uses group 20), HSRP adjacency will fail. Always verify
standby x ipnumbers match exactly. - Missing Preempt: If a router reboots with a higher priority but lacks the
preemptcommand, it may not take over immediately. Addstandby x preemptto ensure smooth recovery. - Authentication Mismatch: HSRP supports MD5 authentication. If enabled on one side but not the other, adjacency breaks. Ensure
standby x authentication md5 key-stringmatches on both devices if security is required. - DHCP Default Gateway Issues: If clients cannot reach the internet after failover, verify that the DHCP scope points to the virtual IP (192.168.10.1), not the real IP of the active router.
Advanced Verification Using Packet Analysis
To deepen your understanding, analyze the traffic flow using Wireshark or Packet Tracer’s built-in analysis tools. Filter for HSRP packets:
ip.proto.hsrp == 1
You will see Hello messages exchanged between the routers. When the active router fails, observe the transition in the Hello timers and the election of a new master. This visual confirmation reinforces theoretical knowledge about how redundancy protocols maintain network health.
Student Practice Task: Build Your Own Failover Lab
To solidify your skills, attempt the following task without looking at the steps above:
1. Create two switches connected via a trunk link.
2. Configure VLAN 20 with a subnet of 10.10.20.0/24.
3. Assign Switch A priority 150 and Switch B priority 120 for Group 20.
4. Set the virtual IP to 10.10.20.1.
5. Simulate a failure on Switch A and capture screenshots of the show standby output proving the failover occurred.
This exercise mirrors real-world scenarios where engineers must quickly diagnose and validate redundancy mechanisms before deploying them in production environments. Always remember to consult official Cisco documentation for specific version behaviors, as commands may vary slightly between IOS versions.
Educational-use notice: This tutorial is for learning and controlled lab use only. Test carefully, use backups, and obtain authorization before making changes. Do not run unfamiliar commands on production systems. We accept no responsibility for misuse, damage, data loss, or production issues.

