Using HSRP Preempt
Problem
You want to ensure that a particular router is always selected as the “active” HSRP router, whenever it is up and functioning.
Solution
You can ensure that a particular router is always selected as the HSRP active router if it is available. On the router that you wish to make your primary active HSRP router, you need to set a higher priority level and use the standby preempt command:
Router1#configure terminalEnter configuration commands, one per line. End with CNTL/Z. Router1(config)#interfaceRouter1(config-if)#FastEthernet 0/1standby 1 ipRouter1(config-if)#172.22.1.1standby 1 priorityRouter1(config-if)#120standby 1 preemptRouter1(config-if)#exitRouter1(config)#endRouter1#
The only difference on the second router is the HSRP priority level. The lower priority in conjunction with the standby preempt command forces the second HSRP router to remain in a standby state unless the primary router becomes unreachable. Then, when the primary router becomes available again, the secondary router will relinquish its role and allow the primary router to take over as the active HSRP router:
Router2#configure terminalEnter configuration commands, one per line. End with CNTL/Z. Router2(config)#interfaceRouter2(config-if)#FastEthernet 1/0standby 1 ipRouter2(config-if)#172.22.1.1standby 1 priorityRouter2(config-if)#110standby 1 preemptRouter2(config-if)#exitRouter2(config)#endRouter2#
You can also configure this feature by specifying the preempt keyword ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access