Recent from talks
Nothing was collected or created yet.
Hot Standby Router Protocol
View on WikipediaIn computer networking, the Hot Standby Router Protocol (HSRP) is a Cisco proprietary redundancy protocol for establishing a fault-tolerant default gateway. Version 1 of the protocol was described in RFC 2281 in 1998. Version 2 of the protocol includes improvements and supports IPv6 but there is no corresponding RFC published for this version.
The protocol establishes an association between gateways in order to achieve default gateway failover if the primary gateway becomes inaccessible. HSRP gateways send multicast hello messages to other gateways to notify them of their priorities (which gateway is preferred) and current status (active or standby).
Operation
[edit]The primary router with the highest configured priority will act as a virtual router with a pre-defined gateway IP address and will respond to the ARP or ND request from machines connected to the LAN with a virtual MAC address. If the primary router should fail, the router with the next-highest priority would take over the gateway IP address and answer ARP requests with the same MAC address, thus achieving transparent default gateway failover.
| HSRP version | IP protocol | Group address | UDP port | Virtual MAC address range |
|---|---|---|---|---|
| 1 | IPv4 | 224.0.0.2 (all routers)[1] | 1985 | 00:00:0c:07:ac:XX |
| 2 | IPv4 | 224.0.0.102 (HSRP)[1] | 1985 | 00:00:0c:9f:fX:XX |
| IPv6 | ff02::66 | 2029 | 00:05:73:a0:0X:XX |
In the virtual MAC address, Xs represent the group ID in hex.
HSRP is not a routing protocol as it does not advertise IP routes or affect the routing table in any way.[citation needed]
HSRP has the ability to trigger a failover if one or more interfaces on the router go down. This can be useful for dual branch routers each with a single link back to the gateway. If the link of the primary router goes down, the backup router will take over the primary functionality and thus retain connectivity to the gateway.
Version 2
[edit]Version 2 of the protocol introduces stability, scalability and diagnostic improvements. It is not compatible with version 1 HSRP.[1] There is no RFC for version 2 of the protocol.
- Provides IPv6 support
- Increases the number of HSRP groups from 256 to 4096
See also
[edit]- Virtual Router Redundancy Protocol - standards-based alternative to HSRP
- Gateway Load Balancing Protocol - Cisco proprietary router redundancy solution providing load balancing
- Common Address Redundancy Protocol - open source, patent-free and unrestricted alternative to HSRP and VRRP
- First-hop redundancy protocols - List of default gateway redundancy protocols
References
[edit]- ^ a b c First Hop Redundancy Protocols Configuration Guide, Cisco IOS Release 15M&T, Cisco Systems, retrieved 2016-05-28
Further reading
[edit]- Gruszczyk, Katarzyna; Szukała, Krzysztof. "Configuration of HSRP® Protocol on the sample network topology". Supervised and led by Dawid Mentel. Archived from the original on 2009-06-06.
External links
[edit]Hot Standby Router Protocol
View on GrokipediaIntroduction
Definition and Purpose
The Hot Standby Router Protocol (HSRP) is a Cisco-proprietary First Hop Redundancy Protocol (FHRP) designed to enable multiple routers on a local area network (LAN) to cooperate and function as a single virtual default gateway for end hosts.[2][5] This protocol allows hosts to maintain a consistent gateway address without needing to reconfigure their default routes, even during router failures.[6] The primary purpose of HSRP is to provide high availability and transparent failover for the first-hop router in IP networks, minimizing downtime by enabling a standby router to assume the role of the active router if the latter fails.[2][5] In environments such as enterprise LANs with multiple access routers, HSRP ensures continuous connectivity for hosts that rely on static default gateway configurations, protecting against single points of failure without disrupting ongoing traffic.[6] While it operates in an active/standby model within each group—limiting true load sharing to configurations using multiple HSRP groups—it supports IPv4 in both versions and extends to IPv6 in version 2, enhancing redundancy for modern networks.[2][7] At its core, HSRP achieves this redundancy by assigning a shared virtual IP address and virtual MAC address to the routers in a group, which end hosts use as their default gateway.[5][6] The active router in the group responds to ARP requests for the virtual IP using the virtual MAC, forwarding traffic on behalf of the hosts, while the standby router monitors the active one and seamlessly takes over these addresses upon detecting a failure, ensuring no interruption in gateway services.[2][8] This mechanism is particularly suited for multi-access LANs like Ethernet, where hosts cannot easily adapt to router changes.[9]History
The Hot Standby Router Protocol (HSRP) was introduced by Cisco Systems in 1998 as a proprietary protocol designed to provide gateway redundancy in IP networks, enabling multiple routers to share a virtual IP address and failover seamlessly in the event of a router failure.[2] Initially developed to address single points of failure in enterprise LANs, HSRP allowed hosts to use a single default gateway while ensuring high availability through an active-standby router election mechanism.[10] The initial specification for HSRP Version 1 was documented in RFC 2281, published in March 1998 as an informational RFC by the Internet Engineering Task Force (IETF), focusing on IPv4 support and basic failover capabilities without native IPv6 integration or advanced authentication.[10] This marked a partial transition from a fully proprietary Cisco implementation to a more openly documented standard, though it remained Cisco-specific and did not achieve full IETF standards-track status. HSRP Version 1 quickly gained traction in Cisco IOS-based networks for its simplicity in providing first-hop redundancy.[2] HSRP Version 2 was developed in the early 2000s and first integrated into Cisco IOS Release 12.3(4)T in 2004, introducing enhancements such as IPv6 support, MD5 authentication for improved security, and multicast addressing to replace broadcast hellos, along with expanded scalability through support for up to 4096 group numbers.[11] Unlike Version 1, Version 2 has no corresponding IETF RFC and remains proprietary, but it addressed limitations in authentication and network efficiency, facilitating broader adoption in evolving enterprise environments. No major new protocol versions have been released since Version 2, though ongoing enhancements in authentication methods and scalability features have been incorporated into subsequent Cisco IOS releases. Subsequent enhancements, such as support for IPv6 stateful failover and integration with SD-WAN in IOS XE 17.x releases through 2025, have maintained its relevance without introducing new protocol versions.[11] HSRP has been widely adopted in enterprise networks since its inception, integrated deeply into Cisco IOS and IOS-XE platforms to support redundant gateway configurations in data centers and campus environments.[2] Its relevance persists into modern architectures, including software-defined wide area networks (SD-WAN), where Cisco IOS-XE Release 17.x enables HSRP Version 2 configuration and authentication via CLI templates on Catalyst SD-WAN platforms, with support continuing in releases as of 2025.[1]Protocol Fundamentals
Key Components
The Hot Standby Router Protocol (HSRP) relies on several core components to provide first-hop redundancy in IP networks. The active router is the device responsible for forwarding packets on behalf of the HSRP group, serving as the default gateway for hosts until a failure occurs.[2] The standby router acts as the backup, monitoring the active router and assuming its role if the active fails, ensuring minimal disruption to traffic flow.[12] Together, these form part of the virtual router, a logical entity that shares a virtual IP address and MAC address across group members, allowing transparent failover without host reconfiguration.[2] HSRP groups are identified by a group number, which distinguishes multiple instances on the same interface; in version 1, this ranges from 0 to 255, while version 2 extends it to 0 to 4095.[12] Each router in the group is assigned a priority value, a configurable integer from 0 to 255 with a default of 100, that influences the election of the active router—the highest priority wins.[2] Preemption is a mechanism that enables a router with a higher priority to reclaim the active role after recovering from a failure, though it is disabled by default to avoid instability during recovery periods.[12] Communication within the HSRP group depends on hello and hold-down timers for heartbeat detection. The hello timer sets the interval for sending multicast hello messages, defaulting to 3 seconds, while the hold-down timer defines the period before declaring the active router unavailable, defaulting to 10 seconds (typically three times the hello interval).[2] These timers incorporate jitter—up to 20% variation—to prevent synchronization issues in multi-router environments.[12] HSRP hello messages are sent to the multicast address 224.0.0.2 (for HSRP version 1) or 224.0.0.102 (for HSRP version 2). In Cisco hierarchical campus networks, where distribution layer switches often lack direct Layer 2 connectivity (e.g., connected only via Layer 3 links), these multicast hello packets are flooded within the VLAN and traverse trunk links through access layer switches to enable HSRP negotiation between peers. This is expected behavior in such topologies, although it can result in multicast traffic on access ports connected to end devices, particularly with aggressive timers or on older switches without effective multicast filtering.[13][14]Virtual Router Concept
In the Hot Standby Router Protocol (HSRP), the virtual router serves as a logical abstraction that enables multiple physical routers to function collectively as a single, resilient entity visible to the local area network (LAN). This concept allows end hosts to configure the virtual router's addresses as their default gateway, ensuring uninterrupted connectivity without awareness of the underlying physical infrastructure. By emulating a unified router, HSRP masks individual router failures from the network, providing first-hop redundancy at Layer 3.[2] The virtual IP address is a key element of this abstraction, representing a shared gateway IP that is statically configured on hosts within the LAN segment. This address is dynamically "owned" by the active router in the HSRP group, which responds to traffic directed to it, while all group members continuously monitor its availability through protocol messages. In the event of a failover, the virtual IP seamlessly transfers to the standby router, maintaining consistent routing without requiring host reconfiguration. Complementing the virtual IP, the virtual MAC address follows a standardized format of 0000.0c07.acXX for HSRP version 1, where XX denotes the hexadecimal representation of the HSRP group number (e.g., 0000.0c07.ac01 for group 1). This address is used by the active router to respond to Address Resolution Protocol (ARP) requests from hosts and to forward Ethernet frames destined for the virtual IP, ensuring Layer 2 continuity.[2][15] The tight coupling between the virtual IP and virtual MAC addresses is essential for preserving both Layer 3 and Layer 2 addressing integrity during failover events. When the active router assumes control, it binds both addresses to its interface, allowing traffic to continue flowing without disruption or the need for ARP table updates on end devices. This integration presents the virtual router as an indivisible single point of presence to the network, effectively concealing physical router outages or maintenance from hosts and upstream devices. However, HSRP's design prioritizes redundancy over load distribution, as only the active router processes traffic for the virtual addresses at any given time, unlike protocols such as Gateway Load Balancing Protocol (GLBP) that enable concurrent utilization of multiple routers for traffic sharing.[2][16]Operation
Election Process
In the Hot Standby Router Protocol (HSRP), the election process determines the active and standby routers within a group to ensure redundant first-hop routing. Routers participating in an HSRP group exchange hello packets to advertise their availability and priorities, allowing the group to dynamically select the router best suited to forward traffic. The process begins with an initial election upon group formation or router startup, where the router with the highest priority value—ranging from 0 to 255 with a default of 100—becomes the active router.[5][2] If multiple routers have equal priorities, the tiebreaker is the highest IP address among the candidates.[5][12] Hello packets are sent periodically by active and standby routers to maintain group membership and roles, using multicast address 224.0.0.2 in HSRP version 1 or 224.0.0.102 in version 2, with a default interval of 3 seconds.[5][2] These advertisements include the sender's priority and current role, enabling other routers to monitor the active router's status. If the active router stops sending hellos, the standby router detects this after the hold timer expires—defaulting to 10 seconds—and assumes the active role to trigger failover, minimizing downtime.[5][12] In a single-router scenario, that router automatically assumes the active role without election, as no competitors exist.[2] In Cisco hierarchical campus networks, access layer switches commonly receive HSRP hello packets from distribution layer switches. HSRP uses multicast packets (destination 224.0.0.2 for version 1 or 224.0.0.102 for version 2) that are flooded within the VLAN for peer communication. In designs where distribution switches lack direct Layer 2 connectivity (e.g., only Layer 3 links between them), these hello packets traverse trunk links through access layer switches to allow HSRP negotiation. This is expected behavior, as HSRP requires Layer 2 connectivity for multicast hello exchange. However, these addresses are in the reserved 224.0.0.0/24 range, so IGMP snooping does not filter them, resulting in multicast flooding on access ports connected to end devices, especially with aggressive timers or on older switches without effective multicast filtering.[17][18] Preemption allows a router with a higher priority to take over the active role from the current active router, provided preemption is explicitly enabled in the configuration.[12] Without preemption, even a higher-priority router joining the group will not displace the active router unless the active fails. In multi-router groups, the election repeats as needed—such as when a new router joins or priorities change—with the highest-priority router becoming active and the next-highest becoming standby; equal-priority scenarios again resolve via IP address comparison during initial election but do not trigger preemption afterward unless priorities differ.[5][2] This mechanism ensures stable role assignment while supporting rapid recovery in dynamic network environments.[12]State Machine
The Hot Standby Router Protocol (HSRP) employs a finite state machine to manage the operational lifecycle of routers within a redundancy group, ensuring coordinated failover and traffic forwarding. This model consists of six distinct states: Initial, Learn, Listen, Speak, Active, and Standby. Each state defines specific behaviors and interactions via periodic advertisements, with transitions triggered by events such as timer expirations or receipt of control messages.[5] In the Initial state, a router enters upon startup, configuration changes, or interface activation, where HSRP is not yet operational and no group information is available. The router remains in this state until it receives sufficient details to progress, such as the virtual IP address, typically learned from hellos. From Initial, it transitions to Learn if the virtual IP is unknown or directly to Listen if the virtual IP is already configured.[5] The Learn state occurs when the router lacks the virtual IP address for the group and awaits an authenticated hello message from the active router to acquire this information. Upon learning the virtual IP, it moves to the Listen state. If no hellos are received within the hold time, it may revert or remain pending. In the Listen state, the router has the virtual IP but is neither active nor standby; it passively monitors hello messages from the active and standby routers without transmitting its own, allowing it to track the group's status. A transition from Listen to Speak happens upon active timer expiration, prompting the router to begin advertising and participate in role election.[5] The Speak state is entered when a router begins sending periodic hello messages to announce its presence and priority, actively participating in the active/standby election process while knowing the virtual IP. Routers in Speak continue advertising until the election resolves, at which point the highest-priority router (with ties broken by IP address) becomes Active, and the next highest becomes Standby; others revert to Listen. The Standby state positions the router as the backup to the active router, where it sends periodic hellos, monitors the active router via its active timer, and prepares to assume the active role if needed. If the active router fails, the standby transitions to Active by assuming the virtual IP and MAC addresses for traffic forwarding.[5] The Active state is the operational mode where the router forwards packets destined for the virtual MAC address, responds to ARP requests using the virtual IP, and sends periodic hellos to maintain group awareness. Only one router per group can be active, and it relinquishes this role via a resign message if preempted by a higher-priority router or upon detecting its own failure. Transitions out of Active, such as to Speak on hold timer expiration or preemption, trigger the state machine to reevaluate roles among remaining routers.[5] State transitions are governed by key timers that ensure timely detection of changes and prevent instability. The hello timer, defaulting to 3 seconds, prompts routers in Speak, Standby, and Active states to transmit advertisement messages containing the sender's state, priority, and timer values. The hold timer, defaulting to 10 seconds (typically three times the hello interval), sets the active and standby timers to monitor the respective routers; expiration of these timers signals failure and initiates failover transitions, such as from Standby to Active. Additional events like coup messages (for preemption) or resign messages further drive state changes.[5][2] Recovery paths in the state machine emphasize rapid failover and restoration. Upon reboot or major disruption, a router restarts in the Initial state and progresses through Learn and Listen as it reacquires group details from ongoing hellos. If the active router fails (detected via hold timer expiration), the standby immediately becomes active, sends a coup message if necessary, and begins forwarding traffic using the virtual addresses, minimizing downtime to the hold timer duration. Preemption allows a higher-priority router entering Speak to transition to Active by sending a coup, forcing the current active to Listen or Standby as appropriate. These mechanisms ensure that post-election roles are dynamically maintained without manual intervention.[5]Message Formats
HSRP messages are encapsulated in User Datagram Protocol (UDP) datagrams for communication between routers within a standby group. In HSRP version 1, these packets use UDP port 1985 and are sent to the IPv4 multicast address 224.0.0.2 with a time-to-live (TTL) value of 1, ensuring they remain on the local subnet.[5] For HSRP version 2, the IPv4 multicast address changes to 224.0.0.102, while IPv6 support employs UDP port 2029 and link-local multicast addressing with a hop limit of 1.[11][19] The primary HSRP message type is the Hello packet, which serves as the advertisement for periodic status updates from active and standby routers. In version 1, the fixed-format Hello packet (opcode 0) includes fields for version, state, timers, priority, group identification, authentication, and the virtual IP address. Its structure is depicted below: 0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|[Version (1](/page/Version_1) octet)| Op Code (1) | State (1) | Hellotime (1) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Holdtime (1) | Priority (1) | Group (1) | Reserved (1) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| [Virtual IP Address](/page/Virtual_IP_address) (4 octets) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|[Version (1](/page/Version_1) octet)| Op Code (1) | State (1) | Hellotime (1) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Holdtime (1) | Priority (1) | Group (1) | Reserved (1) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| [Virtual IP Address](/page/Virtual_IP_address) (4 octets) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Versions
HSRP Version 1
HSRP Version 1, defined in RFC 2281 published in March 1998, establishes the foundational implementation of the protocol for providing router redundancy using IPv4 addresses. It enables multiple routers to share a virtual IP address, with one acting as the active router and others in standby roles, through a basic election mechanism based on priority values (default 100, range 0-255) and IP address tiebreakers. The protocol defines six states—Initial, Learn, Listen, Speak, Standby, and Active—and three message types: Hello for advertisements, Coup for priority claims, and Resign for yielding active status.[4] Key features of HSRP Version 1 include exclusive support for IPv4, with hello messages transmitted as multicast packets to the address 224.0.0.2 on UDP port 1985 at 3-second intervals by default, enabling group members to maintain synchronization. Authentication is limited to a simple clear-text 8-character string, padded with nulls if shorter, which is included in all HSRP messages to verify group membership. Group numbers range from 0 to 255, corresponding to the virtual MAC address format 0000.0c07.acXX, where XX is the hexadecimal representation of the group number, ensuring unique identification across Ethernet and other media types.[4][2] Despite its foundational role, HSRP Version 1 has notable limitations, including no support for IPv6 addressing and absence of MD5 authentication, relying instead on vulnerable plain-text strings that expose the protocol to spoofing attacks. It uses the fixed multicast address 224.0.0.2, which can lead to issues in environments with multiple HSRP groups or VLANs, as hardware platforms often restrict the number of supported instances—such as a maximum of 32 HSRP groups on VLAN or routing interfaces in certain Cisco Industrial Ethernet switches. These constraints can hinder scalability in large VLAN deployments.[4][20][21] Although still widely deployed in legacy IPv4 networks, HSRP Version 1 is recommended for upgrade to Version 2 due to enhanced security features like MD5 authentication and broader capabilities, addressing vulnerabilities in the original text-based method.[11][20]HSRP Version 2
HSRP Version 2, introduced in Cisco IOS Release 12.3(4)T in 2004, introduces several enhancements over Version 1 to improve scalability, security, and compatibility with modern networks. It supports IPv6 through link-local addressing, enabling the protocol to operate seamlessly in IPv6 environments by using the multicast address FF02::66 for hello packets, while retaining IPv4 support via the new multicast address 224.0.0.102.[11][12] Additionally, HSRP Version 2 incorporates MD5 authentication, which generates a keyed hash for HSRP packets to protect against unauthorized access and spoofing, a significant upgrade from the plain-text authentication in Version 1.[22][23] To address scalability limitations in Version 1, HSRP Version 2 expands the group number range from 0-255 to 0-4095, allowing for more virtual routers in complex deployments. The virtual MAC address format is also updated to 0000.0C9F.FXXX, where XXX represents the group number in hexadecimal, providing a larger address space and avoiding conflicts with Version 1's 0000.0C07.ACXX format.[14][15] This redesign ensures better support for large-scale networks without requiring group reconfiguration during version upgrades, as changing versions reinitializes groups due to the new addressing scheme.[24] HSRP Version 2 includes enhancements for finer failure detection, such as the ability to advertise and learn millisecond timer values dynamically, allowing sub-second hello intervals and reducing convergence time compared to static configurations in Version 1. Object tracking, which integrates with HSRP (in both versions) to dynamically adjust router priorities based on the state of monitored objects like interfaces or routes, enables preemptive failover when issues are detected. Similarly, integration with IP SLA for proactive monitoring of end-to-end connectivity—where SLA probes can trigger priority decrements or failovers upon threshold violations—is a general HSRP capability that enhances reliability in dynamic environments.[11][25] In contemporary deployments, HSRP Version 2 is integrated into Cisco SD-WAN platforms running IOS XE (since Release 17.7.x in 2021), supporting configuration via CLI templates on Catalyst SD-WAN devices and improving interoperability in hybrid cloud and branch networks.[1] This evolution maintains backward compatibility within v2 implementations while addressing Version 1's constraints in diverse, high-availability scenarios.[14]Configuration
Basic Configuration
The Hot Standby Router Protocol (HSRP) is configured on Cisco IOS devices using interface-level commands to enable redundancy for IPv4 traffic. To set up a basic HSRP group, enter interface configuration mode and specify the standby group number and virtual IP address, which acts as the shared default gateway for connected hosts.[26] The commandstandby [group-number] ip [virtual-ip-address] enables HSRP version 1 by default on the interface and assigns the virtual IP; the group number (0 to 255) identifies the HSRP group, and omitting it defaults to group 0.[26]
By default, HSRP uses a priority of 100 for all routers in the group, with the highest priority router becoming active; ties are broken by the highest IP address.[26] To influence the active router election, configure standby [group-number] priority [value] (1 to 255) on the desired router. Preemption is disabled by default, meaning a higher-priority router will not automatically take over if it joins after the active router is elected; hello timers default to 3 seconds, and hold timers to 10 seconds.[26] Authentication defaults to text mode with the string "cisco," providing basic protection against misconfiguration.[26]
For verification, use the show standby command to display group details, including the local and virtual IP addresses, current state (e.g., Active or Standby), priority, and timers.[26] The show standby [interface] variant provides interface-specific output, confirming the active router and virtual IP assignment.
In a simple lab setup with two routers connected via a LAN (e.g., GigabitEthernet0/0 on each), configure HSRP group 1 sharing virtual IP 192.168.1.1/24. On Router1 (intended active, IP 192.168.1.2/24):
interface GigabitEthernet0/0
ip address 192.168.1.2 255.255.255.0
standby 1 ip 192.168.1.1
standby 1 priority 110
interface GigabitEthernet0/0
ip address 192.168.1.2 255.255.255.0
standby 1 ip 192.168.1.1
standby 1 priority 110
interface GigabitEthernet0/0
[ip address](/page/IP_address) 192.168.1.3 255.255.255.0
standby 1 ip 192.168.1.1
interface GigabitEthernet0/0
[ip address](/page/IP_address) 192.168.1.3 255.255.255.0
standby 1 ip 192.168.1.1
show standby on Router1 should show it as Active with virtual IP 192.168.1.1, while Router2 appears as Standby.[26]
Advanced Configuration
Advanced HSRP configurations enhance reliability and flexibility by incorporating features such as authentication to secure group communications, interface tracking for dynamic priority adjustments, customizable timers for fine-tuned failover timing, preemption to ensure the highest-priority router assumes the active role, IPv6 support for modern networks, and integration with IP Service Level Agreement (IP SLA) for proactive monitoring and failover.[12] Authentication in HSRP prevents unauthorized routers from joining the group; for HSRP version 1, simple text-based authentication is configured using the commandstandby [group] authentication [text], where the text string (up to eight characters) is sent unencrypted in hello messages.[12] In HSRP version 2, more secure MD5 authentication is supported via standby [group] authentication md5 key-string [0 | 7] [key] [timeout seconds] for a static key or standby [group] authentication md5 key-chain [key-chain-name] for rotating keys defined in a key chain.[12]
Interface tracking allows HSRP to respond to upstream link failures by monitoring interface states and adjusting the priority accordingly; the command track [object-number] interface [type] [number] {line-protocol | ip routing} creates a tracked object, followed by standby [group] track [object-number] [decrement priority-decrement] to reduce the priority (e.g., by 20) if the tracked interface goes down.[12] For example:
track 100 interface GigabitEthernet0/0/0 line-protocol
standby 1 track 100 decrement 20
track 100 interface GigabitEthernet0/0/0 line-protocol
standby 1 track 100 decrement 20
standby [group] timers [msec] [hello] [msec] [hold] allows specification in seconds or milliseconds (the latter supported in version 2), with defaults of 3 seconds for hello and 10 seconds for hold.[12] A typical configuration for faster detection might be:
standby 1 timers msec 200 msec 700
standby 1 timers msec 200 msec 700
standby [group] preempt [delay {minimum | reload | sync} seconds], where the optional delay (default 0 seconds) prevents immediate preemption during unstable periods, such as after a reload.[12] For instance:
standby 1 preempt delay minimum 30
standby 1 preempt delay minimum 30
standby version 2 on the interface, followed by standby [group] ipv6 autoconfig for automatic configuration of a virtual link-local address, or standby [group] ipv6 [ipv6-address] to specify a virtual IPv6 address (link-local or global).[27] An example for autoconfiguration of the virtual address is:
interface GigabitEthernet0/0
ipv6 address 2001:DB8:1::1/64
standby version 2
standby 1 ipv6 autoconfig
standby 1 priority 110
standby 1 preempt
interface GigabitEthernet0/0
ipv6 address 2001:DB8:1::1/64
standby version 2
standby 1 ipv6 autoconfig
standby 1 priority 110
standby 1 preempt
ip sla [monitor] [number] and schedule it via ip sla schedule [number] life forever start-time now, then create a track object with track [number] ip sla [sla-number] reachability, and link it to HSRP using standby [group] track [track-number] decrement [value].[12] This allows HSRP to decrement priority if remote reachability fails, triggering failover without waiting for local detection.[12]
Comparisons with Other Protocols
HSRP vs. VRRP
The Hot Standby Router Protocol (HSRP) and Virtual Router Redundancy Protocol (VRRP) are both first-hop redundancy protocols designed to provide gateway redundancy in IP networks, but they differ significantly in their origins, implementation, and applicability. HSRP is a Cisco-proprietary protocol, while VRRP is an open standard developed by the IETF.[28][29] These differences influence their use in various network environments, particularly regarding vendor compatibility and feature sets.| Aspect | HSRP | VRRP |
|---|---|---|
| Standards | Cisco proprietary; versions 1 and 2 defined in Cisco documentation. | IETF standard; VRRPv2 in RFC 3768, VRRPv3 in RFC 5798 (obsoleted by RFC 9568).[28] |
| Election and Roles | Uses priority (default 100, range 0-255 in v1, 0-4095 in v2) and IP address tiebreaker; roles include Active (forwards traffic), Standby (takes over on failure), and Listen (monitors). Both Active and Standby send hello messages. Preemption is disabled by default. | Uses priority (default 100, range 1-254 for backups, 255 for address owner) and IP address tiebreaker; roles are Master (forwards traffic, sends advertisements) and Backup (monitors, takes over on failure). Only Master sends advertisements; no dedicated "Standby" role. Preemption is enabled by default.[28] |
| Virtual MAC Address | v1: 0000.0C07.ACxx (xx = group number in hexadecimal); v2: 0000.0C9F.Fxxx (xxx = group number in hexadecimal). | 0000.5E00.01XX for IPv4 (XX = VRID in hexadecimal); 0000.5E00.02XX for IPv6.[28] |
| Authentication | v1 supports plain-text; v2 supports MD5 (using key string or key chain) for enhanced security against spoofing. | v2 supports plain-text or MD5; v3 does not support authentication (fields set to zero). Relies on TTL=255 for basic protection.[31] |
| Interoperability | Limited to Cisco devices; no native support for non-Cisco routers. | Vendor-agnostic with multi-vendor support, enabling deployment across diverse hardware.[2] |
HSRP vs. GLBP
The Hot Standby Router Protocol (HSRP) and Gateway Load Balancing Protocol (GLBP) are both Cisco-proprietary first-hop redundancy protocols designed to provide gateway redundancy in IP networks, but they differ significantly in their approach to traffic handling and resource utilization. HSRP operates on an active/standby model, where a single active router forwards all traffic for the virtual IP address while standby routers remain idle until failover occurs, offering no inherent load sharing across multiple routers. In contrast, GLBP employs an active/active model through its Active Virtual Gateway (AVG) and Active Virtual Forwarder (AVF) roles, enabling load balancing by distributing traffic across multiple routers using a single virtual IP address.[33][16] A key distinction lies in how each protocol elects and weights gateways for traffic distribution. HSRP relies solely on priority values (ranging from 0 to 255) to determine the active router, with no mechanism for fine-tuning load distribution beyond creating multiple HSRP groups for manual load sharing. GLBP, however, incorporates a weighting system (default 100, adjustable from 1 to 255) for AVFs, which influences the proportion of traffic each forwarder handles based on interface or tracked object capacity, allowing for more dynamic and efficient utilization of available routers. Additionally, HSRP uses a single virtual MAC address per group (prefixed with 0000.0c07.ac), shared among all routers, whereas GLBP generates multiple virtual MAC addresses (up to four per group, prefixed with 0007.b400) to assign unique forwarders to clients via ARP replies, facilitating true load balancing.[33][33][16] Both protocols support rapid failover, with default hello intervals of 3 seconds and hold times of 10 seconds, but timers can be tuned (e.g., to 50 ms hello and 150 ms hold) for sub-second convergence in either case; however, GLBP's design ensures better overall utilization by keeping multiple routers active, reducing the impact of a single failure on traffic throughput. Introduced in Cisco IOS Release 12.2(14)S and 12.2(15)T around 2003, GLBP is often viewed as an evolution of HSRP, extending redundancy with load-balancing capabilities while maintaining compatibility in Cisco environments.[33][33][33]| Aspect | HSRP | GLBP |
|---|---|---|
| Core Functionality | Active/standby redundancy; no native load sharing. | Active/active redundancy with load balancing via AVG/AVF roles. |
| Election Mechanism | Priority (0-255) for active router selection. | Priority for AVG; weighting (1-255) for AVF traffic distribution. |
| Virtual MACs | Single shared MAC per group. | Multiple MACs (up to 4) per group for client distribution. |
| Failover | Standby assumes role; sub-second possible with tuned timers. | AVF reassignment or standby VG takeover; sub-second possible, better multi-router utilization. |
| Use Cases | Simple redundancy in low-traffic networks. | Load distribution in high-traffic LANs with multiple gateways. |
