Hot Standby Router Protocol (HSRP) provides failover for multiple routers on a common network segment.
This protocol allows a group of routers to serve as a primary or standby router for hosts on a segment by letting the active HSRP router respond to requests while others monitor for failure of the active router.
HSRP provides a virtual MAC address that is used by the active router running the protocol.
Devices running HSRP send and receive multicast UDP-based hello packets to detect router failure and to designate active and standby routers.
HSRP uses multicast packets to choose and maintain the active HSRP router based on configuration parameters.
NOTE
HSRP can run multiple instances on a single interface. Each instance is given a group number and has its own MAC and IP address. Because of this, each group's configuration and setting might be different. The [ group-number ] option is a possible configuration point in each command. A common use of this is on the subinterfaces of a Fast Ethernet or Gigabit Ethernet interface, where the HSRP group number can be set to match the VLAN number. If no group-number is configured, the default is group 0. There are some exceptions to multiple groups: A Cisco 1000, 2500, 3000, or 4000 series router using the LANCE hardware for the Ethernet controller cannot support multiple groups. Token Ring interfaces can support only the group numbers 0, 1, and 2, and they support a maximum of three groups per interface.
(Required) Configure the interface with an IP address:
(interface) ip address ip-address subnet-mask
In order to run HSRP, the interface must have an IP address and be an active IP interface. This address is not used when you configure the host, but it is required for IP processing and therefore must be configured.
(Required) Configure HSRP standby groups on the router:
(interface) standby [ group-number ] ip ip-address [ secondary ]
HSRP is configured on the interface with the standby command. The standby group and IP address are configured on all the routers that participate in HSRP. The IP address configured here is the one that will be used as the default gateway by the hosts on the segment.
The option group-number is added to specify multiple groups for the router. This option allows you to split the load between multiple routers on the segment while still providing redundancy for the hosts. The secondary option indicates that the standby IP is a secondary address. This is useful when the interface is connected to a network that provides routing for a secondary network.
NOTE
HSRP uses the virtual MAC address of 0000.0c07.ac XX, where XX is the hexadecimal value of the group number.
(Optional but recommended) Set the priority for the HSRP interface:
(interface) standby [ group-number ] priority priority
Configure the HSRP priority for the interface and group. This command lets you select which router acts as the primary router for the group. The router with the higher priority number becomes the active router. If there is a tie, the route with the higher configured primary IP address becomes the active router. The default priority is 100.
(Optional but recommended) Set the interface to preempt to assume the role of active:
(interface) standby [ group-number ] preempt [ delay delay ]
This allows the router to preempt (take over) if it determines that it has a higher priority. During standard HSRP operation, when the routers come up, an active router is selected from the candidates. If a router with a higher priority is activated on the segment, or if it goes down and then goes up, it does not take over unless the interface is configured to preempt. The delay option causes the router to delay by the number of seconds specified before preempting the current router. The default is 0 seconds.
NOTE
The commands standby priority and standby preempt can be specified at the same time or independently.
(Optional) Track an interface to determine which router should be active:
(interface) standby [ group-number ] track interfacetype interfacenumber [ decrementvalue ]
This command allows you to decrement the priority value for a standby group by tracking the state of an interface. If the tracked interface fails, the standby group's priority for this interface is reduced by the amount of the decrement value specified. When this occurs, any router with a higher priority and the preempt command configured assumes the role of active router. If no decrement value is configured, the default is 10.
(Optional) Change the standby timers:
(interface) standby [ group-number ] timers hellotimer holdtime
This configures the period of time in seconds in which the routers send out hello packets to indicate their status and the amount of time required before the router is considered down. The value for the hold time should always be greater than or equal to 3 times the hello timer. The timers configured on the active router always override those of the other routers in the group. The defaults are hello = 3 hold = 10.
(Optional) Specify authentication for HSRP:
(interface) standby [ group-number ] authentication string
This command configures an authentication for the standby group. All routers in the group must be configured with the same string. If a router does not have the appropriate string, it cannot become an active or standby router.
(Optional) Configure HSRP to use the burned-in address (BIA) instead of the virtual MAC address:
(interface) standby use-bia
This command allows the active router to use the BIA associated with the interface instead of the virtual group address. This is useful in Token Ring environments when devices reject ARP replies with a functional MAC address. It is also useful in preventing RIF confusion when the router is in a source route environment and runs on multiple rings. To inform all hosts on the LAN about a change in active HSRP peers, the new active HSRP router sends a gratuitous ARP so that it can answer its own request with the new MAC address.
Figure 6-1 shows two routers configured to run HSRP. These routers are running two groups to allow the active load to be split between the two devices. If either router fails, all hosts are served by the remaining router. The routers have also been set up to track the serial interface. If the serial interface fails, the priority is lowered by 10, allowing the standby router to preempt for that group.
Katie interface ethernet 0 ip addrress 172.16.18.3 255.255.255.0 standby 10 ip 172.16.18.1 standby priority 200 standby preempt standby track serial 0 10 standby 15 ip 1.2.2.2 standby priority 190 standby preempt _______________________________________________________________________ Logan interface ethernet 0 ip address 172.16.18.4 255.255.255.0 standby 10 ip 172.16.18.2 standby priority 195 preempt standby 15 ip 1.2.2.2 standby priority 200 preempt standby track serial 0