Build a Network with HSRP Failover in Cisco Packet Tracer

Build a Network with HSRP Failover in Cisco Packet Tracer
Networking ATN Campus November 04, 2026 5 views

Build a Network with HSRP Failover in Cisco Packet Tracer

Learn how to configure Hot Standby Router Protocol (HSRP) between two Cisco routers to provide default gateway redundancy. In this practical Packet Tracer lab, you will configure an active router, a standby router, a virtual IP address, and test automatic failover when the active router becomes unavailable.


1. What Is HSRP?

HSRP stands for Hot Standby Router Protocol. It is a Cisco first-hop redundancy protocol that provides a highly available default gateway for devices on a LAN.

Instead of depending on a single router as the default gateway, HSRP allows two or more routers to share a virtual IP address.

One router operates as the Active router and forwards traffic. Another router operates as the Standby router and takes over if the active router fails.

Why Is HSRP Important?

  • Provides default gateway redundancy.
  • Reduces network downtime when a router fails.
  • Allows standby routers to take over forwarding responsibilities.
  • Improves network availability.
  • Supports priority-based active router selection.

2. How Does HSRP Work?

HSRP creates a virtual router using a shared virtual IP address and virtual MAC address.

Client devices use the virtual IP address as their default gateway rather than the physical IP address of either router.

              Virtual Gateway
              192.168.10.1
                    |
             +------+------+
             |             |
          Router R1     Router R2
           ACTIVE        STANDBY
             |             |
             +------+------+
                    |
                  Switch
                    |
                   PCs
    

When R1 is active, it forwards traffic. If R1 fails, R2 can become active and continue using the same virtual gateway address.

3. HSRP Router Roles

RoleDescription
Active RouterForwards traffic sent to the virtual gateway.
Standby RouterMonitors the active router and is ready to take over.
Virtual RouterRepresents the shared virtual IP and virtual MAC address.

4. Lab Requirements

  • Cisco Packet Tracer with HSRP-capable router models and IOS features
  • 2 Cisco routers (for example, 2911)
  • 1 Cisco 2960 switch
  • 2 PCs
  • Ethernet cables

Note: HSRP support depends on the router model and IOS image available in your Packet Tracer version. Use a model that supports the standby interface commands.

5. Network Topology

             Router R1
          192.168.10.2
             ACTIVE
                |
                |
              Switch
             /      \
            /        \
       Router R2     PC1
      192.168.10.3   192.168.10.10
        STANDBY          |
                         PC2
                    192.168.10.20

       Virtual Gateway: 192.168.10.1
    

Both routers and the PCs connect to the same LAN switch. In this lab, the router interfaces share one subnet.

6. IP Addressing Table

DeviceInterfaceIP AddressSubnet Mask
R1G0/0192.168.10.2255.255.255.0
R2G0/0192.168.10.3255.255.255.0
HSRP Virtual GatewayVirtual192.168.10.1255.255.255.0
PC1NIC192.168.10.10255.255.255.0
PC2NIC192.168.10.20255.255.255.0

Default gateway for both PCs: 192.168.10.1

7. Step 1 – Build the Network

  1. Open Cisco Packet Tracer.
  2. Add two HSRP-capable routers.
  3. Add one 2960 switch.
  4. Add two PCs.
  5. Connect both routers and PCs to the switch using Ethernet cables.

8. Step 2 – Configure Router R1

Configure R1's LAN interface with the physical IP address 192.168.10.2.

enable
configure terminal

interface gigabitEthernet 0/0
ip address 192.168.10.2 255.255.255.0
no shutdown
exit
    

9. Step 3 – Configure Router R2

Configure R2's LAN interface with the physical IP address 192.168.10.3.

enable
configure terminal

interface gigabitEthernet 0/0
ip address 192.168.10.3 255.255.255.0
no shutdown
exit
    

10. Step 4 – Configure HSRP on R1

We will configure R1 as the preferred Active router by assigning it a higher priority.

configure terminal

interface gigabitEthernet 0/0
standby 1 ip 192.168.10.1
standby 1 priority 110
standby 1 preempt
exit
    

Explanation:

  • standby 1 selects HSRP group 1.
  • standby 1 ip defines the shared virtual gateway IP address.
  • standby 1 priority 110 gives R1 a higher priority.
  • standby 1 preempt allows R1 to reclaim the Active role when it becomes available again and has the higher priority.

11. Step 5 – Configure HSRP on R2

Configure R2 as the lower-priority standby router.

configure terminal

interface gigabitEthernet 0/0
standby 1 ip 192.168.10.1
standby 1 priority 100
standby 1 preempt
exit
    

Both routers must use the same HSRP group number and virtual IP address on the shared LAN.

12. Step 6 – Configure PC IP Addresses

Configure the following static IP settings on both PCs.

PC1

  • IP address: 192.168.10.10
  • Subnet mask: 255.255.255.0
  • Default gateway: 192.168.10.1

