A typical challenge that needs to be addressed in the access layer is that of providing a redundant default gateway. This is typically accomplished with something known as a First Hop Resolution Protocol, or FHRP. A common, but proprietary FHRP is the Hot Standby Router Protocol. This solution, also known by the acronym HSRP, is often deployed in Cisco networks. This article serves as a brief introduction to HSRP, the problem it solves and a brief configuration.
The first thing that should be understood is what HSRP and other FHRPs are not. HSRP is not a routing protocol and solves a different problem than interior gateway protocols like OSPF, RIP or EIGRP. While HSRP provides redundancy to the network, it exists in the access layer and solves a specific problem. HSRP provides a redundant default gateway for network connected hosts.
If you think about it, hosts are typically configured with a single gateway. While this may set with DHCP or statically, it needs to be reliable. HSRP allows a single IP address to be shared between two or more routers. One router will be active. This active router will respond to arp requests and forward packets from the hosts. If that router fails, the active role will be assumed by another router in the same broadcast domain. This allows greater uptime to be achieved for network connected hosts.
Basic HSRP configuration is quite simple. The configuration is performed using the “standby” command in interface configuration mode. Below is a simple configuration that allows the default gateway of 192.168.1.1 to be shared by two routers. RouterA will forward packets. Upon its failure, RouterB will assume the active role and continue forwarding packets.
interface FastEthernet0/1 ip address 192.168.1.254 255.255.255.0 standby 1 ip 192.168.1.1 standby 1 priority 150 standby 1 timers 1 3 standby 1 preempt
interface FastEthernet0/1 ip address 192.168.1.253 255.255.255.0 standby 1 ip 192.168.1.1 standby 1 timers 1 3 standby 1 preempt
With this configuration, HSRP hello packets are sent every second. If a router goes for three seconds without seeing a hello, it will assume the active role. By configuring preemption on both devices and setting the priority at 150, RouterA should assume the active role when it is functioning.