VRRP Protocol
Table of Contents
VRRP (Virtual Router Redundancy Protocol)
VRRP (Virtual Router Redundancy Protocol) is a network redundancy protocol used to provide a highly available default gateway for devices on a LAN. VRRP allows multiple physical routers to work together and share a Single Virtual IP Address, which is used by end devices as their default gateway. If the Primary Router Fails, another router automatically takes over the Virtual Gateway Role, allowing network communication to continue with minimal interruption.
Why Do We Need VRRP?
In an enterprise network, computers, servers, and other network devices require a default gateway to communicate with devices outside their local subnet. If only one router is configured as the default gateway and that router fails, all devices in that network may lose connectivity to other networks and the Internet.
VRRP Solves this Problem by allowing two or more routers to share a virtual gateway IP address. One router acts as the Master Router, while the other routers act as Backup Routers. If the Master Router becomes unavailable, one of the Backup Routers automatically becomes the Master and continues forwarding traffic using the same virtual IP address.
History of VRRP (Virtual Router Redundancy Protocol)
VRRP is an Open-Standard Network Redundancy Protocol developed through the Internet Engineering Task Force (IETF). It allows multiple routers to share a virtual gateway IP address so that if one router fails, another router can automatically take over the gateway role. Unlike Cisco’s historically proprietary HSRP, VRRP was designed as a vendor-neutral standard, allowing supported networking devices from different manufacturers to implement gateway redundancy.
VRRP History and RFC Evolution
RFC 2338 – Original VRRP (April 1998): The original VRRP specification was published in April 1998 as RFC 2338. It introduced the concept of multiple routers sharing a virtual IP address and electing one router to forward traffic while others remained ready to take over. It established the foundation for Layer 3 gateway redundancy in IP networks.
RFC 3768 – VRRP Revision (April 2004): RFC 3768 replaced RFC 2338 and revised the original VRRP protocol specification. It clarified protocol operation, election behavior, advertisement processing, and other implementation details. This version primarily covered IPv4 gateway redundancy.
RFC 5798 – VRRP Version 3 (March 2010): RFC 5798 introduced VRRP Version 3 for both IPv4 and IPv6. It replaced RFC 3768 and standardized VRRP operation for IPv4 and IPv6 networks, helping support modern dual-stack networking environments.
RFC 9568 – Updated VRRP Version 3 (April 2024): RFC 9568 is the latest specification in the VRRP RFC lineage. It replaces RFC 5798 and continues defining VRRP Version 3 for IPv4 and IPv6. The specification also updates terminology, using Active Router instead of the previous Master Router terminology.
Why VRRP Is an Open Standard?
VRRP is an open standard because its protocol specification is publicly documented and maintained through the IETF standards process. Network vendors can implement VRRP according to the published specification, allowing supported routers and Layer 3 switches from different manufacturers to participate in the same VRRP redundancy group, subject to platform and feature compatibility.
For example, a network engineer may deploy VRRP between supported routers from different vendors to provide a shared virtual gateway IP address for a LAN or VLAN. This provides gateway redundancy without requiring all participating devices to be from a single vendor.
How VRRP Works (Virtual Router Redundancy Protocol)
VRRP (Virtual Router Redundancy Protocol) works by allowing multiple physical routers to operate as a single virtual gateway for devices within a LAN or VLAN. Instead of configuring client computers with the IP address of one physical router, network administrators configure the clients with a shared virtual IP address that belongs to a VRRP group. Within this group, one router actively forwards traffic while the other router or routers remain in a backup role and monitor the active router. If the active router becomes unavailable, a backup router automatically takes over the virtual gateway function, allowing client devices to continue communicating with other networks without changing their default gateway configuration.
1. VRRP Creates a Virtual Router
VRRP first creates a logical or virtual router between two or more physical routers connected to the same Layer 2 network. This virtual router is identified by a VRID (Virtual Router Identifier), which is a number from 1 to 255. All participating routers must be configured with matching VRID and virtual IP address information for the same virtual router on that LAN. The virtual router does not represent a separate physical device; it is a logical gateway shared by the participating routers.
2. Virtual IP Address Configuration
Network engineers configure a virtual IP address that is shared by the VRRP group. This virtual IP address becomes the default gateway for client computers, servers, and other devices on that subnet. Each physical router also has its own individual IP address for management and routing purposes. The client devices use the virtual IP address instead of depending on the physical IP address of a particular router.
Example:
- Router 1 physical IP: 192.168.1.2
- Router 2 physical IP: 192.168.1.3
- VRRP Virtual IP: 192.168.1.1
- VRID: 10
- Network: 192.168.1.0/24
The computers in this LAN use 192.168.1.1 as their default gateway.
3. VRRP Router Election
When VRRP is configured and started, the participating routers determine which router will assume the forwarding responsibility for the virtual gateway. VRRP uses priority values to help determine which router should become the Active Router. The router with the highest priority is generally preferred to become Active, provided the relevant preemption rules allow it. The default priority for routers that are not IP address owners is normally 100. In VRRPv3, priority 255 is reserved for the router that owns the protected virtual IP address.
4. Active Router and Backup Routers
After the election process, one router becomes the Active Router, and the other participating routers remain in Backup state. The Active Router is responsible for forwarding traffic sent to the virtual gateway. The Backup Routers do not normally forward traffic for that virtual gateway while another router is Active; instead, they monitor VRRP advertisements and remain ready to take over if the Active Router becomes unavailable.
5. VRRP Advertisement Messages
The Active Router periodically sends VRRP Advertisement messages to inform the other VRRP routers that it is still operating. These messages contain important information such as the VRID, priority, and virtual IP address information. Backup Routers receive and process these advertisements to monitor the Active Router. In VRRPv3, the default advertisement interval is 1 second, although it can be configured differently.
6. VRRP Multicast Communication
VRRP uses multicast communication to distribute advertisement messages to participating routers on the same LAN. In VRRPv3, IPv4 VRRP advertisements are sent to Multicast Address 224.0.0.18, while IPv6 VRRP advertisements use FF02::12. This allows participating routers to receive protocol advertisements without the Active Router sending separate messages to every Backup Router.
7. Virtual MAC Address
VRRP uses a virtual MAC address associated with the VRID so that client devices can continue sending traffic to the same gateway MAC address even when the Active Router changes. For IPv4, the VRRP virtual MAC address format is 00-00-5E-00-01-{VRID}; for IPv6, it is 00-00-5E-00-02-{VRID}. For example, with VRID 10, the IPv4 virtual MAC address is 00-00-5E-00-01-0A.
8. Client ARP Process
When a client computer needs to communicate outside its local subnet, it checks its routing table and determines that the destination should be sent through its default gateway. If the client does not already have the gateway MAC address in its ARP cache, it sends an ARP request for the virtual gateway IP address. The Active Router responds with the VRRP virtual MAC address. The client then sends Ethernet frames to that virtual MAC address, allowing the traffic to reach the Active Router.
9. Active Router Forwards Traffic
When the client sends a packet to a destination outside its local network, the Ethernet frame is addressed to the VRRP virtual MAC address. The Active Router receives the frame and checks its routing table or forwarding table to determine the next hop. It then forwards the packet toward the destination network, such as another VLAN, a corporate WAN, or the Internet.
10. Backup Router Monitors the Active Router
The Backup Router continuously monitors the VRRP advertisements received from the Active Router. It checks the received information and maintains a timer to determine whether the Active Router is still available. If the advertisements stop arriving and the timer expires, the Backup Router considers the Active Router unavailable and prepares to take over the forwarding responsibility.
11. VRRP Failover Process
If the Active Router fails due to hardware failure, power failure, interface failure, or another condition that prevents VRRP communication, the Backup Router detects that the Active Router is no longer available. The eligible Backup Router with the highest priority takes over the Active Router role according to the VRRP election rules. It begins forwarding traffic for the virtual gateway and updates the LAN’s forwarding information so traffic can reach the new Active Router.
12. Gratuitous ARP During Failover
When a new Active Router takes over an IPv4 virtual gateway, it may send Gratuitous ARP messages to help update devices and Layer 2 switches with the new forwarding information. This helps ensure that traffic associated with the virtual gateway reaches the new Active Router. The virtual MAC address remains the same for the VRRP group, so client devices do not need to configure a different gateway IP address or a different virtual gateway MAC address.
13. Client Devices Continue Communication
After the Backup Router becomes the new Active Router, client computers continue using the same default gateway IP address. They do not need to change their IP configuration, default gateway, or DNS settings. The new Active Router takes responsibility for forwarding traffic through the virtual gateway. Depending on the network and application, some connections may experience a brief interruption during failover, but VRRP is designed to minimize gateway-related downtime.
14. When the Original Router Returns
When the original router comes back online, it re-enters the VRRP process and receives advertisements from the currently Active Router. If preemption is enabled and the returning router has a higher priority, it may reclaim the Active Router role. If preemption is disabled, the currently Active Router may continue operating as Active. This behavior depends on the VRRP configuration and the applicable election rules.
VRRP Hello Message (Advertisement Message)
In VRRP, the Hello message is commonly referred to as a VRRP Advertisement message. The Active Router periodically sends advertisement messages to other VRRP routers in the same VRRP group to inform them that it is operational and currently handling the virtual gateway. Backup Routers receive these advertisements and monitor the Active Router’s availability. If the advertisements stop arriving for a certain period, the Backup Router determines that the Active Router may have failed and can take over the Active role.
1. VRRP Hello Time (Advertisement Interval)
In VRRP, the Hello Time is commonly used to describe how frequently the Active Router sends advertisement messages to the Backup Routers. In the VRRP standard, this is called the Advertisement Interval. These messages inform the Backup Routers that the Active Router is still operational and is forwarding traffic for the virtual gateway. In VRRPv3, the default advertisement interval is 1 second, which means the Active Router normally sends an advertisement every one second. The advertisement interval can be configured to a different value depending on the network design and the supported device configuration.
2. VRRP Hold Time (Active-Down Interval)
The Hold Time is commonly used by network engineers to describe the period that a Backup Router waits before considering the Active Router unavailable after advertisement messages stop arriving. In the VRRP standard, this is known as the Active-Down Interval. The Backup Router does not take over immediately after one advertisement is missed; it waits until its Active-Down timer expires. The Active-Down Interval is calculated using the advertisement interval and a priority-based Skew Time.
How the Hold-Down Timer Works
Step 1 – Router 1 sends advertisements: Router 1 sends a VRRP advertisement approximately every 1 second. Router 2 receives the messages and knows that Router 1 is still the Active Router.
Step 2 – Router 1 fails: Suppose Router 1 suddenly loses power. It can no longer send VRRP advertisements to Router 2.
Step 3 – Router 2 detects missing advertisements: Router 2 stops receiving advertisements. It does not immediately become Active; it waits for its Active-Down timer to expire.
Step 4 – Hold-Down timer expires: If no valid advertisements arrive before the Active-Down timer expires, Router 2 considers the Active Router unavailable and takes over the virtual gateway.
Step 5 – Router 2 becomes Active: Router 2 begins forwarding traffic using the same virtual gateway IP address,
192.168.1.1.
Real-life Example: Imagine Router 1 is the main gateway of an office. All employees use 192.168.1.1 as their default gateway. If Router 1 fails, Router 2 waits for the VRRP failure detection timer, takes over the virtual gateway, and employees do not need to change their computer’s gateway settings.
VRRP Configuration
-------------------
R1
interface Ethernet0/1
description LAN Interface of Active Router
ip address 192.168.1.1 255.255.255.0
vrrp 1 ip 192.168.1.254 <—- Create VRRP Group 1 and assign Virtual IP
vrrp 1 priority 101 <—- Assign priority above 100 to make this the primary router
vrrp 1 preempt <—- Makes router active if it has higher priority
R2
interface Ethernet0/1
description LAN Interface of Standby Router
ip address 192.168.1.2 255.255.255.0
vrrp 1 ip 192.168.1.254 <—- Create VRRP Group 1 and assign Virtual IP
vrrp 1 preempt <—- Makes router active if it has higher priority
VRRP Interface Tracking
VRRP Interface Tracking is a feature that allows a VRRP router to monitor a specific interface or network path. If the tracked interface fails, the router reduces its VRRP priority, allowing another router with a higher priority to become the Master router and take over the virtual gateway.
Example: R1 is the VRRP Master with priority 120, and R2 is the Backup with priority 100. If R1’s WAN interface fails and its priority is reduced by 30, its new priority becomes 90. R2 can then become the Master router because it now has the higher priority.
VRRP Interface Tracking Configuration Example (Cisco)
Topology: R1 Master → R2 Backup
- R1 Priority: 120
- R2 Priority: 100
- Virtual IP: 192.168.10.1
- R1 WAN interface: GigabitEthernet0/1
- Priority decrement: 30
..R1 – Master Router..
interface GigabitEthernet0/0
ip address 192.168.10.2 255.255.255.0
vrrp 10 ip 192.168.10.1
vrrp 10 priority 120
vrrp 10 preempt
vrrp 10 track GigabitEthernet0/1 decrement 30
..R2 – Backup Router..
interface GigabitEthernet0/0
ip address 192.168.10.3 255.255.255.0
vrrp 10 ip 192.168.10.1
vrrp 10 priority 100
vrrp 10 preempt
How it works
- Normal: R1 priority 120 → Master; R2 → Backup.
- WAN failure: R1’s tracked interface fails.
- R1 priority decreases from 120 to 90 (120 − 30).
- R2 priority remains 100, which is now higher than R1’s 90.
- R2 becomes the Master router.
- When R1’s tracked interface recovers, its priority returns to 120 and, with preemption, R1 can become Master again.
Real-life Example: Imagine Router 1 is the main gateway of an office. All employees use 192.168.1.1 as their default gateway. If Router 1 fails, Router 2 waits for the VRRP failure detection timer, takes over the virtual gateway, and employees do not need to change their computer’s gateway settings.