Networking guides, explanations and reader checklists on whilenetworking.com

Packet Tracer Project: Build a Redundant HSRP Gateway Setup for High-Availability Failover Scenarios

In modern enterprise networks, a single point of failure at the default gateway can bring down an entire department or branch office. Hot Standby Router…

In modern enterprise networks, a single point of failure at the default gateway can bring down an entire department or branch office. Hot Standby Router Protocol (HSRP) provides a solution by creating a virtual IP address that clients use as their gateway, regardless of which physical router is actually forwarding traffic. This project guides you through building a redundant HSRP setup in Cisco Packet Tracer, integrating essential skills in subnetting, VLANs, routing, and troubleshooting with Wireshark. Whether you are an IT student mastering CCNA concepts or a junior engineer designing resilient infrastructure, this lab demonstrates how to configure active-standby redundancy, verify failover behavior, and diagnose connectivity issues effectively.

Prerequisites and Lab Topology Design

Before configuring devices, ensure your environment meets these requirements:
* Software: Cisco Packet Tracer (v7.x or later) and Wireshark (optional for traffic analysis).
* Hardware Simulation: Two routers (e.g., 1941 or 2800 series), one switch with multiple VLANs, and end-user devices (PCs/Laptops).
* Knowledge Base: Basic understanding of IP addressing, subnet masks, static routing, and HSRP fundamentals.

Lab Scenario Overview

Imagine a small business with two internet connections:
1. ISP-A connected via Router R1 (Primary).
2. ISP-B connected via Router R2 (Secondary).
The internal network uses VLANs to separate management traffic from user data. All PCs should use a virtual gateway IP of 192.168.10.254. If R1 fails, R2 must immediately take over without client reconfiguration.

Step 1: Network Planning and Subnetting

A robust design begins with careful planning. Allocate your IP ranges to avoid conflicts between the virtual gateway and physical interfaces.

  • VLAN 10 (User Data): 192.168.10.0/24
    • Virtual Gateway: 192.168.10.254
    • PC IP Range: 192.168.10.10 – 192.168.10.50
  • VLAN 20 (Management): 192.168.20.0/24
    • Reserved for router management access.

Actionable Step: Calculate host counts and assign subnets before placing devices in Packet Tracer. Ensure the virtual IP (192.168.10.254) is not assigned to any physical interface on R1 or R2, as this will cause routing loops or ARP conflicts.

Step 2: Configuring VLANs and DHCP Services

Configure the switch to handle VLAN tagging and assign an IP address to the SVI (Switch Virtual Interface). Next, enable DHCP so clients automatically receive the virtual gateway IP.

Switch Configuration

enable
configure terminal
vlan 10
 name USER_DATA
vlan 20
 name MANAGEMENT
interface vlan 10
 ip address 192.168.10.1 255.255.255.0
 no shutdown
interface vlan 20
 ip address 192.168.20.1 255.255.255.0
 no shutdown

DHCP Server Setup (on R1)

Configure R1 to hand out IP addresses for VLAN 10, pointing clients to the virtual gateway.

enable
configure terminal
ip dhcp pool USER_POOL
 network 192.168.10.0 255.255.255.0
 default-router 192.168.10.254
 dns-server 8.8.8.8
 exit

Note: In a real-world scenario, you might use ip helper-address on the router interface to forward DHCP requests to a dedicated server, but for this lab, we assign the pool directly to the active gateway.

Step 3: Implementing HSRP with Active-Standby Roles

This is the core of the project. We will configure HSRP group 10 on both routers. R1 will be the Active router, and R2 will be the Standby router.

Configuring Router R1 (Primary/Active)

enable
configure terminal
interface GigabitEthernet0/1
 ip address 192.168.10.1 255.255.255.0
 standby 10 ip 192.168.10.254
 standby 10 priority 110
 standby 10 preempt
 standby 10 authentication md5 key-string HSRPLabKey
 exit

Configuring Router R2 (Secondary/Standby)

