What VRRP is for
VRRP solves the same problem as HSRP: hosts have one default gateway address, and that address must survive a router failure. The difference is who owns the protocol. HSRP belongs to Cisco. VRRP is defined in an RFC, so routers from different vendors can share one virtual gateway. A campus that mixes Cisco switches with a Juniper or FortiGate firewall pair, or a data centre running Linux routers with keepalived, uses VRRP for exactly that reason.
Master, backup and the virtual router ID
- The group is a virtual router identified by a VRID (1 to 255 on a segment). It has one virtual IP and one virtual MAC address.
- The master answers ARP for the virtual IP with the virtual MAC and forwards the traffic sent to it. The backup routers stay silent for ARP and only listen.
- The virtual MAC for IPv4 is
0000.5e00.01XX, where XX is the VRID in hex. VRID 10 gives0000.5e00.010a. For IPv6 it is0000.5e00.02XX. - The master sends advertisements to the multicast address
224.0.0.18(IPv6:ff02::12) as IP protocol 112, not UDP, every second by default. The TTL is 255, so a router can drop an advertisement that arrives from off the segment.
How the master is elected
Each router has a priority from 1 to 254, default 100. The highest priority becomes master. If priorities tie, the router with the higher interface IP address wins. Two special values:
- 255 is reserved for the address owner: the router whose own interface IP is the virtual IP. It is always master while it is up.
- 0 is sent by a master that is shutting down. It tells the backups to take over at once without waiting for a timer.
Unlike HSRP, preempt is on by default. A router with a higher priority that comes back takes the master role from a router with a lower one. The address owner always preempts.
How long a failover takes
A backup does not use a fixed hold time. It waits for the master-down interval:
Master_Down_Interval = (3 × Advertisement_Interval) + Skew_Time where Skew_Time = (256 − Priority) / 256 seconds.
With the default 1-second advertisement, a backup with priority 100 waits 3 + 0.61 = 3.61 seconds. A backup with priority 200 would wait only 3.22 seconds. The skew is the standard's way of letting the best backup speak first, so two backups do not both claim the role. That is why VRRP usually fails over faster than HSRP's default 10-second hold time, with no tuning at all.
When the new master takes over it sends a gratuitous ARP for the virtual IP with the virtual MAC, so switches relearn the MAC on its port, exactly as in HSRP.
VRRPv2 and VRRPv3
On small screens, swipe sideways or focus the diagram and use the arrow keys.
How to configure VRRP on Cisco IOS
Commands are based on Cisco IOS / IOS XE documentation and haven't been run on a lab device here. VRRP support and syntax differ between platforms and releases, so check the configuration guide for your software.
! R1: master
interface GigabitEthernet0/0
ip address 192.168.10.2 255.255.255.0
vrrp 10 ip 192.168.10.1
vrrp 10 priority 110
vrrp 10 preemptClassic VRRPv2 syntax. Priority 110 beats R2's default 100. preempt is the default, but writing it makes the design obvious.
! R2: backup
interface GigabitEthernet0/0
ip address 192.168.10.3 255.255.255.0
vrrp 10 ip 192.168.10.1Same VRID and virtual IP, default priority 100.
fhrp version vrrp v3
interface GigabitEthernet0/0
vrrp 10 address-family ipv4
address 192.168.10.1 primary
priority 110
exit-vrrpThe VRRPv3 form on IOS XE, with an address family under the group. It is also how you add an IPv6 virtual address, in a second address family.
Tracking works as it does in HSRP: lower the priority when an uplink fails so the backup wins. In classic syntax that is vrrp 10 track 1 decrement 20, with track 1 interface GigabitEthernet0/1 line-protocol defined globally.
Reading show vrrp
R1#show vrrp brief Interface Grp Pri Time Own Pre State Master addr Group addr Gi0/0 10 110 3570 Y Master 192.168.10.2 192.168.10.1
192.168.10.2.R1#show vrrp GigabitEthernet0/0 GigabitEthernet0/0 - Group 10 State is Master Virtual IP address is 192.168.10.1 Virtual MAC address is 0000.5e00.010a Advertisement interval is 1.000 sec Preemption enabled Priority is 110 Master Router is 192.168.10.2 (local), priority is 110 Master Advertisement interval is 1.000 sec Master Down interval is 3.570 sec
0000.5e00.010a for group 10), the priority and the master's address.VRRP faults and what to check
On small screens, swipe sideways or focus the diagram and use the arrow keys.
Where VRRP setups usually break
- Blocking IP protocol 112 or multicast 224.0.0.18 with an ACL or a firewall policy.
- Assuming preempt behaves like HSRP: in VRRP it is on by default, so a flapping higher-priority router keeps taking the role back.
- Mixing VRRPv2 and VRRPv3 in one group.
- Using a virtual IP that another host already uses.
Exam tip: know that VRRP is an open standard, that roles are master and backup, that the virtual MAC is 0000.5e00.01XX, that it uses multicast 224.0.0.18 and IP protocol 112, that preempt is on by default, and that priority 255 belongs to the address owner.
VRRP facts for the exam
- Open standard; master forwards, backups listen.
- Priority 1–254, default 100, highest wins; 255 is the address owner.
- Master-down interval = 3 × advertisement interval + (256 − priority) / 256 s.
- Multicast 224.0.0.18, IP protocol 112; virtual MAC 0000.5e00.01XX.
- Preempt is on by default; verify with show vrrp brief.
Test yourself on VRRP
Which virtual MAC address does VRRP group 10 use for IPv4?
A backup router has priority 100 and the advertisement interval is 1 second. After the master fails, how long does the backup wait?
Which statement about VRRP preempt is correct?
VRRP routers on a VLAN both show Master. Which traffic should you check is permitted?
A router's own interface IP is the VRRP virtual IP. What priority does it use?