VRRP
VRRP
31
How Object Tracking Affects the Priority of a VRRP Router, page 31-5
VRRP Operation
There are several ways a LAN client can determine which router should be the first hop to a particular
remote destination. The client can use a dynamic process or static configuration. Examples of dynamic
router discovery are as follows:
Proxy ARPThe client uses Address Resolution Protocol (ARP) to get the destination it wants to
reach, and a router responds to the ARP request with its own MAC address.
31-1
Chapter 31
Routing protocolThe client listens to dynamic routing protocol updates (for example, from
Routing Information Protocol [RIP]) and forms its own routing table.
IRDP (ICMP Router Discovery Protocol) clientThe client runs an Internet Control Message
Protocol (ICMP) router discovery client.
The dynamic discovery protocols incur some configuration and processing overhead on the LAN client.
This could be detrimental also, in the event of a router failure, the process of switching to another router
can be slow.
An alternative to dynamic discovery protocols is to statically configure a default router on the client.
This approach simplifies client configuration and processing, but creates a single point of failure. If the
default gateway fails, the LAN client is limited to communicating only on the local IP network segment
and is detached from the rest of the network.
VRRP can solve the static configuration problem. VRRP enables a group of routers to form a single
virtual router. The LAN clients can then be configured with the virtual router as their default gateway.
The virtual router, representing a group of routers, is also known as a VRRP group.
VRRP is supported on Ethernet, Fast Ethernet, BVI, and Gigabit Ethernet interfaces, on MPLS VPNs,
VRF-aware MPLS VPNs and VLANs.
Figure 31-1 shows a LAN topology in which VRRP is configured. In this example, Routers A, B, and C
are VRRP routers (routers running VRRP) that comprise a virtual router. The IP address of the virtual
router is the same as that configured for the Ethernet interface of Router A (10.0.0.1).
Basic VRRP Topology
Router A
Virtual router
master
10.0.0.1
Client 1
Router B
Virtual router
backup
10.0.0.2
Client 2
Router C
Virtual router
backup
Virtual
router group
IP address = 10.0.0.1
10.0.0.3
Client 3
56623
Figure 31-1
Because the virtual router uses the IP address of the physical Ethernet interface of Router A, Router A
assumes the role of the virtual router master and is also known as the IP address owner. As the virtual
router master, Router A controls the IP address of the virtual router and is responsible for forwarding
packets sent to this IP address. Clients 1 through 3 are configured with the default gateway IP address
of 10.0.0.1.
Routers B and C function as virtual router backups. If the master virtual router fails, the router
configured with the higher priority will become the virtual router master and provide uninterrupted
service for the LAN hosts. When Router A recovers, it becomes the virtual router master again. For more
detail on the roles that VRRP routers play and what happens if the virtual router master fails, see the
VRRP Router Priority and Preemption section later in this document.
31-2
OL-23400-02
Chapter 31
Figure 31-2 shows a LAN topology in which VRRP is configured so that Routers A and B share the
traffic to and from clients 1 through 4 and that Routers A and B act as virtual router backups to each
other if either router fails.
Figure 31-2
Router A
Master for virtual router 1
Backup for virtual router 2
Router B
Backup for virtual router 1
Master for virtual router 2
10.0.0.2
129284
10.0.0.1
Client 1
Default gateway =
10.0.0.1
Client 2
Default gateway =
10.0.0.1
Client 3
Default gateway =
10.0.0.2
Client 4
Default gateway =
10.0.0.2
In this topology, two virtual routers are configured. (For more information, see the Multiple Virtual
Router Support section later in this document.) For virtual router 1, Router A is the owner of IP address
10.0.0.1 and virtual router master, and Router B is the virtual router backup to Router A. Clients 1 and
2 are configured with the default gateway IP address of 10.0.0.1.
For virtual router 2, Router B is the owner of IP address 10.0.0.2 and virtual router master, and Router A
is the virtual router backup to Router B. Clients 3 and 4 are configured with the default gateway IP
address of 10.0.0.2.
Benefits of VRRP
Redundancy
VRRP enables you to configure multiple routers as the default gateway router, which reduces the
possibility of a single point of failure in a network.
Load Sharing
You can configure VRRP in such a way that traffic to and from LAN clients can be shared by multiple
routers, thereby sharing the traffic load more equitably among available routers.
Multiple Virtual Routers
VRRP supports up to 255 virtual routers (VRRP groups) on a router physical interface, subject to the
platform supporting multiple MAC addresses. Multiple virtual router support enables you to implement
redundancy and load sharing in your LAN topology.
Multiple IP Addresses
The virtual router can manage multiple IP addresses, including secondary IP addresses. Therefore, if you
have multiple subnets configured on an Ethernet interface, you can configure VRRP on each subnet.
31-3
Chapter 31
Preemption
The redundancy scheme of VRRP enables you to preempt a virtual router backup that has taken over for
a failing virtual router master with a higher priority virtual router backup that has become available.
Authentication
VRRP message digest 5 (MD5) algorithm authentication protects against VRRP-spoofing software and
uses the industry-standard MD5 algorithm for improved reliability and security.
Advertisement Protocol
VRRP uses a dedicated Internet Assigned Numbers Authority (IANA) standard multicast address
(224.0.0.18) for VRRP advertisements. This addressing scheme minimizes the number of routers that
must service the multicasts and allows test equipment to accurately identify VRRP packets on a segment.
The IANA assigned VRRP the IP protocol number 112.
VRRP Object Tracking
VRRP object tracking provides a way to ensure the best VRRP router is virtual router master for the
group by altering VRRP priorities to the status of tracked objects such as interface or IP route states.
In a topology where multiple virtual routers are configured on a router interface, the interface can act as
a master for one virtual router and as a backup for one or more virtual routers.
31-4
OL-23400-02
Chapter 31
By default, a preemptive scheme is enabled whereby a higher priority virtual router backup that becomes
available takes over for the virtual router backup that was elected to become virtual router master. You
can disable this preemptive scheme using the no vrrp preempt command. If preemption is disabled, the
virtual router backup that is elected to become virtual router master remains the master until the original
virtual router master recovers and becomes master again.
VRRP Advertisements
The virtual router master sends VRRP advertisements to other VRRP routers in the same group. The
advertisements communicate the priority and state of the virtual router master. The VRRP
advertisements are encapsulated in IP packets and sent to the IPv4 multicast address assigned to the
VRRP group. The advertisements are sent every second by default; the interval is configurable.
Although the VRRP protocol as per RFC 3768 does not support millisecond timers, Cisco routers allow
you to configure millisecond timers. You need to manually configure the millisecond timer values on
both the primary and the backup routers. The master advertisement value displayed in the show vrrp
command output on the backup routers is always 1 second because the packets on the backup routers do
not accept millisecond values.
You must use millisecond timers where absolutely necessary and with careful consideration and testing.
Millisecond values work only under favorable circumstances, and you must be aware that the use of the
millisecond timer values restricts VRRP operation to Cisco devices only.
31-5
Chapter 31
the specified object goes down, the VRRP priority is reduced. The VRRP router with the higher priority
can now become the virtual router master if it has the vrrp preempt command configured. See the
VRRP Object Tracking section for more information on object tracking.
VRRP Authentication
VRRP ignores unauthenticated VRRP protocol messages. The default authentication type is text
authentication.
You can configure VRRP text authentication, authentication using a simple MD5 key string, or MD5 key
chains for authentication.
MD5 authentication provides greater security than the alternative plain text authentication scheme. MD5
authentication allows each VRRP group member to use a secret key to generate a keyed MD5 hash of
the packet that is part of the outgoing packet. A keyed hash of an incoming packet is generated and if
the generated hash does not match the hash within the incoming packet, the packet is ignored.
The key for the MD5 hash can either be given directly in the configuration using a key string or supplied
indirectly through a key chain.
A router ignores incoming VRRP packets from routers that do not have the same authentication
configuration for a VRRP group. VRRP has three authentication schemes:
No authentication
MD5 authentication
The authentication schemes differ on the router and in the incoming packet.
Text authentication strings differ on the router and in the incoming packet.
ISSUVRRP
VRRP supports In Service Software Upgrade (ISSU). An ISSU allows a high-availability (HA) system
to run in Stateful Switchover (SSO) mode even when different versions of Cisco IOS software are
running on the active and standby Route Processors (RPs) or line cards.
ISSU provides the ability to upgrade or downgrade from one supported Cisco IOS release to another
while continuing to forward packets and maintain sessions, thereby reducing planned outage time. The
ability to upgrade or downgrade is achieved by running different software versions on the active RP and
standby RP for a short period of time to maintain state information between RPs. This feature allows the
system to switch over to a secondary RP running upgraded (or downgraded) software and continue
forwarding packets without session loss and with minimal or no packet loss. This feature is enabled by
default.
For detailed information about ISSU, see the Cisco IOS In Service Software Upgrade Process document
at the following URL:
http://www.cisco.com/en/US/docs/ios/ha/configuration/guide/ha-inserv_updg.html
For detailed information about ISSU on the 7600 series routers, see the ISSU and eFSU on Cisco 7600
Series Routers document at the following URL:
31-6
OL-23400-02
Chapter 31
http://www.cisco.com/en/US/partner/products/hw/routers/ps368/products_configuration_guide_chapte
r09186a00807f1c85.html
SSOVRRP
With the introduction of the SSOVRRP feature, VRRP is SSO aware. VRRP can detect when a router
is failing over to the secondary RP and continue in its current group state.
SSO functions in networking devices (usually edge devices) that support dual Route Processors (RPs).
SSO provides RP redundancy by establishing one of the RPs as the active processor and the other RP as
the standby processor. SSO also synchronizes critical state information between the RPs so that network
state information is dynamically maintained between RPs.
Prior to being SSO aware, if VRRP was deployed on a router with redundant RPs, a switchover of roles
between the active RP and the standby RP would result in the router relinquishing its activity as a VRRP
group member and then rejoining the group as if it had been reloaded. The SSOVRRP feature enables
VRRP to continue its activities as a group member during a switchover. VRRP state information between
redundant RPs is maintained so that the standby RP can continue the routers activities within the VRRP
during and after a switchover.
This feature is enabled by default. To disable this feature, use the no vrrp sso command in global
configuration mode.
For more information, see the Stateful Switchover document at the following URL:
http://www.cisco.com/en/US/docs/ios/ha/configuration/guide/ha-stfl_swovr.html
Configuring VRRP
The following sections outline the steps necessary to configure VRRP:
Configuring VRRP MD5 Authentication Using a Key String, page 31-11 (optional)
Configuring VRRP MD5 Authentication Using a Key Chain, page 31-12 (optional)
Enabling the Router to Send SNMP VRRP Notifications, page 31-15 (optional)
Customizing VRRP
Customizing the behavior of VRRP is optional. Be aware that as soon as you enable a VRRP group, that
group is operating. It is possible that if you first enable a VRRP group before customizing VRRP, the
router could take over control of the group and become the virtual router master before you have finished
customizing the feature. Therefore, if you plan to customize VRRP, it is a good idea to do so before
enabling VRRP.
Complete the following steps in privileged EXEC mode to customize VRRP:
31-7
Chapter 31
Configuring VRRP
Step 1
Command or Action
Purpose
enable
Step 2
configure terminal
Step 3
Step 4
Step 5
Step 6
Step 7
Step 8
Note
Step 9
Step 10
no vrrp sso
Enabling VRRP
To enable VRRP perform the following steps.
Command or Action
Purpose
Step 1
enable
Step 2
configure terminal
31-8
OL-23400-02
Chapter 31
Command or Action
Purpose
Step 3
Step 4
Step 5
Note
Step 6
end
Step 7
Step 8
Step 1
Command or Action
Purpose
enable
Step 2
configure terminal
31-9
Chapter 31
Configuring VRRP
Command or Action
Purpose
Step 3
Step 4
Step 5
Note
Step 1
Command or Action
Purpose
enable
Step 2
configure terminal
Step 3
Step 4
Step 5
Step 6
Step 7
31-10
OL-23400-02
Chapter 31
Command or Action
Purpose
Step 8
end
Step 9
Interoperability with vendors that may have implemented the RFC 2338 method is not enabled.
Text authentication cannot be combined with MD5 authentication for a VRRP group at any one time.
When MD5 authentication is configured, the text authentication field in VRRP hello messages is set
to all zeroes on transmit and ignored on receipt, provided the receiving router also has MD5
authentication enabled.
To configure VRRP MD5 Authentication using a key string perform the following steps.
Step 1
Command
Purpose
enable
Step 2
configure terminal
Step 3
Step 4
Step 5
31-11
Chapter 31
Configuring VRRP
Step 6
Command
Purpose
Note
Step 7
Step 8
Step 9
end
Restrictions
The following restrictions apply to configuring VRRP MD5 using a keychain.
Interoperability with vendors that may have implemented the RFC 2338 method is not enabled.
Text authentication cannot be combined with MD5 authentication for a VRRP group at any one time.
When MD5 authentication is configured, the text authentication field in VRRP hello messages is set
to all zeroes on transmit and ignored on receipt, provided the receiving router also has MD5
authentication enabled.
To configure VRRP MDF authentication using a key chain perform the following steps.
31-12
OL-23400-02
Chapter 31
Step 1
Command
Purpose
enable
Step 2
configure terminal
Step 3
Step 4
key key-id
Step 5
key-string string
Step 6
exit
Step 7
Step 8
Step 9
Step 10
Note
Step 11
Step 12
Step 13
end
31-13
Chapter 31
Configuring VRRP
Step 1
show vrrp
Use this command to verify that the authentication is configured correctly:
Router# show vrrp
Ethernet0/1 - Group 1
State is Master
Virtual IP address is 10.21.0.10
Virtual MAC address is 0000.5e00.0101
Advertisement interval is 1.000 sec
Preemption is enabled
min delay is 0.000 sec
Priority is 100
Authentication MD5, key-string, timeout 30 secs
Master Router is 10.21.0.1 (local), priority is 100
Master Advertisement interval is 1.000 sec
Master Down interval is 3.609 sec
This output shows that MD5 authentication is configured and the f00d4s key string is used. The timeout
value is set at 30 seconds.
Step 2
Rcvd:
HshC:
HshR:
Grp 1
21016401FE050000AC1801FE0000000000000000
B861CBF1B9026130DD34AED849BEC8A1
C5E193C6D84533FDC750F85FCFB051E1
Adv from 172.24.1.2 has failed MD5 auth
Rcvd:
HshC:
HshR:
Grp 1
21016401FE050000AC1801FE0000000000000000
C5E193C6D84533FDC750F85FCFB051E1
B861CBF1B9026130DD34AED849BEC8A1
Adv from 172.24.1.1 has failed MD5 auth
Interoperability with vendors that may have implemented the RFC 2338 method is not enabled.
Text authentication cannot be combined with MD5 authentication for a VRRP group at any one time.
When MD5 authentication is configured, the text authentication field in VRRP hello messages is set
to all zeroes on transmit and ignored on receipt, provided the receiving router also has MD5
authentication enabled.
31-14
OL-23400-02
Chapter 31
Step 1
Command
Purpose
enable
Step 2
configure terminal
Step 3
Step 4
Step 5
Note
Step 6
Step 7
Step 8
end
31-15
Chapter 31
Step 1
Command or Action
Purpose
enable
Step 2
configure terminal
Step 3
Step 4
Example: VRRP MD5 Authentication Configuration Using a Key String, page 31-18
Example: VRRP MD5 Authentication Configuration Using a Key Chain, page 31-18
Group 1:
Virtual IP address is 10.1.0.10.
Router A will become the master for this group with priority 120.
Advertising interval is 3 seconds.
Preemption is enabled.
Group 5:
Router B will become the master for this group with priority 200.
Advertising interval is 30 seconds.
Preemption is enabled.
Group 100:
Router A will become the master for this group first because it has a higher IP address
(10.1.0.2).
Advertising interval is the default 1 second.
Preemption is disabled.
31-16
OL-23400-02
Chapter 31
Router A
RouterA(config)# interface ethernet 1/0
RouterA(config-if)# ip address 10.1.0.2 255.0.0.0
RouterA(config-if)# vrrp 1 priority 120
RouterA(config-if)# vrrp 1 authentication cisco
RouterA(config-if)# vrrp 1 timers advertise 3
RouterA(config-if)# vrrp 1 timers learn
RouterA(config-if)# vrrp 1 ip 10.1.0.10
RouterA(config-if)# vrrp 5 priority 100
RouterA(config-if)# vrrp 5 timers advertise 30
RouterA(config-if)# vrrp 5 timers learn
RouterA(config-if)# vrrp 5 ip 10.1.0.50
RouterA(config-if)# vrrp 100 timers learn
RouterA(config-if)# no vrrp 100 preempt
RouterA(config-if)# vrrp 100 ip 10.1.0.100
RouterA(config-if)# no shutdown
Router B
RouterB(config)# interface ethernet 1/0
RouterB(config-if)# ip address 10.1.0.1 255.0.0.0
RouterB(config-if)# vrrp 1 priority 100
RouterB(config-if)# vrrp 1 authentication cisco
RouterB(config-if)# vrrp 1 timers advertise 3
RouterB(config-if)# vrrp 1 timers learn
RouterB(config-if)# vrrp 1 ip 10.1.0.10
RouterB(config-if)# vrrp 5 priority 200
RouterB(config-if)# vrrp 5 timers advertise 30
RouterB(config-if)# vrrp 5 timers learn
RouterB(config-if)# vrrp 5 ip 10.1.0.50
RouterB(config-if)# vrrp 100 timers learn
RouterB(config-if)# no vrrp 100 preempt
RouterB(config-if)# vrrp 100 ip 10.1.0.100
RouterB(config-if)# no shutdown
31-17
Chapter 31
In this example, VRRP queries the key chain to obtain the current live key and key ID for the specified
key chain.
31-18
OL-23400-02
Chapter 31
31-19
Chapter 31
31-20
OL-23400-02