PC2

  • IP address: 192.168.10.20
  • Subnet mask: 255.255.255.0
  • Default gateway: 192.168.10.1

Notice that both PCs use the HSRP virtual IP address as their default gateway.

13. Step 7 – Verify HSRP Status

Run the following command on R1 and R2:

show standby brief
    

Expected result:

  • R1 should show Active.
  • R2 should show Standby.
  • Both routers should show the virtual IP address 192.168.10.1.

You can also use:

show standby
show ip interface brief
    

14. Step 8 – Test Normal Network Connectivity

From PC1, ping the virtual gateway:

ping 192.168.10.1
    

Then ping PC2:

ping 192.168.10.20
    

Both tests should succeed when the network is correctly configured.

15. Step 9 – Test HSRP Failover

Now we will simulate an R1 failure.

  1. Confirm that R1 is Active and R2 is Standby.
  2. Open R1 CLI.
  3. Enter configuration mode.
  4. Shut down R1's LAN interface.
configure terminal
interface gigabitEthernet 0/0
shutdown
exit
    

Wait for the HSRP state transition, then check R2:

show standby brief
    

R2 should become Active and take responsibility for the virtual gateway.

From PC1, test again:

ping 192.168.10.1
ping 192.168.10.20
    

Some packets may be lost while the network changes over. Once failover completes, communication should resume through R2.

16. Step 10 – Restore the Active Router

Bring R1's interface back up:

configure terminal
interface gigabitEthernet 0/0
no shutdown
exit
    

Because R1 has a higher priority and preemption enabled, it should become Active again after it recovers and HSRP reconverges.

Verify the result using:

show standby brief
    

17. Understanding HSRP Priority and Preemption

FeaturePurpose
PriorityDetermines which eligible router is preferred to become Active.
PreemptAllows a higher-priority router to take over from a lower-priority Active router when it becomes available.
Virtual IPProvides the shared default gateway address used by clients.
Standby routerMonitors HSRP and is ready to take over.

The default HSRP priority is 100. A higher priority is preferred. If priorities are equal, the router with the higher IP address on the relevant interface is normally preferred.

18. Common HSRP Troubleshooting

ProblemPossible Solution
Both routers are not seeing each otherCheck physical connections, interface status, VLAN membership, and HSRP group settings.
No Active router appearsCheck whether the HSRP virtual IP and group configuration match.
Wrong router becomes ActiveCheck priority values and preemption configuration.
PC cannot reach the gatewayCheck that the PC uses the virtual IP as its default gateway.
Failover does not occurCheck HSRP neighbor status and whether the Active router's interface is actually unavailable.

19. Important HSRP Limitation

This basic lab demonstrates gateway failover when a router's LAN interface fails. However, HSRP does not automatically guarantee that a router will stop being Active when an unrelated upstream interface or external path fails.

In a production design, administrators can configure HSRP interface tracking so that a router reduces its priority when an important tracked interface goes down. Both routers also need suitable upstream connectivity and routing for end-to-end resilience.

HSRP provides first-hop gateway redundancy; it does not replace redundant switches, links, routing protocols, or resilient ISP connectivity.

20. Frequently Asked Questions

What does HSRP stand for?

HSRP stands for Hot Standby Router Protocol.

What is the purpose of the HSRP virtual IP?

The virtual IP is the shared default gateway address used by client devices. It remains the same when the Active router changes.

What happens when the Active router fails?

The Standby router can become Active and continue forwarding traffic using the virtual gateway.

What is the default HSRP priority?

The default HSRP priority is 100. A higher priority is preferred during Active router selection.

Does HSRP balance traffic between both routers?

Traditional HSRP uses one Active router per group. It is primarily a redundancy protocol, not a load-balancing protocol. Multiple HSRP groups can be designed to distribute gateway responsibilities across routers.

21. Practice Challenge

Try these additional tasks:

  1. Change R2's priority to 120.
  2. Enable preemption on R2.
  3. Verify which router becomes Active.
  4. Simulate a failure on R2 and observe R1.
  5. Research and configure HSRP interface tracking if supported by your Packet Tracer router.

Conclusion

In this lab, you learned how to configure HSRP between two Cisco routers, create a virtual default gateway, assign router priorities, and test automatic failover.

HSRP is an important concept in enterprise networking because it helps maintain network availability when a gateway router fails.

Learn Networking with ATN Campus

Build your networking knowledge with practical lessons, configuration exercises, and hands-on labs at ATN Campus.

  • CCNA and CCNP Training
  • Network Routing and Switching
  • Subnetting and IP Addressing
  • Network Security and CEH
  • Python for Network Automation
  • Practical Cisco Packet Tracer Labs

???? Want to learn networking? Visit ATN Campus.

???? Learn Networking. ???? Master Routing & Switching. ???? Practice with Real Labs. ???? Prepare for Certifications. ???? Build Your IT Career with ATN Campus.
Document ATN CAMPUS