Three options are available to optimize the operation of HSRP in
the campus network:

HSRP
Standby Preempt
In the event of an active router failure, a standby
router will assume the role of active router. When the original active router
comes back on-line, this new active router will retain the role of active
router even when the former active router has a higher priority. The Preempt
option allows a router to regain its role of active router even if there is an
existing active router on the segment.
HSRP Hello Message Timer Adjustment
An HSRP-enabled router sends
hello messages to indicate that the router is running and is capable of
becoming either the active or standby router. The hello message contains the
priority of the router as well as hellotime and holdtime
parameter values. The hellotime parameter value indicates the interval between
the hello messages that the router sends. The holdtime parameter value
indicates the amount of time that the current hello message is considered
valid. The standby timer includes an "msec" parameter for faster
failovers.
HSRP Interface Tracking
In some situations, it is not the status
of the HSRP interface itself that should cause an HSRP failover but the failure
of another route used by the active HSRP router. For example if the active
router has a WAN link back to corporate, and that WAN link goes down, it would
be desirable for the LAN interface of that router to give up its role as active
HSRP router so it could be assumed by a standby router with a functioning link
back to corporate. In this case, HSRP would be configured to track the status
of the WAN interface and give up its roll as active router if its WAN interface
went down.
HSRP Standby Preempt
The standby router
automatically assumes the active router role when the active router fails or is
removed from service. This new active router remains the forwarding router even
when the former active router with the higher priority regains service in the
network.
The former active router can be configured to resume the
forwarding router role from a router with a lower priority.
To
enable a router to resume the forwarding router role, enter the following
command in interface configuration mode:
Switch(config-if)#standby [group-number]
preempt [{delay} [minimum delay] [sync
delay]]
When the standby preempt
command is issued, the interface changes to the appropriate state.
To
remove the interface from preemptive status, enter the no standbygroup preempt command.
Example: Displaying HSRP
Preempt
The following example states that interface VLAN10 is
configured to resume its role as the active router in HSRP group 47, assuming
that interface VLAN10 on this router has the highest priority in that standby
group.
Switch#show
running-config
Building
configuration...
Current
configuration:
!
(text
deleted)
interface Vlan10
ip address
172.16.10.82 255.255.255.0
no ip
redirects
standby 47 priority 150
standby 47
preempt
standby 47 ip 172.16.10.110
Hello Message Timers
An HSRP-enabled router sends hello messages
to indicate that the router is running and is capable of becoming either the
active or standby router.
The hello message contains the priority of the
router and also hellotime and holdtime parameter values. The hellotime
parameter value indicates the interval between the hello messages that the
router sends. The holdtime parameter value indicates the amount of time that
the current hello message is considered valid.
If an active router sends
a hello message, receiving routers consider that hello message to be valid for
one holdtime. The holdtime value should be at least three times the value of
the hellotime. The holdtime value must be greater than the value of the
hellotime.

Both the
hellotime and the holdtime parameters are configurable. To configure the time
between hello messages and the time before other group routers declare the
active or standby router to be nonfunctioning, enter this command in interface
configuration mode:

Switch(config-if)#standbygroup-number timershellotime holdtime
HSRP Interface Tracking
In some situations, the status of an
interface directly affects which router needs to become the active router. This
is particularly true when each of the routers in an HSRP group has a different
path to resources within the campus network.
In this example
, router A and
router B reside in a branch office. These two routers each support a T1 link to
the headquarters. Router A has the higher priority and is the active forwarding
router for standby group 47. Router B is the standby router for that group.
Router A and B are exchanging hello messages through their E0 interfaces.
The T1 link between the active forwarding router for the standby group and
the headquarters experiences a failure. Without HSRP enabled, router A would
detect the failed link and send an ICMP redirect to router B. However, when
HSRP is enabled, ICMP redirects are disabled. Therefore, neither router A nor
the virtual router sends an ICMP redirect. In addition, although the S1
interface on router A is no longer functional, router A still communicates
hello messages out interface E0, indicating that router A is still the active
router. Packets sent to the virtual router for forwarding to the headquarters
cannot be routed.
Interface tracking enables the priority of a standby
group router to be automatically adjusted, based on availability of the
interfaces of that router. When a tracked interface becomes unavailable, the
HSRP priority of the router is decreased. The HSRP tracking feature reduces the
likelihood that a router with an unavailable key interface will remain the
active router.
In this example
, the E0
interface on router A tracks the S1 interface. If the link between the S1
interface and headquarters fails, the router automatically decrements the
priority on that interface and stops transmitting hello messages out interface
E0. Router B assumes the active router role when no hello messages are detected
for the specific holdtime period.
Configuring HSRP Tracking
To
configure HSRP tracking, enter this command in interface configuration
mode:
To disable interface tracking, enter the no standbygroup track command.
– 
The
command to configure HSRP tracking on a multilayer switch is the same as on the
external router, except that the interface type can be identified as a switch
virtual interface (vlan followed by the vlan
number assigned to that interface) or by a physical interface.
The internal routing device uses the same command as the external routing
device to disable interface tracking.
Multiple tracking statement may be
applied to an interface. An example of where this may be useful would be where
the currently active HSRP interface would only relinquish its status upon the
failure of two (or more) tracked interfaces.