What is VRRP?
VRRP is an abbreviation for "Virtual Router Redundancy Protocol" and is a protocol that supports router redundancy on the network.
Also known as Virtual Router Redundancy Protocol, it allows for high availability and redundancy of default gateways within the same subnet. Defined in RFC3768 and supported by routers, layer 3 switches, etc.
First, let's look at a network configuration without VRRP.
If a failure occurs in RouterA as shown in the figure below, PCs belonging to segment A cannot avoid this failure.
If you lose the default gateway, the devices on the segment connected to that default gateway will not be able to communicate. As a countermeasure to avoid this failure, there are the following countermeasures.
- How to bypass with dynamic routing
- How to use VRRP
- HSRP *Cisco proprietary
Here, we will explain an example of redundancy using VRRP.
Add router B to the previous network configuration diagram and reconfigure the network as shown below.
Normally, only one default gateway can be set for a PC belonging to segment A. Here, the IP address assigned to the interface on the segment A side of RouterA is used as the default gateway of the PC belonging to segment A.
However, when the segment A side of RouterA goes down as shown in the figure, if VRRP is not used, the default gateway of the PC belonging to segment A is changed to the IP address assigned to the interface on the segment B side of RouterB. I have to.
Even in an environment where TCP/IP settings are issued by DHCP, it is necessary to change the assignment of the DHCP server, and the PC on the segment A side must reacquire an IP address.
In this state, the default gateway cannot be changed automatically.
Here, assigning the same IP address to the two routers seems to work well, but that would violate the rule of the network that "there should be no duplicate IP addresses". will result in an IP address conflict.
VRRP eliminates this annoyance.
A redundant configuration without VRRP requires switching the default gateway on the client side, and the inconvenience of not being able to switch seamlessly is a problem.
If you use VRRP to make the router redundant, you can automatically communicate via RouterB without changing the default gateway setting on the client side.
As shown in the figure below, the VRRP mechanism configures one group with multiple routers and creates a virtual router with a virtual IP address and a virtual MAC address. A virtual router consists of two or more physical routers.
The virtual MAC address uses the MAC address "00-00-5E-00-01-XX".
Among multiple routers running VRRP, one router is usually the master. This router is called the master router.
This master router communicates using the virtual router's IP address and MAC address (the master router replies with an ARP response as a proxy).
Other routers act as backups and stand by in case the master router fails. This router is called a backup router.
If the master router goes down, the backup router will immediately take over the virtual IP address and virtual MAC address to keep the virtual router alive and running.
Assign a priority to each physical router. Assign the master router a higher priority number (larger value) than the backup router.
Assign a priority between 1 and 254.
*The value of 255 has a special meaning. For Cisco routers, 255, the highest priority, is the master router whose interface IP address is equal to the virtual IP address. YAMAHA routers have a priority value of 255 and always operate in preemption mode.
The host setting does not set the IP address of the physical router as the default gateway, but sets the IP address of the virtual router as the default gateway.
In the above figure, specify the virtual IP address Z. By doing so, even if the master router goes down, communication can be continued via the backup router.
There is a preemption mode in the operation mode of VRRP. The method of electing the master router changes depending on whether it is in preemption mode or not.
In non-preempt mode, if a low-priority VRRP router becomes the master router first, the master router will not switch even if a high-priority VRRP router joins later.
In preemption mode, the master router will switch to a higher priority VRRP router whenever it joins. Normally, it operates in preemption mode. Preempt mode is the default mode of operation on many routers.