HSRP track object is a really cool stuff to modulate behaviour of HSRP.
This kind of object is usually used by means of ‘line-protocol’ feature. You can change Active Virtual Router, if an upstream interface comes down.
Such as :
DWS1(config)# track 20 interface FastEthernet 1/13 line-protocol DWS1(config)# interface fa 1/13 DSW1(config-if)#standby 10 track FastEthernet 1/13 60
If FastEthernet 1/23 comes down. HSRP priority is decremented by 60.
But, you can use track object with condition on routes. Object reacts when it is and is not between some values.
These values are scaled because of different kinds of metric. Imagine EIGRP and RIP metrics. It is so different. It is due to this, we seed metric in redistribution and here we scale it to be able to make condition on routes.
Imagine we want to change HSRP state if default route learned from gw becomes lower than 111.
Now imagine (it is purely imagination and not really in production useful, but …) your serial link is downgraded so your EIGRP metric will downside and your HSRP track object is under 111! Then HSRP state will become ‘standby’ on R1, and R2 HSRP state will become ‘active’.
DSW1#sh ip route 0.0.0.0 Routing entry for 0.0.0.0/0, supernet Known via "eigrp 10", distance 170, metric 284160, candidate default path Tag 10, type external Redistributing via eigrp 10 Last update from 10.1.4.5 on FastEthernet0/0, 00:40:24 ago Routing Descriptor Blocks: * 10.1.4.5, from 10.1.4.5, 00:40:24 ago, via FastEthernet0/0 Route metric is 284160, traffic share count is 1 Total delay is 10100 microseconds, minimum bandwidth is 100000 Kbit Reliability 128/255, minimum MTU 1500 bytes Loading 1/255, Hops 1 Route tag 10
And track object is :
DSW1#sh track Track 10 IP route 0.0.0.0 0.0.0.0 metric threshold Metric threshold is Up (EIGRP/284160/111) 2 changes, last change 01:01:12 Metric threshold down 112 up 111 First-hop interface is FastEthernet0/0 Tracked by: HSRP Vlan10 10
You will ask me : Why 111 ?
This value is due to metric scaling in HSRP track object. EIGRP routes are scaled by means of 2560. It is a default value which can be modofied by : track resolution.
So, if you divide 284160 by 2560 : you have 111 !
R1 HSRP state is active. Now, imagine (not production useful and possible) that serial line between ‘gw’ and ‘R1’ is downgraded, so EIGRP metric is modified and the value of the track object become lower than 111. So HSRP state become ‘standby’ and R2 become active on the HSRP group.
The real configurations is :
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 10 decrement 60 ! track 10 ip route 0.0.0.0 0.0.0.0 metric threshold threshold metric up 111 down 112
It is a great stuff. I like it.