3.3.c Configure first-hop redundancy with HSRP and VRRP
ENCOR 350-401 v1.2 · 3.0 Infrastructure
Hosts have one default gateway. A first-hop redundancy protocol lets two or more routers share a virtual IP and MAC address, so the gateway survives the loss of a router. ENCOR expects you to configure HSRP (Cisco) and VRRP (the open standard), control who is active with priority and preemption, and fail over when the upstream path fails, not only the local interface.
What you must know
- Configure HSRPv2 with a virtual IP, priority, preemption and tracking.
- Predict the active router from priority, IP address and preemption.
- Name the virtual MAC addresses and multicast addresses of HSRPv1, HSRPv2 and VRRP.
- Configure VRRP and say how it differs from HSRP (owner, preemption default, timers).
- Load-share by making each router active for a different group.
HSRP
HSRP routers elect one active router, which answers ARP for the virtual IP with the virtual MAC, and one standby. Others listen. The highest priority wins (default 100); a tie goes to the highest interface IP. Preemption is off by default: a router with a better priority that comes back later stays standby until you configure preempt.
interface Vlan10
ip address 10.1.10.2 255.255.255.0
standby version 2
standby 10 ip 10.1.10.1
standby 10 priority 110
standby 10 preempt delay minimum 30
standby 10 track 1 decrement 20PC1's traffic to its gateway reaches DSW1, the active router (1). If DSW1 fails, DSW2 stops hearing hellos (every 3 s; hold time 10 s), takes over the virtual IP and MAC, and sends a gratuitous ARP so the switches learn the MAC's new port. PC1 never changes anything.
| HSRPv1 | HSRPv2 | VRRP | |
|---|---|---|---|
| Standard | Cisco | Cisco | RFC 5798 (v3) |
| Groups | 0–255 | 0–4095 | 1–255 |
| Multicast | 224.0.0.2 | 224.0.0.102 | 224.0.0.18 |
| Virtual MAC | 0000.0c07.acXX | 0000.0c9f.fXXX | 0000.5e00.01XX |
| Roles | Active / standby | Active / standby | Master / backup |
| Preempt by default | No | No | Yes |
| IPv6 | No | Yes | Yes (v3) |
VRRP
VRRP works the same way with different names: one master, the rest backups. The virtual IP may be one router's own interface address; that router is the owner, has priority 255 and is always master when it is up. Preemption is on by default and advertisements go every second.
interface Vlan20
ip address 10.1.20.3 255.255.255.0
vrrp 20 ip 10.1.20.1
vrrp 20 priority 110
vrrp 20 track 1 decrement 20Load sharing and tracking
One group has one active router, so the standby idles. Make DSW1 active for VLAN 10 and DSW2 for VLAN 20, and match each to the STP root of that VLAN so traffic does not cross the inter-switch link. Tracking lowers the priority when an object goes down. Track the uplink (track 1 interface Gi1/0/48 line-protocol) or, better, an IP SLA probe through the uplink, so the router gives up the role when the path upstream fails. The other router must have preempt to take over.
Commands
show standby brief | Each HSRP group: interface, priority, preemption (P), state, active and standby addresses, virtual IP. |
show standby | Full detail, including the virtual MAC, timers and tracked objects. |
show vrrp brief | Each VRRP group with priority, owner, state and master address. |
show track | The state of tracked objects and which groups follow them. |
debug standby events | State changes as they happen. |
Exam traps
- HSRP does not preempt by default; VRRP does.
- Tracking lowers the priority, but the other router only takes over if it has
preempt. - The decrement must bring the active router below the standby's priority (110 − 20 = 90 < 100).
- HSRPv1 and v2 do not talk to each other; both ends of a group must run the same version.
- The VRRP owner (virtual IP = its own address) has priority 255 and always wins.
- Hosts use the virtual IP as their gateway, never a router's real address.
Check yourself
- DSW1 (priority 110) reboots. DSW2 (100) becomes active. DSW1 comes back. Who is active?
- DSW2, unless DSW1 has
standby … preempt. HSRP does not preempt by default. - Which virtual MAC does HSRPv2 group 10 use?
- 0000.0c9f.f00a (group 10 in hex).
- DSW1 tracks its uplink with decrement 5, priority 110; DSW2 is 100 with preempt. The uplink fails. What happens?
- Nothing: DSW1 drops to 105, still above 100. Use a decrement larger than 10.
- Name two differences between HSRP and VRRP.
- VRRP is an open standard and preempts by default; HSRP is Cisco's and does not. Also active/standby versus master/backup, different multicast addresses and virtual MACs, and VRRP's owner concept.
Labs
Try it live: HSRPv2 with object tracking and IP SLA
More topics in 3.0 Infrastructure
- 3.1.a Troubleshoot 802.1Q trunks, whether configured statically or negotiated
- 3.1.b Troubleshoot static and dynamic EtherChannels
- 3.1.c Configure and verify RSTP and MST, plus protections such as root guard and BPDU guard
- 3.2.a Compare EIGRP and OSPF: algorithm, load balancing, path selection, metrics, areas
- 3.2.b Configure simple OSPFv2/v3: multiple areas, summarization, filtering, network types, passive interfaces
- 3.2.c Configure and verify eBGP between directly connected neighbors
- 3.2.d Describe policy-based routing
- 3.3.a Interpret NTP and PTP configurations