Hey there! As a supplier of Cisco switches, I'm super stoked to walk you through the process of configuring HSRP (Hot Standby Router Protocol) on a Cisco switch. HSRP is a pretty nifty protocol that provides redundancy for your network. It allows multiple routers to work together to present a single virtual IP address to the network, so if one router goes down, another can take over without any major disruptions.
Prerequisites
Before we dive into the configuration, you'll need a few things. First off, you'll need a couple of Cisco switches. I'd recommend the Switch Cisco C1000 24t 4g L, Switch Cisco C2960, or the Switch Cisco Catalyst 9300. These switches are reliable and have great support for HSRP. You'll also need a basic understanding of networking concepts like IP addressing and subnetting.
Step 1: Enable HSRP on the Interfaces
Let's start by enabling HSRP on the interfaces of your Cisco switches. First, log in to your switch using the console port or SSH. Once you're in, enter global configuration mode by typing enable and then configure terminal.
Now, let's say you want to configure HSRP on VLAN 10. First, go to the interface configuration mode for the VLAN interface. You can do this by typing interface vlan 10.
On the first switch, we'll configure it as the active router. Type the following commands:
standby 1 ip 192.168.10.1
standby 1 priority 110
standby 1 preempt
Here's what these commands do:
standby 1 ip 192.168.10.1: This sets the virtual IP address for HSRP group 1 to192.168.10.1.standby 1 priority 110: The priority value determines which router will be the active router. A higher value means a higher priority. By default, the priority is 100, so setting it to 110 makes this switch more likely to be the active router.standby 1 preempt: This command allows the switch with a higher priority to take over as the active router if it comes back online after a failure.
On the second switch, we'll configure it as the standby router. Enter the same interface configuration mode for VLAN 10 and type these commands:
standby 1 ip 192.168.10.1
standby 1 priority 100
Here, we're using the same virtual IP address, but we're keeping the default priority of 100. This switch will become the active router if the first switch fails.
Step 2: Verify the Configuration
After you've configured HSRP on both switches, it's a good idea to verify the configuration. You can do this by typing show standby brief in privileged EXEC mode. This command will show you the status of the HSRP groups on the switch, including the virtual IP address, the active and standby routers, and the priority values.
If everything is configured correctly, you should see one switch listed as the active router and the other as the standby router. The virtual IP address should match the one you configured.
Step 3: Testing the Failover
To make sure that HSRP is working as expected, you can test the failover. First, check the status of the active router using the show standby brief command. Then, shut down the interface on the active router by typing shutdown in interface configuration mode.
After a few seconds, check the show standby brief command again. You should see that the standby router has taken over as the active router. Once you're done testing, you can bring the interface back up by typing no shutdown.
Step 4: Troubleshooting
If you run into any issues during the configuration or testing, here are a few things you can check:


- IP Addresses: Make sure that the virtual IP address is in the same subnet as the interfaces on the switches.
- Priority Values: Double - check that the priority values are set correctly. If the priorities are the same, the router with the highest IP address will become the active router.
- Preemption: If the active router doesn't take over after coming back online, make sure that the
preemptcommand is configured correctly.
Conclusion
Configuring HSRP on a Cisco switch is a great way to add redundancy to your network. By following these steps, you can ensure that your network stays up and running even if one of the routers fails.
If you're interested in purchasing any of the Cisco switches I mentioned earlier, like the Switch Cisco C1000 24t 4g L, Switch Cisco C2960, or the Switch Cisco Catalyst 9300, feel free to reach out to us for a detailed discussion. We're here to help you find the best solution for your network needs.
References
- Cisco IOS IP Application Services Configuration Guide
- Cisco HSRP Documentation
