Cisco proprietary HSRP protocol is a protocol for enabling a first hop fault tolerant router. Enabling your default gateway ip address to ‘live’ on more than one router. Back in the old days you had one router to exit a lan.
Once the router died or was out of service due to maintenance hosts in the LAN were not able to communicate out of the lan.
Cisco created a protocol which enabled two (or more) routers to listen to one ip address (layer 3) and one mac-address (layer 2).
Both layer 2 and 3 addresses have used in the redundancy setup otherwise you have to wait for arp entries to time-out.
While configuring you need to set the standby priority. Priority can be set between 0 and 255. Default value is 100.
When the HSRP Active interface has become unavailable, priority is decremented by 10. Choose you HSRP priorities smart.
In the topologies I have seen, the priorities chosen were 100 and 105 or 95 and 100. In all cases that were two router set-ups.
Of course you can be creative and create a three router set-up.
Communication between participating router is done through multicast ip’s HSRP v1 188.8.131.52:1985(UDP) and HSRP v2 184.108.40.206:1985(UDP).
Important use “preemt” : to get the router with the highest priority to recover to Active after an outage.
R1#sh run int e1/1 ! interface Ethernet1/1 description lan-1 ip address 172.16.10.2 255.255.255.0 ip helper-address 172.16.99.254 standby 1 ip 172.16.10.1 standby 1 priority 105 standby 1 preempt
R2#sh run int e1/1 ! interface Ethernet1/1 description lan-1 ip address 172.16.10.3 255.255.255.0 ip helper-address 172.16.99.254 standby 2 ip 172.16.10.1 standby 2 priority 100 standby 2 preempt
The configuration of the DHCP server is not very complicated.
ip dhcp excluded-address 172.16.10.1 172.16.10.10 ip dhcp excluded-address 172.16.10.254 ! ip dhcp pool lan-1 network 172.16.10.0 255.255.255.0 default-router 172.16.10.1 !
Be sure to set the default gateway to the HSRP address, otherwise you have a very neat solution which does not give you the fail save you need.