Networking guides, explanations and reader checklists on whilenetworking.com

Packet Tracer Simulation: Build a Redundant HSRP Gateway Failover Architecture for High-Availability Networks

In enterprise networking, a single point of failure at the default gateway can cripple an entire organization. Hot Standby Router Protocol (HSRP) is the…

In enterprise networking, a single point of failure at the default gateway can cripple an entire organization. Hot Standby Router Protocol (HSRP) is the Cisco proprietary solution designed to eliminate this vulnerability by creating a virtual IP address shared between routers. This simulation guides IT students and junior engineers through building a robust HSRP failover architecture in Cisco Packet Tracer. You will configure VLANs, implement routing protocols, set up DNS and DHCP services, and verify high availability using Wireshark. By the end of this guide, you will understand how to design networks that maintain connectivity even when primary infrastructure fails.

Prerequisites and Lab Topology Design

Before launching Packet Tracer, ensure you have a basic understanding of subnetting, VLAN tagging, and static routing concepts. This lab assumes a standard environment with two Layer 3 switches acting as distribution layer devices and multiple end-hosts.

Lab Components:
* Routers/Switches: Two Catalyst 2960-X switches configured in Layer 3 mode (acting as the HSRP group members).
* End Hosts: Multiple PCs connected to Access Switches or directly to Distribution Switches.
* Servers: A DNS server and a DHCP server located on a separate network segment or VLAN.
* Software Tools: Cisco Packet Tracer (v7.x or later) and Wireshark (for traffic analysis).

Topology Overview:
The network is divided into two VLANs: VLAN 10 for users and VLAN 20 for servers. Both distribution switches connect to a core router via GigabitEthernet interfaces. HSRP Group 10 will be configured on the VLAN 10 interface, while HSRP Group 20 handles VLAN 20 traffic. The primary switch (Switch A) will hold the active virtual IP, while Switch B remains in standby mode with a lower priority.

Configuring Layer 3 VLANs and Interfaces

The foundation of this architecture is proper VLAN segmentation and interface configuration on both switches. You must enable IP routing globally before assigning IP addresses to SVI (Switch Virtual Interface) interfaces.

Step 1: Enable Routing and Create VLANs
On both Switch A and Switch B, enter global configuration mode and enable IP routing. This allows the switch to forward packets between VLANs if necessary, though in this specific HSRP design, inter-VLAN routing often happens at a core layer or via router-on-a-stick logic depending on the topology.

SwitchA> enable
SwitchA# configure terminal
SwitchA(config)# ip routing
SwitchA(config)# vlan 10
SwitchA(config-vlan)# name USER_VLAN
SwitchA(config-vlan)# exit
SwitchA(config)# vlan 20
SwitchA(config-vlan)# name SERVER_VLAN
SwitchA(config-vlan)# exit

Step 2: Configure Access Ports and SVIs
Connect PCs to access ports assigned to VLAN 10. Then, create the SVI for VLAN 10 on both switches. Assign a unique IP address to each physical interface and configure the HSRP virtual IP address (VIP).

SwitchA(config)# interface vlan 10
SwitchA(config-if)# ip address 192.168.10.1 255.255.255.0
SwitchA(config-if)# no shutdown
SwitchA(config-if)# exit

SwitchA(config)# interface FastEthernet0/1
SwitchA(config-if)# switchport mode access
SwitchA(config-if)# switchport access vlan 10

Repeat these steps on Switch B, ensuring the SVI IP addresses differ (e.g., .2 and .3). Do not assign the same IP to both; only the VIP should be shared.

Implementing HSRP for Gateway Redundancy

HSRP allows multiple routers to appear as a single virtual router. The key parameter is the priority, which determines which device becomes the active gateway. By default, the IP address with the highest value has priority 100. You can manually adjust this using the standby command.

Step 3: Configure HSRP Groups
On Switch A (Primary), set the HSRP group to 10 and assign a high priority of 110. On Switch B (Standby), set the same group but with a lower priority of 90. This ensures Switch A becomes the Active router.

SwitchA(config)# interface vlan 10
SwitchA(config-if)# standby 10 ip 192.168.10.254
SwitchA(config-if)# standby 10 priority 110
SwitchA(config-if)# standby 10 preempt
SwitchA(config-if)# exit

