VRRP (Virtual Router Redundancy Protocol) is an industry-standard protocol (RFC 5798) that provides automatic gateway failover for high availability. VRRP allows multiple routers to work together in a group, presenting themselves as a single virtual router with a virtual IP address that serves as the default gateway for hosts.
When the primary (master) router fails, a backup router automatically takes over, ensuring uninterrupted network connectivity with minimal downtime.
VRRP operates by creating a virtual router with a virtual IP address (VIP) and virtual MAC address. One router in the VRRP group becomes the Master, while others remain in Backup state.
VRRP uses a virtual MAC address in the format: 0000.5E00.01XX where XX is the VRRP group number in hexadecimal.
Example: VRRP Group 10 = 0000.5E00.010A
Scenario: Two routers providing redundant default gateway for VLAN 10
configure terminal interface GigabitEthernet 0/0 description *** VLAN 10 Gateway *** ip address 192.168.10.2 255.255.255.0 vrrp 10 ip 192.168.10.1 vrrp 10 priority 110 vrrp 10 preempt no shutdown exit
configure terminal interface GigabitEthernet 0/0 description *** VLAN 10 Gateway Backup *** ip address 192.168.10.3 255.255.255.0 vrrp 10 ip 192.168.10.1 vrrp 10 priority 100 vrrp 10 preempt no shutdown exit
Explanation:
vrrp 10 ip 192.168.10.1 - Defines VRRP group 10 with virtual IPvrrp 10 priority 110 - Sets priority (higher = preferred Master)vrrp 10 preempt - Allows router to reclaim Master role when it recoversinterface GigabitEthernet 0/0 vrrp 10 timers advertise 3 exit
Sets advertisement interval to 3 seconds (default is 1 second)
interface GigabitEthernet 0/0 vrrp 10 preempt delay minimum 60 exit
Delays preemption for 60 seconds after router comes online (prevents flapping)
interface GigabitEthernet 0/0 vrrp 10 authentication text MySecretKey exit
Note: Plain text authentication is deprecated. Use IPsec for secure VRRP
configure terminal track 1 interface GigabitEthernet 0/1 line-protocol exit interface GigabitEthernet 0/0 vrrp 10 track 1 decrement 20 exit
Decrements priority by 20 if GigabitEthernet 0/1 goes down. Useful for tracking uplink connectivity.
interface GigabitEthernet 0/0 vrrp 10 description Primary-Gateway-VLAN10 exit
You can configure multiple VRRP groups on the same interface to achieve load balancing by having different routers serve as Master for different VLANs.
configure terminal interface GigabitEthernet 0/0.10 description *** VLAN 10 *** encapsulation dot1Q 10 ip address 192.168.10.2 255.255.255.0 vrrp 10 ip 192.168.10.1 vrrp 10 priority 110 vrrp 10 preempt exit interface GigabitEthernet 0/0.20 description *** VLAN 20 *** encapsulation dot1Q 20 ip address 192.168.20.2 255.255.255.0 vrrp 20 ip 192.168.20.1 vrrp 20 priority 90 vrrp 20 preempt exit
configure terminal interface GigabitEthernet 0/0.10 description *** VLAN 10 *** encapsulation dot1Q 10 ip address 192.168.10.3 255.255.255.0 vrrp 10 ip 192.168.10.1 vrrp 10 priority 90 vrrp 10 preempt exit interface GigabitEthernet 0/0.20 description *** VLAN 20 *** encapsulation dot1Q 20 ip address 192.168.20.3 255.255.255.0 vrrp 20 ip 192.168.20.1 vrrp 20 priority 110 vrrp 20 preempt exit
Result: Router 1 is Master for VLAN 10, Router 2 is Master for VLAN 20, providing load distribution.
show vrrp
Displays VRRP configuration and status for all groups
show vrrp brief
Displays summary of VRRP groups
show vrrp interface GigabitEthernet 0/0
Shows VRRP information for specific interface
show vrrp statistics
Displays VRRP packet statistics
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.609 sec
Key Fields:
debug vrrp all debug vrrp events debug vrrp packets
Warning: Use debug carefully in production. Disable after troubleshooting:
no debug all undebug all
Cause: No connectivity between routers, blocking multicast
Solution:
# Verify connectivity ping 192.168.10.3 source 192.168.10.2 # Check for ACLs blocking VRRP (IP protocol 112) show ip access-lists # Check multicast routing show ip mroute 224.0.0.18
Check:
show vrrp show ip interface brief show run interface GigabitEthernet 0/0
Common Causes:
Solution:
# Increase advertisement interval interface GigabitEthernet 0/0 vrrp 10 timers advertise 3 # Add preempt delay vrrp 10 preempt delay minimum 60 exit
Check priorities:
show vrrp | include Priority
Adjust priority:
interface GigabitEthernet 0/0 vrrp 10 priority 120 exit
! Router 1 - Primary VRRP Master
hostname R1
! Configure object tracking for uplink
track 1 interface GigabitEthernet 0/1 line-protocol
! VLAN 10 Configuration
interface GigabitEthernet 0/0
description *** LAN Interface VLAN 10 ***
ip address 192.168.10.2 255.255.255.0
vrrp 10 ip 192.168.10.1
vrrp 10 description Primary-Gateway-VLAN10
vrrp 10 priority 110
vrrp 10 preempt
vrrp 10 preempt delay minimum 30
vrrp 10 track 1 decrement 20
no shutdown
exit
! Uplink Interface
interface GigabitEthernet 0/1
description *** Uplink to ISP ***
ip address 203.0.113.2 255.255.255.252
no shutdown
exit
! Save configuration
end
write memory
! Router 2 - Backup VRRP Router
hostname R2
! Configure object tracking for uplink
track 1 interface GigabitEthernet 0/1 line-protocol
! VLAN 10 Configuration
interface GigabitEthernet 0/0
description *** LAN Interface VLAN 10 ***
ip address 192.168.10.3 255.255.255.0
vrrp 10 ip 192.168.10.1
vrrp 10 description Backup-Gateway-VLAN10
vrrp 10 priority 100
vrrp 10 preempt
vrrp 10 preempt delay minimum 30
vrrp 10 track 1 decrement 20
no shutdown
exit
! Uplink Interface
interface GigabitEthernet 0/1
description *** Uplink to ISP ***
ip address 203.0.113.6 255.255.255.252
no shutdown
exit
! Save configuration
end
write memory
! Basic Configuration interface GigabitEthernet 0/0 ip address 192.168.10.2 255.255.255.0 vrrp 10 ip 192.168.10.1 vrrp 10 priority 110 vrrp 10 preempt ! Advanced Options vrrp 10 timers advertise 3 vrrp 10 preempt delay minimum 60 vrrp 10 description My-Gateway vrrp 10 track 1 decrement 20 ! Verification show vrrp show vrrp brief show vrrp interface GigabitEthernet 0/0 show vrrp statistics ! Troubleshooting debug vrrp events debug vrrp packets show track
VRRP provides robust, standards-based gateway redundancy for network high availability. As an industry-standard protocol, VRRP works across multiple vendors and provides automatic failover with minimal configuration complexity.
Proper VRRP configuration with appropriate priority settings, preemption, and object tracking ensures that your network maintains connectivity even during router failures or maintenance. By following best practices and thoroughly testing failover scenarios, you can build a resilient network infrastructure that provides seamless gateway redundancy for your users.
Remember to configure both routers identically except for priority values, test failover regularly, and monitor VRRP state changes to maintain optimal network availability.