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
Router1(config-if)#
FastEthernet0/1
standby 1 ip
Router1(config-if)#
172.22.1.1
standby 1 priority
Router1(config-if)#
120
standby 1 preempt
Router1(config-if)#standby 1 timers
Router1(config-if)#
1 3
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
Router2(config-if)#
FastEthernet1/0
standby 1 ip
Router2(config-if)#
172.22.1.1
standby 1 priority
Router2(config-if)#
110
standby 1 preempt
Router2(config-if)#standby 1 timers
Router2(config-if)#
1 3
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 timers
1 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.