SwitchB(config)# interface vlan 10
SwitchB(config-if)# standby 10 ip 192.168.10.254
SwitchB(config-if)# standby 10 priority 90
SwitchB(config-if)# standby 10 preempt

Explanation of Commands:
* standby X ip Y: Defines the HSRP group number and the virtual IP address.
* priority Z: Sets the preference for becoming active. Higher is better.
* preempt: Allows the router to reclaim the active role if it returns from a failure state or if its priority exceeds the current active router’s.

Expected Output:
Execute show standby on both devices. You should see Switch A listed as “Active” with a virtual IP of 192.168.10.254, and Switch B listed as “Standby.” The timers (hello and hold-time) will be visible in the output.

Integrating DNS, DHCP, and Routing Protocols

A high-availability network requires more than just a redundant gateway; it needs centralized services that are also resilient. Configure a DHCP server on a dedicated VLAN or server interface to assign IP addresses dynamically. Similarly, configure a DNS server to resolve hostnames.

Step 4: DHCP and DNS Configuration
Configure the DHCP pool on your designated DHCP server (which could be a physical server connected to the network or a virtual machine in Packet Tracer). Define the range within the 192.168.10.0/24 subnet, excluding the VIP and static IPs used by servers.

DHCP_Server(config)# ip dhcp pool USER_POOL
DHCP_Server(dhcp-config)# network 192.168.10.0 255.255.255.0
DHCP_Server(dhcp-config)# default-router 192.168.10.254
DHCP_Server(dhcp-config)# dns-server 8.8.8.8

For routing, if you have multiple distribution switches connecting to an upstream network, enable OSPF or EIGRP. This ensures that if the direct link to the core fails, traffic can be rerouted through alternative paths.

Verification and Troubleshooting with Wireshark

Once configured, verification is critical. Use Packet Tracer’s built-in command line tools first, then move to packet capture for deeper analysis.

Step 5: Verification Steps
1. Ping Test: From a PC in VLAN 10, ping the virtual IP (192.168.10.254). It should respond immediately.
2. Failover Test: Shut down the SVI interface on Switch A using shutdown under the interface configuration mode. Wait for the HSRP timers to expire (default is 3 seconds hello, 10 seconds hold). The PC should now ping the VIP successfully, and the reply should source from Switch B’s MAC address.
3. Wireshark Analysis: Start a capture on the PC’s network adapter. Trigger the failover by shutting down Switch A. Filter for bootp or dns. Observe the ARP requests generated when the gateway changes. You will see the PC requesting the MAC address for the VIP again once the new active router responds.

Common Errors and Fixes:
* Error: “HSRP group mismatch.” Fix: Ensure both interfaces have the same group number (e.g., Group 10).
* Error: “VIP unreachable after failover.” Fix: Verify that the standby router’s interface is not administratively down and that routing protocols are advertising the network.
* Error: “Preempt not working.” Fix: Check that the preempt keyword is present in the configuration on both devices, or verify that the priority of the returning router is strictly higher than the current active one.

Student Practice Task and Industry Application

Student Practice Task:
Create a topology with three distribution switches. Configure HSRP Group 10 on all three. Assign priorities of 120, 100, and 80 respectively. Simulate a failure where the highest priority switch goes down, then the second-highest, verifying that traffic shifts to the third switch without manual intervention. Document the state changes using show standby detail.

Industry Application:
In real-world enterprise environments, HSRP is often combined with VRRP (Virtual Router Redundancy Protocol) for multi-vendor compatibility. Security considerations include ensuring that the virtual IP does not conflict with other management networks and that HSRP authentication is enabled to prevent unauthorized devices from joining the group. Always consult specific vendor documentation for security best practices regarding protocol timers and authentication mechanisms.

Conclusion

Building a redundant HSRP gateway failover architecture in Packet Tracer provides essential hands-on experience for network engineers. By configuring VLANs, SVIs, and HSRP priorities, you create a resilient network capable of handling hardware failures gracefully. Integrating DHCP and DNS ensures that hosts maintain connectivity and name resolution even during transitions. Remember to verify your setup using show standby and Wireshark captures to confirm that ARP tables update correctly during failover events. This foundational skill is indispensable for designing high-availability networks in modern IT infrastructures.

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.