Section 9.4: Configuring HSRP
The active components of the configuration are HSRP standby interface, standby preempt, and hello
9.4.1: Configuring an HSRP Standby Interface
You use the following command in interface configuration mode to configure a router as a member of an
HSRP standby group:
Router(config-if)#standby [ group_number ] ip ip_address
In this command, you can include the optional group_number argument to indicate the HSRP group to which the interface belongs. If you specifying a unique group_number in the standby command, you would create multiple HSRP groups. The default group is 0.
After the standby ip command is issued, the interface will change to the appropriate state.
To remove an interface from an HSRP group, you can use the no standby group_nvmber ip command.
9.4.2: Configuring HSRP Standby Priority
The network administrator can assign a priority value to each router in a standby group, allowing the administrator to control the order in which active routers for that group are selected. Use the following command in interface configuration mode to set the priority value of a router:
Router#(config-if) standby group_number priority priority_value
Use the no standby priority command to reinstate the default standby priority value.
9.4.3: Configuring HSRP Standby Preempt
The standby router automatically assumes the active router role when the active router fails or is removed from service. However, the 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 by using the following command in interface configuration mode on the active router:
Router(config-if)#standby group_number preempt
After the standby preempt command is issued, the interface changes to the appropriate state.
9.4.4: Configuring the Hello Message Timers
An HSRP-enabled router sends hello messages to indicate that the router is operational and is capable of becoming either the active or standby router. The hello message contains the priority of the router, as well as a hellotime and holdtime value. The hellotime value indicates the interval between the hello messages that the router sends. The holdtime value contains 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 hellotime and the holdtime parameters are adjustable. However, the holdtime value should be at least three times the hellotime value. Use the following command in interface configuration mode to configure the time between hellos and the time before other group routers declare the active or standby router to be nonfunctioning:
Router(config-if)#standby [ group_number ] timers hellotime holdtime
The hellotime argument indicates the hello time in seconds. This value is an integer ranging from 1 through 255 and has a default is 3 seconds. The holdtime argument indicates the time, in seconds, before the active or standby router is declared to be down. This is also an integer from 1 through 255 but has a default value of 10 seconds.
Use the no standby group timers command to reinstate the default standby timer values.
9.4.5: HSRP Interface Tracking
The status of an interface directly affects which router needs to become the active router, particularly when each of the routers in an HSRP group has a different path to resources within the campus network. 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.
9.4.6: Configuring HSRP Tracking
Use the following command in interface configuration mode to configure HSRP tracking:
Router(config-if)#standby [ group_number ] track type interface_number [ interface_priority ]
The optional group_number argument for this command indicates the group number on the interface to which the tracking applies. If no group_number is specified, the default group number (o) is assumed. The type argument and the interface_number argument indicate the interface type and the interface number to be tracked. Finally the optional interface_priority argument indicates the amount by how much the HSRP priority for the router is decreased when the interface becomes disabled. The priority of the router is also increased by this amount when the interface becomes available again. The default interface_priorityvalue is 10. You can use the no standby group_number track command to disable interface tracking.
9.4.7: HSRP Status
Use the following command in privileged exec mode to display the status of the HSRP router:
Router#show standby [ type_number ] [ group_number ] [ brief ]
The brief option displays a summary of each standby group. If these optional interface parameters are not indicated, the show standby command displays HSRP information for all interfaces.