Achieve Network Redundancy with the HSRP Protocol
Reliability is an extremely important aspect in networking.
A network that has been designed without the provision of redundancy is a network with a limited life span.
Customers demand to have 100% service availability, while more and more time sensitive services are injected into networks such as voice and video over IP. These services need to be reliable, hence redundancy is a prerequisite in this case.
Cisco’s proprietary Hot Standby Routing Protocol (HSRP) has been designed to provide the software intelligence needed for your extra hardware to successfully provide redundancy in your network.
In this article we’ll take a look at HSRP’s operation in detail and examine, with the help of sample network diagrams, how to configure and enable HSRP.
There are several key points of HSRP’s operation. Some might say these are the things that put the hot in HSRP:
- For enabling HSRP all you need is 2 or more Cisco routers that will be configured to work in groups. These routers provide redundancy so that when the primary group router goes down, the standby router takes over all routing functions of the primary one.
- A group of routers running HSRP share a virtual MAC address and a virtual IP address. Therefore, the active router is responsible for routing packets destined for its virtual MAC address. The active router is also responsible for responding to ARP requests from hosts, providing them with its virtual MAC address.
On the other hand, hosts within a given group need to configure their default gateway with the virtual IP address of the router within their group and not with the IP address of the router’s physical interface.
- HSRP uses a configurable priority value to determine which HSRP router within a given group is to be the default master router.
The router with the highest priority becomes the master and the others become standby. The default priority is 100. In case more than one router shares the same priority value then the router with the highest IP address becomes the primary router.
- When HSRP is configured with Object Tracking, the priority of a router can change dynamically when the object that the router is tracking goes down.
For example if the line protocol state of an interface is used as a tracked object, then when it goes down the active router’s priority is decreased and the next available router with the higher priority becomes the active router.
HSRP enabled routers exchange HSRP HELLO packets between each other. These HELLO packets are destined to the multicast IP address 22.214.171.124 on UDP port 1985. It’s a good idea to write that down, because I have seen cases where a forgotten access list has prevented the transmission of these messages.
The router with the highest priority will become the active router. Regardless of which router becomes active and which becomes standby, all routers exchange HELLO packets at regular intervals.
The active router makes use of the virtual HSRP MAC address. This MAC address has a standard address scheme. It is composed of 0000.0C07.ACxy where xy is the configured HSRP group number in hexadecimal notation.
Configuring HSRP with Object Tracking
Configuring HSRP is not that hard. All the necessary configurations are performed in the Interface Configuration Mode of the router. Thes are all the steps:
- Configure the IP address on the Ethernet interface
- Configure the virtual IP address using the standby command and specify the HSRP group number
- Configure the desired priority value for the HSRP to select the appropriate master router within the specified group
- Configure standby preempt so that the master router will always be the primary router as long as it is available
- Specify the tracked object for the specified HSRP group
Similar configuration is done on all HSRP enabled routers. Remember to always configure standby routers with a lower priority then your master router.
Sample HSRP Enabled Network
The following diagram presents a typical HSRP network design. The necessary configuration commands for both routers are provided. Notice the configured priorities and the Virtual IP address which is also configured on the clients as default gateway.
Achieveing Load Sharing with HSRP
In cases you have more than one path to a given destination, HSRP can be configured in such a way as to provide load sharing behavior. The following sample network diagram presents such a case:
RouterA is the active router for group 1 and the standby router for group 2, while RouterB is the active router for group 2 and the standby router for group 1.
The configuration commands for the above network are:
Creating a Reliable Network with HSRP
With HSRP you can sleep peacefully at night. The sophistication of the protocol allows for dynamic and transparent network topology changes in order to achieve high network reliability with uninterrupted operation.
At any time you can check the status of HSRP and identify your master and standby routers by issuing the show standby command. A change in HSRP status triggers a syslog message alarm which indicates that a router switchover has taken place.