First Hop Redundancy Protocols (FHRPs)
Purpose and Basic Operation
- Concept: First Hop Redundancy Protocols (FHRPs) protect the default gateway on a subnetwork by allowing two or more routers to provide backup for that address. If the active router fails, a backup router takes over the gateway address, usually within seconds.
- Details:
- Virtual IP (VIP): Routers share a single VIP. End hosts are configured to use this VIP as their default gateway instead of a physical router interface IP.
- Virtual MAC (VMAC): The active router replies to ARP requests for the VIP using a generated VMAC. Each FHRP uses a specific, standardized VMAC format.
- Hello Messages: Routers negotiate roles by sending multicast Hello messages to each other.
- Gratuitous ARP (GARP): When a standby router takes over as active, it sends broadcast GARP messages. This forces switches to update their MAC address tables with the new port associated with the VMAC.
graph TD
A[Host sends traffic to VIP] --> B{Host knows VMAC?}
B -- No --> C[Host broadcasts ARP Request for VIP]
C --> D[Active Router replies with VMAC]
B -- Yes --> E[Host sends frame to VMAC]
E --> F[Active Router forwards packet]
F --> G{Active Router Fails?}
G -- Yes --> H[Standby stops receiving Hellos]
H --> I[Standby transitions to Active]
I --> J[New Active sends Gratuitous ARP]
J --> K[Switches update MAC tables]
Things to note:
- Preemption: By default, FHRPs are non-preemptive (similar to OSPF DR/BDR). If the original active router fails and recovers, it will not automatically take back the active role. You must explicitly configure preemption to allow a router with a higher priority to reclaim the active state.
- Election Rules: The router with the highest priority becomes Active. If priorities tie, the router with the highest IP address on the interface wins.
FHRP Comparison
| Feature | HSRP (Hot Standby Router Protocol) | VRRP (Virtual Router Redundancy Protocol) | GLBP (Gateway Load Balancing Protocol) |
|---|---|---|---|
| Vendor | Cisco Proprietary | Open Standard | Cisco Proprietary |
| Roles | Active, Standby | Master, Backup | AVG (Active Virtual Gateway), AVF (Active Virtual Forwarder) |
| IPv4 Multicast | v1: 224.0.0.2 v2: 224.0.0.102 |
224.0.0.18 |
224.0.0.102 |
| Virtual MAC Format | v1: 0000.0c07.acXX v2: 0000.0c9f.fXXX |
0000.5e00.01XX |
0007.b400.XXYY (XX=Group, YY=AVF) |
| Load Balancing | Across multiple subnets/VLANs only | Across multiple subnets/VLANs only | Within a single subnet (up to 4 routers) |
Things to note:
- HSRP vs VRRP: Functionally nearly identical, but VRRP is an open standard and uses different terminology (Master/Backup instead of Active/Standby).
- GLBP Load Balancing: Unlike HSRP/VRRP (which only allow one active forwarder per subnet), GLBP elects one AVG which assigns up to four AVFs. Each AVF acts as the default gateway for a portion of the hosts, achieving true active-active load balancing within a single subnet.
HSRP (Hot Standby Router Protocol) Details
- Versions:
- Version 1: Default. IPv4 only. Multicast
224.0.0.2. Supports groups 0–255. - Version 2: Adds IPv6 support. Multicast
224.0.0.102. Supports groups 0–4095.
- Version 1: Default. IPv4 only. Multicast
- Virtual MAC Examples:
- HSRPv1 Group 1 (Hex
01):0000.0c07.ac01 - HSRPv2 Group 1 (Hex
001):0000.0c9f.f001
- HSRPv1 Group 1 (Hex
- Load Balancing Strategy: Configure multiple HSRP groups across different VLANs. Make Router 1 Active for VLAN 10 / Standby for VLAN 20, and Router 2 Standby for VLAN 10 / Active for VLAN 20.
VRRP (Virtual Router Redundancy Protocol) Details
- Virtual MAC Example:
- VRRP Group 200 (Decimal 200 = Hex
C8):0000.5e00.01c8
- VRRP Group 200 (Decimal 200 = Hex
- Load Balancing Strategy: Identical to HSRP. Configure different Master routers for different subnets/VLANs.
GLBP (Gateway Load Balancing Protocol) Details
- Virtual MAC Example:
- GLBP Group 1, AVF 1:
0007.b400.0101
- GLBP Group 1, AVF 1:
- Operation: The AVG responds to ARP requests for the VIP with different VMACs (round-robin by default) belonging to the various AVFs. This distributes host traffic across multiple physical routers.
HSRP Configuration & Verification
HSRP is configured directly on the Layer 3 interface connected to the subnet it is protecting.
! Enable HSRP Version 2 (Optional, but recommended for IPv6 and more groups)
Router(config-if)# standby version 2
! Configure the Virtual IP (VIP) for Group 1
Router(config-if)# standby 1 ip 172.16.0.254
! Set Priority (Range 0-255, Default is 100)
! Higher priority wins the Active election
Router(config-if)# standby 1 priority 200
! Enable Preemption so this router reclaims Active role if it recovers
Router(config-if)# standby 1 preempt
Verification Command:
Router# show standby
Output Breakdown:
- Group & Version: Shows the HSRP group number and version (1 or 2).
- State:
ActiveorStandby. - Virtual IP: The configured VIP.
- Virtual MAC: The generated VMAC for the group.
- Timers: Hello and hold times (default is 3s hello, 10s hold).
- Preemption: Shows if enabled or disabled.
- Active/Standby IPs: Shows the physical IP of the local and peer routers.
- Priority: Displays the configured priority value and the peer’s priority.
Things to note:
- HSRPv1 and HSRPv2 are not compatible. Both routers in the same group must use the same version.
- You only need to configure
standby [group] preempton the router you want to become Active. The standby router does not need preemption enabled to be preempted.
Summary of IOS Commands
! Interface Configuration Mode Commands
standby version 2 ! Changes HSRP from v1 to v2
standby [group] ip [vip] ! Sets the Virtual IP for the FHRP group
standby [group] priority [0-255] ! Sets router priority for Active election (Default: 100)
standby [group] preempt ! Allows router to reclaim Active role if it has highest priority
! Verification Commands
show standby ! Displays HSRP state, VIP, VMAC, priorities, and timers
show standby brief ! Displays a summarized table of all HSRP groups on the router