Use it for a redundant default gateway on Cisco routers or Layer 3 switches.
HSRP (Hot Standby Router Protocol)
HSRP is Cisco's first-hop redundancy protocol: routers in a group elect an active router that answers for the virtual IP and virtual MAC, and a standby router that takes over if the active stops sending hellos.
1. show standby brief on both — one Active, one Standby?
2. Both Active → hellos not received: VLAN, group, version, authentication.
3. Wrong Active → priority, and preempt on the intended one.
4. Failover on uplink loss missing → standby <group> track and show track.
5. show logging | include HSRP — how often does the state change?
same group, virtual IP and version on all routers → hellos received → highest priority active → standby ready → tracking lowers priority on uplink failure → pre-emption restores the intended active router
Duplicate address messages appear, both routers show Active, or hosts lose the gateway when the active router fails.
Possible stored cause: Group number, virtual IP, version or authentication differs between routers, or hellos are not exchanged on the segment.Compare the peer's view and perform a controlled failover test with traffic.
Continue only after interpreting the current observation.Context & applicabilityCommon mistakes · platform/version boundaries
- Expecting the highest-priority router to become Active without preemption
- Using tracking with a decrement too small to change preference
- Treating a healthy Active state as evidence that the upstream path works
- Mismatching HSRP version/group/VIP between peers
- Forgetting that STP and FHRP placement interact in a switched campus
- Changing timers before proving timers are the actual failure point.
Operational reference
Fast context before you go deeper.
standby version 2Primary Commands
Configuration and operational commands for this Topic.
standby version 2ReferenceUse HSRP version 2 (more groups, IPv6, different multicast and MAC).
Use when: Use when the design standardizes on HSRPv2 or requires v2 capabilities/group numbering.
Quick note: HSRPv2 classic IPv4 uses UDP 1985 and multicast 224.0.0.102; verify platform specifics.
Cisco IOS / IOS XE · mixedstandby <group> ip <virtual-ip>ReferenceSet the HSRP virtual IP address for a group.
Use when: Create the shared HSRP virtual gateway used as the endpoint default gateway.
Quick note: Verify with show standby brief, client default-gateway configuration and ARP for the VIP.
standby <group> priority <value>ReferenceSet the HSRP priority (default 100).
Use when: Express which gateway should be preferred Active in the healthy state.
Quick note: Compare displayed effective priority and peer state, not only running configuration.
Cisco IOS / IOS XE · mixedstandby <group> preemptReferenceLet a higher-priority HSRP router take over the Active role.
Use when: Use for deterministic preferred-gateway takeover/failback and tracking-based role changes where required.
Quick note: Role change depends on effective priority and peer visibility.
Cisco IOS / IOS XE · mixedstandby <group> timers <hello> <hold>ReferenceSet HSRP hello and hold timers (default 3 and 10 seconds).
Use when: Adjust HSRP failure-detection timing only when the design requires it and both peers are coordinated.
Quick note: Prefer evidence of a timing requirement before tuning.
Cisco IOS / IOS XE · mixedstandby <group> track <object> decrement <value>ReferenceLower HSRP priority when a tracked object goes down.
Use when: Make HSRP gateway preference react to an upstream or service dependency that can fail while the local gateway interface stays up.
Quick note: Verify track state, displayed priority and actual role movement during a controlled failure.
Cisco IOS / IOS XE · mixedShow Commands
Read-only Cisco show commands for confirming state, narrowing a fault and interpreting the current boundary.
show standbyShowDisplay detailed HSRP state, timers, priority and tracking.
Use when: Primary deep verification command for an HSRP group or interface.
Quick note: Use detailed output to explain why the displayed Active/Standby roles exist.
Cisco IOS / IOS XE · mixedshow standby briefShowHSRP group state, active/standby peers and virtual IP.
Use when: Fast first command for wrong gateway role, missing peer or broad HSRP health checks.
Quick note: Excellent search/triage command; confirm detailed policy before changing configuration.
Cisco IOS XE · mixedHow to read the output
show standby briefLook first: interface/group, state, active/standby peers, virtual IP, priority
Healthy: Exactly the intended Active/Standby roles and VIP are present.
Warning: Both active, unknown peer, unexpected role/priority or missing VIP.
Does not prove: FHRP state does not prove upstream routing or host ARP behavior.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Duplicate address messages appear, both routers show Active, or hosts lose the gateway when the active router fails.
Step 1 First 30 seconds Verify boundary
Immediate answer: Confirm group, active/standby roles, virtual IP/MAC, tracking and interface/L2 reachability before forcing failover.
Verification chain: Peer reachability → HSRP state machine → active role → virtual MAC/IP ownership → host ARP → gateway forwarding
Stop condition: Active state does not show hosts learned the virtual MAC or that upstream/downstream forwarding is healthy.
Step 2 Verification and output interpretation Verify boundary
Use show standby brief as the compact reference for group, local state, Active/Standby peer, virtual IP and priority. Confirm exactly one intended Active and one intended Standby for the group and that both agree on the virtual IP. Verify the virtual MAC/IP is reachable from the client VLAN and then verify routed forwarding separately. For tracking behavior, perform a controlled tracked-state change and observe the expected priority/role transition, followed by restoration if preemption is part of the design.
Step 3 Verification from the endpoint Verify boundary
Verify group state, Active/Standby identity, virtual IP/MAC, priorities, timers and tracked objects. Confirm the endpoint ARP entry resolves the virtual IP to the HSRP virtual MAC and that the active device installs/forwards routes as expected. An Active state shows gateway ownership, not that upstream routing or applications are healthy. During failover, correlate role transition with ARP/MAC convergence and return-path state.
Step 4 Troubleshooting order Narrow the fault
Start with the interface/VLAN itself, then confirm version/group/VIP consistency, verify both peers and current roles, inspect priority/preempt/tracking, and only then move outward to STP, upstream routing and user traffic. If both routers think they are Active, prioritize Layer 2/control-message reachability before changing election values.
Evidence · 2 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
The HSRP group shows one intended Active router and the expected Standby peer with the correct virtual IP.
packet · Evidence referenceHSRP control packets absent between otherwise connected peersA capture at the expected common segment sees no HSRP UDP 1985 control traffic from the missing peer during the observation window.
Subtopics
Go one level deeper into this subject.
In HSRP, the Active router is the member currently responsible for forwarding traffic sent to the group virtual gateway and for maintaining the virtual MAC ownership expected by hosts.
Subtopic StandbyThe HSRP Standby router is the elected backup member for a group.
Subtopic Virtual IPThe HSRP virtual IP is the default-gateway identity configured for a group and used by attached hosts.
Subtopic Virtual MACHSRP couples the shared virtual IP with a protocol-defined virtual MAC that is owned by the current Active router for the group.
Subtopic PriorityHSRP priority is the primary administrative preference used to decide which eligible router should become Active for a group; higher priority is preferred, with tie-break rules applying when values are equal.
Subtopic PreemptionHSRP preemption controls recovery behavior. Without preemption, a router that becomes Active can normally remain Active even when a peer with a higher priority later returns; with preemption, the higher-priority eligible router can take over.
Subtopic TrackingHSRP tracking links gateway election to another health signal so a router can relinquish Active preference when an important dependency fails.
Start from the symptom
Prove the nearest boundary, branch on the observation, and repeat the original test after the minimum controlled change.
Symptom-first flow HSRP has the wrong Active router or unstable gateway role 7 decision steps
First proof
Prove group/VIP, peer visibility, priority/preemption and tracking before changing timers.
Useful read-only checks: show standby brief · show ip route · show interfaces
Step 1 Group/VIP identity Observe → decide
Confirm both routers use the intended group and virtual IP.
If healthy: Group and VIP agree.
If broken: Correct identity mismatch first.
Step 2 Peer visibility Observe → decide
Confirm each router sees the other HSRP peer.
If healthy: Active/Standby peers are visible.
If broken: Investigate VLAN/L2/control-path failure.
Step 3 Priority/preemption Observe → decide
Compare configured/effective priority and preemption behavior.
If healthy: The design-intended router should win.
If broken: Correct explicit policy rather than forcing state manually.
Step 4 Tracking effect Observe → decide
Check whether tracked objects changed effective priority.
If healthy: Tracking state matches actual upstream health.
If broken: Fix the tracked dependency or policy if it drives role changes.
Step 5 Upstream reachability Observe → decide
Verify the Active router can actually reach required upstream paths.
If healthy: Active role aligns with usable forwarding.
If broken: HSRP state alone is not upstream-route proof.
Step 6 Host gateway resolution Observe → decide
Check that endpoints resolve/use the expected virtual gateway.
If healthy: Hosts use the VIP/virtual MAC as intended.
If broken: Investigate ARP/MAC or stale host state.
Step 7 Failover/recovery test Observe → decide
Perform only a controlled validation of the original HA condition.
If healthy: Role transition and original traffic behave as designed.
If broken: Do not infer HA from a static standby snapshot.
Proof limit
A passing step proves only that boundary; continue until the original symptom is explained and retested.
Recognize the symptom, then prove the boundary
Observed symptom → candidate boundary → discriminating check → original-test closure. A signature narrows the search; it never proves root cause by itself.
HSRP role is unstable or both sides appear Active
Active/Standby ownership changes unexpectedly or peer visibility is inconsistent.
peer L2 reachability · group/VIP/auth mismatch · tracking/preemption event · control-plane filtering
compare group/VIP/priority → verify peer hellos/reachability → correlate tracking/interface events
A role change does not prove HSRP itself is the root cause.
Repeat the original failing test after the minimum controlled change before calling recovery verified.Default priority 100; pre-emption is off unless standby <group> preempt is configured. Version 1 and 2 do not interoperate; v2 is needed for IPv6 and group numbers above 255. Virtual MAC: 0000.0c07.acXX (v1), 0000.0c9f.fXXX (v2). Track the uplink with standby <group> track <object> decrement <n>.
show standby brief— state, priority, pre-emption flag, active and standby, virtual IP.show standby <interface> <group>— timers, tracking, virtual MAC, version.show track— tracked objects.show logging | include HSRP— state changes.
ReferenceWhat it is1 section · depth on demand
What it is
Hot Standby Router Protocol (HSRP) is Cisco's first-hop redundancy protocol. Routers in an HSRP group present a shared virtual IP and virtual MAC to hosts, elect an Active router to forward traffic and keep a Standby router ready to take over.
ReferenceHow it works1 section · depth on demand
How HSRP works
HSRP peers exchange control messages on the local segment. They agree on a group and virtual gateway identity, elect Active and Standby roles, and monitor liveness with hello/hold timers. Priority selects the preferred router; preemption controls whether a better router may displace the current Active; tracking can lower priority when an external dependency fails.
ReferenceImportant terms & boundaries5 sections · depth on demand
In depth
HSRP: Cisco's first-hop redundancy protocol
Cisco's IOS XE HSRP guide documents the essentials:
| Item | HSRP v1 | HSRP v2 |
|---|---|---|
| Groups | 0–255 | 0–4095 |
| Hello destination | 224.0.0.2, UDP 1985 | 224.0.0.102 |
| Virtual MAC | 0000.0C07.ACxy (xy = group in hex) | 0000.0C9F.F000–0000.0C9F.FFFF |
| Packet format | Fixed | TLV, millisecond timers |
Version 1 is the default. The guide notes that changing the version reinitialises each group because the virtual MAC changes. Default priority is 100, higher wins, and preemption is off by default.
C9300-A(config)# track 1 interface TenGigabitEthernet1/1/1 line-protocol
C9300-A(config)# interface Vlan20
C9300-A(config-if)# standby version 2
C9300-A(config-if)# standby 20 ip 10.20.0.1
C9300-A(config-if)# standby 20 priority 110
C9300-A(config-if)# standby 20 preempt delay minimum 30 reload 60
C9300-A(config-if)# standby 20 track 1 decrement 20
C9300-A(config-if)# standby 20 authentication md5 key-chain HSRP-KEYS
C9300-A# show standby Vlan20 20
Vlan20 - Group 20 (version 2)
State is Active
Virtual IP address is 10.20.0.1
Active virtual MAC address is 0000.0c9f.f014 (MAC In Use)
Preemption enabled, delay min 30 secs, reload 60 secs
Active router is local
Standby router is 10.20.0.3, priority 100
Priority 110 (configured 110)
Track object 1 state Up decrement 20
Group 20 is 0x014, so the v2 virtual MAC ends in F014.
States and messages (from the guide)
| States | Init, Learn, Listen, Speak, Standby, Active |
|---|---|
| Messages | Hello (priority and state), Coup (take over), Resign (step down) |
Documented behaviour
| Topic | Detail |
|---|---|
| Ties | Higher primary IP wins, but only at initial election |
| Tracking | Default decrement 10; decrements are cumulative; shutdown disables the group instead |
| Preemption delay | The guide recommends minimum 30 and reload 60 |
| Authentication | Plain text by default; MD5 by key string or key chain; text and MD5 can't be mixed |
Troubleshooting
| Symptom | Cause |
|---|---|
| Both routers Active | Hellos not reaching each other: VLAN, ACL or authentication mismatch |
| Higher-priority router stays Standby | standby preempt missing |
| Failover doesn't happen on uplink loss | No tracking, or the decrement doesn't bring priority below the peer |
debug standby errors reports authentication failures; the guide advises using it sparingly.
Documented example, not captured output.
Concept and state model
HSRP separates the endpoint-visible gateway identity from the physical routers that provide it. Hosts use a virtual IP address and corresponding virtual MAC; the Active router answers and forwards for that identity while the Standby monitors the group and can take over. Group state is decided by HSRP messages, priority and tie-break behavior, with preemption controlling whether a higher-priority router reclaims Active after returning. Tracking can lower priority when an important local condition changes so gateway ownership follows useful connectivity rather than simply local interface state. The virtual IP must belong to the same subnet as the participating interfaces, and group/version parameters must agree between peers.
Operational boundaries and common misconceptions
An HSRP Active state shows gateway-role ownership, not that the router has working upstream reachability. Without effective tracking, a router can remain Active while a remote path is broken. Successful failover also does not show all sessions/applications survive unchanged; ARP timing, convergence and stateful services may have separate behavior. Do not infer the HSRP role from STP root status or vice versa—alignment is a design choice, not a protocol dependency.
State model and protocol mechanics
HSRP provides a stable virtual IPv4 gateway identity shared by multiple routers or multilayer switches. One device is Active for a group, another may be Standby, and hosts use the virtual IP and virtual MAC rather than depending on a specific physical gateway address. Priority, preemption and tracking influence which device owns the active role.
Limits and common misconceptions
HSRP is first-hop redundancy, not dynamic routing and not load balancing for a single group. Preemption can restore a preferred primary but can also trigger another transition after recovery. Tracking a physical interface does not automatically represent full upstream reachability. A virtual IP responding to ping shows some gateway path is alive, not that every remote service is reachable.
ReferenceConfiguration & state2 sections · depth on demand
Configuration model and design choices
Configure the virtual IP, group and priority according to the intended primary/secondary role. Enable preemption only when automatic role restoration is desired and its convergence behavior is understood. Track an upstream object or interface when the router should relinquish Active because its forwarding usefulness has degraded; choose decrement values that actually change the election result. Align HSRP placement with STP/root and Layer 3 topology where practical so the active gateway is reached efficiently rather than across an avoidable Layer 2 detour. Keep multiple groups explicit if load sharing is intentional.
Design and configuration model
Configure a consistent group, virtual IP and subnet on both peers, then set priority and preemption according to the intended primary/secondary design. Use object or interface tracking only for failures that should genuinely move the gateway role; over-broad tracking can cause unnecessary state changes. Align the HSRP design with routing symmetry and upstream reachability so the Active device is also capable of forwarding beyond the VLAN.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Routing → First Hop Redundancy → HSRP. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.cisco.com/c/en/us/support/ios-nx-os-software/ios-xe-17/series.html · confidence 94%Official Cisco vendor documentation reviewed for bounded reference claims: HSRP roles, virtual IP/MAC and tracking/preemption. This is documentation-based technical verification, not lab or production-runtime proof. Deployment-specific applicability and runtime outcome remain separate evidence.
Basis: https://www.cisco.com/c/en/us/td/docs/routers/ios-xe/network-services/network-services/m_fhp-hsrp-0.html · confidence 94%Quick lookup tables
HSRP operational state map
Interpret the important HSRP states during convergence
| State | Meaning | Operational interpretation |
|---|---|---|
| Initial | HSRP not yet operational | Start with interface/configuration |
| Learn | Router has not learned the virtual IP | Check peer/config consistency |
| Listen | Knows VIP but is neither Active nor Standby | Peer election is established but this router is not primary backup |
| Speak | Sends hellos and participates in election | Converging/electing |
| Standby | Primary backup | Redundancy ready if upstream path is healthy |
| Active | Current virtual-gateway forwarder | Verify forwarding and upstream health |
HSRP election and takeover
Priority, tie-break, preemption and tracking in one view
| Condition | Expected decision | Important caveat |
|---|---|---|
| Different priorities | Higher priority preferred | Current Active may remain without preempt |
| Equal priorities | Higher HSRP interface IP wins tie | Verify which address participates |
| Preferred router recovers | It can retake Active with preempt | Stable-path design matters |
| Active tracking decrements below peer | Peer becomes preferable | Peer needs suitable preemption behavior for takeover |
| HSRP peers cannot hear each other | Both may claim Active | Treat as L2/control-plane reachability issue |
HSRP v1 vs v2 quick reference
Classic IPv4 values useful for configuration and capture interpretation
| Property | HSRPv1 | HSRPv2 |
|---|---|---|
| UDP port | 1985 | 1985 |
| IPv4 multicast | 224.0.0.2 | 224.0.0.102 |
| Group range | 0-255 | 0-4095 |
| Virtual MAC pattern | 0000.0c07.acXX | 0000.0c9f.fXXX |
| Cisco command | default/legacy behavior | standby version 2 |
HSRP troubleshooting flow
Fast order for wrong Active, missing Standby or failed gateway failover
| Step | Check | Healthy | Suspicious |
|---|---|---|---|
| 1 | VLAN/SVI/interface | Up/up and same segment | Interface/VLAN failure |
| 2 | Version/group/VIP | Peers agree | Mismatch |
| 3 | Roles | One Active, expected Standby | Both Active / Standby unknown |
| 4 | Priority/preempt | Matches intended owner | Preferred router cannot take over |
| 5 | Tracking | Dependency changes priority | No change / decrement too small |
| 6 | STP/upstream | Active has efficient working path | Hairpin or dead upstream |
| 7 | Traffic | Client survives failure | Gateway role changes but service fails |
HSRP · reference boundaries
Compact technical reference for the most important state and interpretation boundaries.
| HSRP property | Healthy reference |
|---|---|
| Virtual identity | Peers agree on group and virtual IP |
| Roles | Exactly one intended Active and one Standby |
| Priority/preempt | Election behavior matches design |
| Tracking | Relevant loss changes priority/role when intended |
HSRP · operational reference
Compact state and interpretation boundaries for fast lookup.
| State / evidence | Interpretation |
|---|---|
| Active | Owns virtual forwarding role |
| Standby | Ready backup state |
| Virtual IP/MAC | Host-facing identity |
| Tracking | Can alter effective priority |
Operational notes
Former standalone Cheat Sheet content now lives directly inside the Topic where it belongs.
HSRP Fast Check
Virtual gateway, active/standby, priority, preempt og tracking.
Quick checks
show standby briefshow standby- Verify virtual IP and group
- Compare priority/preempt
- Check tracked objects
- Compare STP root/path alignment
Husk
HSRP active proves gateway ownership, not that Layer-2 and upstream paths are optimal.
Deep reference
Additional depth
HSRP version 1 vs version 2
For classic IPv4 HSRP, both versions use UDP port 1985. HSRPv1 commonly uses multicast 224.0.0.2, groups 0-255 and virtual MAC 0000.0c07.acXX. HSRPv2 commonly uses multicast 224.0.0.102, groups 0-4095 and virtual MAC 0000.0c9f.fXXX. Confirm exact platform behavior before using these values as capture/configuration assumptions.