Default gateway is used by host to get out of its local subnet. Cisco provides HSRP (Hot Standby Routing Protocol), VRRP (Virtual Router Redundancy Protocol) and GLBP (Gateway Load Balancing Protocol) for first hop redundancy. In HSRP and VRRP only one router is serving as an active virtual gateway router. But the GLBP can load balance the traffic between a group of routers. All of these routers will act as active forwarders. When a client sends an address resolution protocol (ARP) request, a member router of the GLBP will send its mac address. The next such request would receive a different mac address of the GLBP member router.
How to configure HSRP:
Say you have two switches SW1 and SW2 act as an HSRP peer. You have an SVI (Switched Virtual Interface) for vlan 400.
Go to the vlan 400 interface in both of the switches and enable HSRP:
(config)#interface Vlan 400
(config-if)#standby 1 ip 10.10.1.254
At the same time SW1 and SW2 will have its own IP address too:
SW1(conf)#int vlan 400
SW1(conf-if)#ip address 10.10.1.1 255.255.255.0
SW2(conf)#int vlan 400
SW2(conf-if)#ip address 10.10.1.2 255.255.255.0
10.10.1.254 will be the virtual gateway IP address and 1 will be the group for the HSRP.
How HSRP gets it mac address
HSRP uses a predefined mac address 0000.0c07.acXX. Here XX will be the group number. Therefore the mac address of the virtual gateway will be 0000.0c07.ac01.
HSRP Authentication
HSRP also supports authentication. You can choose between plaintext or MD5 authentication. Here’s how to configure MD5:
(config)#interface Vlan 400
(config-if)#standby 1 authentication md5 key-string MyHSRPSecurityKey
HSRP Related Commands:
#sh standby – use this command to verify your HSRP configuration
#debug standby event – In case you want to debug HSRP issues
#sh standby brief – this will help you to find out most of the standby related details including which router is active and which router is standby
How Active and Standby Election Happens
By default highest priority wins and become as active HSRP device. If the priority is same then highest IP address will become as tie-breaker.
How to set priority
SW1(config)#interface Vlan 400
SW1(config-if)#standby 1 priority 120
How Preemption works in HSRP
When you enable preempt the switch with the highest priority/IP address will always become as the new active device. if not already. This means, preempt will take effect immediately, but it might be a good idea to use a delay.
SW1((config)#interface Vlan 400
SW1(config-if)#standby 1 preempt
HSRP Timers
By default HSRP takes 10 seconds (hold time) to fail over in case of the active hsrp switch goes down.
SW1(config-if)#standby 1 timers ?
<1-254> Hello interval in seconds
msec Specify hello interval in milliseconds
SW1(config-if)#standby 1 timers 1 3
here hello timer is 1 sec and hold timer is 3 sec (hold timer need to be 3 times greater than hello timer)
HSRP Versions
There are 2 versions of HSRP – v1 and v2
| HSRPv1 |
HSRPv2 |
| Group Numbers |
0 – 255 |
0 – 4095 |
| Virtual MAC address |
0000.0c07.acXX (XX = group number) |
0000.0c9f.fxxx (XXX = group number) |
| Multicast Address |
224.0.0.2 |
224.0.0.102 |
If you want to configure v2:
(config)#interface Vlan 400
(config-if)#standby version 2
HSRP interface tracking
This will make sure the active router don’t have any failed interface that is critical to forward the traffic it receives. If an important interface fails, the other router/switch need to become as active
First track an interface with a number:
SW1(config)track 1 interface GigabitEthernet 0/3 line-protocol
Now reduce the priority if that interface fails:
SW2(config-if)#standby 1 track 1 decrement 55
To test this, you can shut that interface and see the other router/switch become as active HSRP device
Sometime the interface stay up but you can’t reach the upstream router. In this case, it might be a good idea to use IP SLA instead of interface tracking. IP SLA will check end to end connectivity.
You must be logged in to post a comment.