Cisco Hot Standby Router Protocol – HSRP Preempt

What if we want a particular router to always be the Active HSRP Router whenever it’s up and running? For example, that router has bigger resources, higher bandwidth, or less latency over the other. Then, we can use HSRP Preempt.

Unlike VRRP, where preemption is enabled by default, here, we need to set the preempt command, which allows HSRP Router with the higher or highest priority to immediately assume Active status whenever it’s up. The default priority is 100, but we can change its value to manipulate the election process.

 

The Three HSRP Message Types:

Hello – Sent between Active and Standby devices every 3 seconds by default. If MLS2 does not hear from MLS1 in 10 seconds, MLS2 will take over the active role.

Resign – Sent by the active device when it’s going offline or ready to give up the active role for some other reason. This message tells MLS2 to be ready and take over the active role.

Coup – Used when a standby router wants to assume the active role (preempt).

hsrp preempt

HSRP Preempt Configuration

Layer 3 Switch 1

MLS1#conf t
MLS1(config)#interface FastEthernet0/1
MLS1(config-if)#ip address 172.16.1.3 255.255.255.0
MLS1(config-if)#standby 10 preempt
MLS1(config-if)#standby 10 ip 172.16.1.1
MLS1(config-if)#no shutdown
MLS1(config-if)#end

Layer 3 Switch 2

MLS2#conf t
MLS2(config)#interface FastEthernet0/1
MLS2(config-if)#ip address 172.16.1.2 255.255.255.0
MLS2(config-if)#standby 10 priority 90
MLS2(config-if)#standby 10 ip 172.16.1.1
MLS2(config-if)#no shutdown
MLS2(config-if)#end

Let us verify status by issuing the ‘show standby‘ command:

MLS1#show standby
FastEthernet0/1 - Group 10
State is Active
2 state changes, last state change 00:03:46
Virtual IP address is 172.16.1.1
Active virtual MAC address is 0000.0c07.ac0a
Local virtual MAC address is 0000.0c07.ac0a (v1 default)
Hello time 3 sec, hold time 10 sec
Next hello sent in 0.512 secs
Preemption enabled
Active router is local
Standby router is 172.16.1.2, priority 90 (expires in 8.336 sec)
Priority 100 (default 100)
Group name is "hsrp-Fa0/1-10" (default)

We can see MLS1 was elected as Active Router, Virtual IP (VIP) is 172.16.1.1, virtual MAC Address is 0000.0c07.ac0a, and Preemption is enabled. On the other hand, MLS2 acts as Standby Router.

MLS2#show standby
FastEthernet0/1 - Group 10
State is Standby
1 state change, last state change 00:02:40
Virtual IP address is 172.16.1.1
Active virtual MAC address is 0000.0c07.ac0a
Local virtual MAC address is 0000.0c07.ac0a (v1 default)
Hello time 3 sec, hold time 10 sec
Next hello sent in 1.200 secs
Preemption disabled
Active router is 172.16.1.3, priority 100 (expires in 10.192 sec)
Standby router is local
Priority 90 (configured 90)
Group name is "hsrp-Fa0/1-10" (default)

Now, we shut down MLS1 Fa0/1, and let’s see what happens.

MLS1(config-if)#
*Sep 4 17:42:04.003: %HSRP-5-STATECHANGE: FastEthernet0/1 Grp 10 state Active -> Init
MLS2#
*Sep 4 17:42:04.002: %HSRP-5-STATECHANGE: FastEthernet0/1 Grp 10 state Standby -> Active

MLS2 assumes an active role.

MLS2# show standby
FastEthernet0/1 - Group 10
State is Active
2 state changes, last state change 00:01:56
Virtual IP address is 172.16.1.1
Active virtual MAC address is 0000.0c07.ac0a
Local virtual MAC address is 0000.0c07.ac0a (v1 default)
Hello time 3 sec, hold time 10 sec
Next hello sent in 2.288 secs
Preemption disabled
Active router is local
Standby router is unknown
Priority 90 (configured 90)
Group name is "hsrp-Fa0/1-10" (default)

Now, let’s enable MLS1 Fa0/1 and see if the higher priority router preempts the lower priority router.

MLS1(config-if)#no shutdown
MLS1(config-if)#
*Sep 4 17:45:06.990: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to up
*Sep 4 17:45:07.994: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
MLS1(config-if)#
*Sep 4 17:45:08.040: %HSRP-5-STATECHANGE: FastEthernet0/1 Grp 10 state Listen -> Active

There you go, MLS1 (higher priority) once again, assumes the active role.

MLS1#show standby
FastEthernet0/1 - Group 10
State is Active
4 state changes, last state change 00:01:04
Virtual IP address is 172.16.1.1
Active virtual MAC address is 0000.0c07.ac0a
Local virtual MAC address is 0000.0c07.ac0a (v1 default)
Hello time 3 sec, hold time 10 sec
Next hello sent in 0.064 secs
Preemption enabled
Active router is local
Standby router is 172.16.1.2, priority 90 (expires in 9.520 sec)
Priority 100 (default 100)
Group name is "hsrp-Fa0/1-10" (default)

Download our Free CCNA Study Guide PDF for complete notes on all the CCNA 200-301 exam topics in one book.

We recommend the Cisco CCNA Gold Bootcamp as your main CCNA training course. It’s the highest rated Cisco course online with an average rating of 4.8 from over 30,000 public reviews and is the gold standard in CCNA training: