HSRP : Hot Standby Routing Protocol

Today we are going to talk about the protocol named as " HSRP- Hot Standby Routing Protocol". HSRP has 2 versions and they are HSRPv1 and HSRPv2. Let me explain the difference between them

HSRPv1 and HSRPv2: 

  • HSRPv1 uses the multicast address 224.0.0.2 to send hello packets while HSRPv2 uses the multicast address 224.0.0.102 to send hello packets 
  • The HSRPv1 group number can be from 0 to 255 while HSRP group number to the VLAN ID of a sub interface  HSRPv2 can use a group number from 0 to 4095 and a MAC address from 0000.0C9F.F000 to 0000.0C9F.FFFF. 
  • Standby MAC address in HSRPv1 is 0000.0c07.acXX, where XX is the HSRP group number
  • You cannot enable HSRPv1 and CGMP at the same time while HSRPv2 and CGMP leave processing are no longer mutually exclusive, and both can be enabled at the same time. 
Fig 1.1- HSRP Basic Topology

Basic Concept

  • HSRP states transition: Disable, Init, Listen, Speak, Standby, Active. 
  • Cisco Proprietary protocol.
  • One router in HSRP Primary or Active state, another in Standby HSRP state, all others in Listen HSRP State. 
  • HSRP Hello packets are exchanged every 3 seconds (hold time 10 secs) using multicast 224.0.0.2 at UDP port 1985. Only Standby HSRP router will monitor the Hello packet from Primary HSRP router. 
  • HSRP group ID can range from 0 to 255, most switches support only up to 16 unique HSRP group numbers. However, group id is only local significant on each interface. 
  • HSRPv1 is the default in IOS, HSRPv2 enables up to 4095 groups, virtual MAC is 0000.0C9F.FXXX (XXX=HSRP group), Hello packet is sent to multicast address 224.0.0.102. 
  • On HSRP router, virtual gateway IP address should be in the same subnet of actually physical interface Ip address. 
  • HSRP virtual gateway MAC address 0000.0c07.acxx, xx represents HSRP group ID. 
  • Make sure FHRP Active Router is the same as STP Root to avoid sub-optimal path. 

HSRP Router Election:
HRSP Primary or Active router election is based on priority value (0~255, 100 by default). Router with highest priority will become Primary router. If ties, the router with highest IP address on the HSRP involved interface will become active HSRP router.


HSRP Primary Router Preempt:

    1. An existing active router will stay active by default regardless of other routers’ priority and IP address. Election only happens when active or standby router is removed. But this default behavior can be overridden by Preempt. (Router who boots up firstly might become Active Router by default.)
    2. If hello message is missed for the duration of the hold-time timer (default 10 seconds), then the active HSRP router is presumed to be down. 
    3. Preempt action depends on your configuration, but it immediately happen by default, and the original primary will not take over immediately after it recovers. 
    • Configuration
      Switch(config)# interface vlan 100
      Switch(config-if)# ip address 192.168.10.10 255.255.255.0 

      Switch(config-if)# standby 1 priority 200 
      Switch(config-if)# standby 1 preempt
      Switch(config-if)# standby 1 ip 192.168.10.1 

      Switch(config-if)# standby 1 ip 192.168.10.2 secondary
      Switch(config-if)# standby 2 priority 100 
      Switch(config-if)# standby 2 preempt 
      Switch(config-if)# standby 2 ip 192.168.10.2 
      Switch(config-if)# standby 2 ip 192.168.10.1 secondary