enable
configure terminal
interface GigabitEthernet0/1
 ip address 192.168.10.2 255.255.255.0
 standby 10 ip 192.168.10.254
 standby 10 priority 100
 standby 10 preempt
 standby 10 authentication md5 key-string HSRPLabKey
 exit

Explanation of Commands:
* standby 10 ip: Creates the virtual IP address for the group.
* priority: Determines which router becomes active (higher wins). R1 has 110, R2 has 100.
* preempt: Allows a router to reclaim the active role if its priority increases or it recovers from a failure.
* authentication: Prevents rogue routers from joining the HSRP group by requiring a shared secret (MD5).

Step 4: Verification and Failover Testing

Once configured, verify that the setup works as intended using Packet Tracer’s simulation mode and CLI commands.

Expected Output

On R1, check the HSRP status:

show ip hsrp GigabitEthernet0/1

Illustrative Output:

Group 10 State is Active
   Virtual IP address is 192.168.10.254
   Virtual MAC address is 0000.5e00.0a0a
   Preempt enabled
   Authentication MD5
   Priority 110 (configured)
   Valid redirect source: no
   Current master local router.

Simulating Failover

To test high availability:
1. Switch to Simulation Mode in Packet Tracer (Simulate tab).
2. Click the “Delete” icon on Router R1’s interface or power off R1 entirely.
3. Observe the PC’s ping command. Initially, it fails.
4. Wait a few seconds; the HSRP timer expires, and R2 takes over.
5. The ping should resume automatically.

Using Wireshark for Deep Dive

If you have Wireshark installed on a simulated PC:
1. Capture traffic on the Ethernet interface.
2. Filter for hsrp.
3. You will see periodic Hello packets (every 3 seconds by default) exchanged between R1 and R2.
4. When R1 fails, you will observe R2 sending “Hello” packets with a new virtual MAC address or the same one depending on configuration, signaling it has taken ownership.

Step 5: Troubleshooting Common Errors

Even in a controlled lab, misconfigurations occur. Here are common pitfalls and how to fix them.

Error 1: IP Address Conflict
* Symptom: Intermittent connectivity or ARP table instability.
* Cause: Assigning an IP address on a physical interface that matches the HSRP virtual IP.
* Fix: Ensure the virtual IP (192.168.10.254) is unique and never assigned to a physical port.

Error 2: Authentication Mismatch
* Symptom: Routers ignore each other’s Hello packets; Standby remains in “Init” or “Listen” state.
* Cause: Different MD5 keys or missing authentication command on one router.
* Fix: Verify the key-string matches exactly (case-sensitive) on both devices.

Error 3: Missing Preempt Configuration
* Symptom: If R1 is manually shut down, R2 takes over, but when R1 comes back online, it does not reclaim the active role immediately.
* Cause: The preempt command was omitted or set to default (disabled).
* Fix: Add standby 10 preempt to ensure the higher-priority router always assumes control when available.

Student Practice Task and Industry Application

Student Challenge:
Modify the lab so that Router R2 becomes the active router by changing its priority to 110 in the configuration. Then, shut down R1 and verify that R2 remains active. Finally, restore R1’s priority to 110 and wait for failback. Document the time it takes for the state change using show ip hsrp.

Industry Application:
In a real workplace, this setup is critical for disaster recovery. If the primary data center router fails due to a hardware fault or power outage, the secondary site instantly assumes traffic handling. This minimizes downtime (RTO) and ensures business continuity. However, remember that in production environments, you must also configure tracking (track interface) so that if the upstream ISP link goes down, the standby router can detect this and take over, preventing blackholing traffic to a dead internet connection.

Conclusion

Building a redundant HSRP gateway setup in Packet Tracer provides a foundational understanding of network high availability. By configuring VLANs, DHCP, and HSRP with proper authentication and preemption, you create a resilient network architecture capable of handling failures gracefully. Always verify your configuration using show ip hsrp, simulate failover scenarios, and use tools like Wireshark to inspect protocol behavior. Remember that while this lab uses simulated hardware, the principles apply directly to Cisco IOS XE, NX-OS, and other enterprise operating systems used in industry today.

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.