HSRP track with more objects
Cisco tracking specifically using the list feature to track multiple objects
Step 1
configure terminal
Enter global configuration mode.
Step 2
track track-number list boolean {and | or}
Configure a tracked list object, and enter tracking configuration mode. Thetrack-number can be from 1 to 500.
•boolean—Specify the state of the tracked list based on a Boolean calculation.
•and—Specify that the list is up if all objects are up or down if one or more objects are down.
•or—Specify that the list is up if one object is up or down if all objects are down.
Step 3
object object-number[not]
Specify the object to be tracked. The range is from 1 to 500. The keyword notnegates the state of the object, which means that when the object is up, the tracked list detects the object as down.
Note An object must exist before you can add it to a tracked list.
Step 4
delay {up seconds [downseconds] | [up seconds]down seconds}
(Optional) Specify a period of time in seconds to delay communicating state changes of a tracked object. The range is from 1 to 180 seconds.
Step 5
end
Return to privileged EXEC mode.
Step 6
show track object-number
Verify that the specified objects are being tracked.
Step 7
copy running-config startup-config
(Optional) Save your entries in the configuration file.
REMOVE
no track
here is example config and output:
SW1 | SW2 |
track 1 interface Ethernet0/0 line-protocol delay down 3 up 10 ! track 2 interface Ethernet0/1 line-protocol delay down 3 up 10 ! track 100 list boolean or object 1 object 2 ! interface Vlan200 ip address 10.10.10.10 255.255.255.0 standby 200 ip 10.10.10.1 standby 200 priority 110 standby 200 preempt standby 200 track 100 decrement 20 ! | track 1 interface Ethernet0/0 line-protocol delay down 3 up 10 ! track 2 interface Ethernet0/1 line-protocol delay down 3 up 10 ! track 100 list boolean and object 1 object 2 ! ! interface Vlan200 ip address 10.10.10.11 255.255.255.0 standby 200 ip 10.10.10.1 standby 200 preempt standby 200 track 100 decrement 20 |


verify hsrp


Lets shutdown 1 port on switch 1

now we shutdown other port also see if the hsrp shiftover take place.

both the interface down and match the equation so it decremented 20 from priority become standby

SW2 become active :

now we bring 1 interface on SW1 see preempt take place :
it will wait for 10 seconds.



SW2 – as soon as it see SW1 meet the requirement it preempt


happy Labbing !!!!!!