The problem state that DSW1 and DSW2 are configured as HSRP routes and DSW1 should be active router but instead, currently DSW2 is active.
Let's check DSW1's HSRP configuration.
DSW1#sh standby
Vlan10 - Group 10
State is Standby
4 state changes, last state change 00:02:07
Virtual IP address is 10.2.1.254
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.772 secs
Preemption enabled
Active router is 10.2.1.2, priority 100 (expires in 7.736 sec)
Standby router is local
Priority 90 (configured 150)
Track object 1 state Down decrement 60
IP redundancy name is "hsrp-Vl10-10" (default)
Yes, DSW1 is currently standby and not active router. Active router is 10.2.1.2 which is DSW2.
Let's check more detail of DSW1's HSRP configuration in VLAN 10.
DSW1#sh run int vlan 10
Building configuration...
Current configuration : 191 bytes
!
interface Vlan10
ip address 10.2.1.1 255.255.255.0
ip helper-address 10.1.4.5
standby 10 ip 10.2.1.254
standby 10 priority 150
standby 10 preempt
standby 10 track 1 decrement 60
end
---------------------------------------
Pay attention to "standby 10 track 1 decrement 60" which means it need to check more on "Track 1".
Let's check more from running-config.
DSW1#sh run | begin track
track 1 ip route 4.4.4.1 255.255.255.255 metric threshold
threshold metric up 1 down 2
!
track 10 ip route 4.4.4.4 255.255.255.255 metric threshold
threshold metric up 111 down 112
-----------------------
Two track objects are configured; track1 and track 10. Tracking objects are tracking to ip reachable to ip 4.4.4.4 which is the loopback IP of R4.
Metric threshold means if it's reachable, default "UP" value is 254 and "DOWN" value is 255
So, current DSW1 track object is 1 and it's tracking route to 4.4.4.1 which is unavailable. That's why, current DSW1's priority value will be (150 - 60 = 90) which is lower than the DSW2, which has default value 100.
It's mentioned in DSW1 's "sh standby" output.
Priority 90 (configured 150)
Track object 1 state Down decrement 60
IP redundancy name is "hsrp-Vl10-10" (default)
------------------------------------------------------
To fix it, change standby 10 track 1 decrement 60 DSW1's interface vlan 10 as follow.
DSW1(config)#int vlan 10
DSW1(config-if)#no standby 10 track 1 decrement 60
DSW1(config-if)#standby 10 track 10 decrement 60
------------------
Check again in DSW1 whether it's active or not
DSW1#sh standby
Vlan10 - Group 10
State is Active
5 state changes, last state change 00:00:47
Virtual IP address is 10.2.1.254
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.116 secs
Preemption enabled
Active router is local
Standby router is 10.2.1.2, priority 100 (expires in 8.184 sec)
Priority 150 (configured 150)
Track object 10 state Up decrement 60
IP redundancy name is "hsrp-Vl10-10" (default)