Introduction
Hot Standby Router Protocol (HSRP) is a Cisco proprietary redundancy protocol that ensures high availability of the default gateway in a network. In this post, we will discuss how to configure HSRP on Cisco switches across multiple VLANs to ensure seamless failover and improve network reliability.
Understanding HSRP
HSRP enables multiple switches to work together to present a single virtual router to network hosts. This virtual router uses a shared virtual IP address, which clients rely on as their default gateway. If the active router fails, HSRP automatically transitions to the standby router, minimizing network downtime and ensuring continuous connectivity.
Requirements
Before starting the configuration, ensure the following:
- Two Cisco switches (SW1 and SW2).
- Both switches are connected through trunk ports and can communicate with each other.
- VLANs 10, 11, 12, 13, 14, and 15 are configured on both switches.
HSRP Configuration Steps
We will configure HSRP on two switches (SW1 and SW2) for six VLANs: 10, 11, 12, 13, 14, and 15. SW1 will be the active router for VLANs 10, 12, and 14, while SW2 will handle VLANs 11, 13, and 15.
SW1 Configuration
! VLAN 10 Configuration
interface Vlan10
ip address 10.10.10.2 255.255.255.0
standby 10 ip 10.10.10.1
standby 10 priority 110
standby 10 preempt
standby version 1
! VLAN 11 Configuration
interface Vlan11
ip address 10.10.11.2 255.255.255.0
standby 11 ip 10.10.11.1
standby 11 priority 95
standby version 1
! VLAN 12 Configuration
interface Vlan12
ip address 10.10.12.2 255.255.255.0
standby 12 ip 10.10.12.1
standby 12 priority 110
standby 12 preempt
standby version 1
! VLAN 13 Configuration
interface Vlan13
ip address 10.10.13.2 255.255.255.0
standby 13 ip 10.10.13.1
standby 13 priority 95
standby version 1
! VLAN 14 Configuration
interface Vlan14
ip address 10.10.14.2 255.255.255.0
standby 14 ip 10.10.14.1
standby 14 priority 110
standby 14 preempt
standby version 1
! VLAN 15 Configuration
interface Vlan15
ip address 10.10.15.2 255.255.255.0
standby 15 ip 10.10.15.1
standby 15 priority 95
standby version 1
SW2 Configuration
! VLAN 10 Configuration
interface Vlan10
ip address 10.10.10.3 255.255.255.0
standby 10 ip 10.10.10.1
standby 10 priority 95
standby version 1
! VLAN 11 Configuration
interface Vlan11
ip address 10.10.11.3 255.255.255.0
standby 11 ip 10.10.11.1
standby 11 priority 110
standby 11 preempt
standby version 1
! VLAN 12 Configuration
interface Vlan12
ip address 10.10.12.3 255.255.255.0
standby 12 ip 10.10.12.1
standby 12 priority 95
standby version 1
! VLAN 13 Configuration
interface Vlan13
ip address 10.10.13.3 255.255.255.0
standby 13 ip 10.10.13.1
standby 13 priority 110
standby 13 preempt
standby version 1
! VLAN 14 Configuration
interface Vlan14
ip address 10.10.14.3 255.255.255.0
standby 14 ip 10.10.14.1
standby 14 priority 95
standby version 1
! VLAN 15 Configuration
interface Vlan15
ip address 10.10.15.3 255.255.255.0
standby 15 ip 10.10.15.1
standby 15 priority 110
standby 15 preempt
standby version 1
Verification
To verify the HSRP configuration, use the following command to check the status of each VLAN's HSRP group:
show standby
This will display the active and standby routers for each VLAN. Make sure that the correct router is listed as active for each VLAN.
Troubleshooting
If you encounter issues with HSRP, follow these troubleshooting steps:
- Check VLAN Configuration: Ensure that VLANs are correctly configured and active on both switches.
- Verify HSRP Status: Use the
show standbycommand to confirm HSRP status on both switches. Check for any mismatched IP addresses or priorities. - Check Layer 2 Connectivity: Verify that switches can communicate with each other via trunk ports.
- Authentication Issues: HSRP version 1 does not support authentication, so ensure you're not attempting to configure authentication for HSRP version 1.
- Preemption Check: If preemption isn’t working, ensure that the correct switches have the
standby preemptcommand configured, but only on switches with a higher priority than the standby router.
Conclusion
This guide covered how to configure HSRP on Cisco switches for multiple VLANs. By implementing HSRP, you can improve the availability of your default gateway and reduce network downtime. Use the verification and troubleshooting steps to ensure everything is functioning properly.