Manipulating HSRP Timers

Problem

You want to decrease the amount of time it takes for the backup router to take over after the primary router fails.

Solution

You can configure HSRP-enabled routers to recover more quickly after the primary HRSP router becomes unavailable with the standby timers configuration command:

Router1#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Router1(config)#interface FastEthernet0/1
Router1(config-if)#standby 1 ip 172.22.1.1
Router1(config-if)#standby 1 priority 120
Router1(config-if)#standby 1 preempt
Router1(config-if)#standby 1 timers 1 3 
Router1(config-if)#exit
Router1(config)#end
Router1#

If you change the HSRP timers on one router, then you must change the timers on all of the other routers in the same group:

Router2#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Router2(config)#interface FastEthernet1/0
Router2(config-if)#standby 1 ip 172.22.1.1
Router2(config-if)#standby 1 priority 110
Router2(config-if)#standby 1 preempt
Router2(config-if)#standby 1 timers 1 3
Router2(config-if)#exit
Router2(config)#end
Router2#

Discussion

By default, a router will send HSRP Hello packets every 3 seconds, and a standby router will declare itself active if it doesn’t hear any Hello packets from the active router for 10 seconds. The command in the example changes the timers from these default values to a one-second Hello period and three-second failover:

Router1(config-if)#standby 1 timers1 3

With this command, ...

Get Cisco IOS Cookbook, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.