What is Virtual Router Redundancy Protocol VRRP?
Unlike HSRP which is Cisco proprietary, VRRP is a Redundancy Protocol which operates in a network with multi-vendor devices.
VRRP offers the same benefits of HSRP, VRRP operates similar to HSRP by electing an active router called the Master among a group of routers that stores a configured virtual IP and MAC address.
Similar with HSRP, when there is a failure on the active router interface, VRRP would trigger the standby router (backup) to then become the Master and subsequently forward the client’s traffic.
VRRP uses multicast (220.127.116.11) for its hello mechanism and elections.
How VRRP Works.
VRRP Router Priority.
An important feature of the VRRP redundancy operation is the VRRP router priority. VRRP Priority defines the role that each VRRP router plays and what happens if the virtual router master fails.
If a VRRP active router is configured with the IP address of the virtual router and the IP address of the physical interface, this router will function as a virtual router master.
You use the vrrp priority command to enable the a VRRP router to functions as a virtual router as well as a backup should the virtual router master fails. You can configure the priority of each virtual router backup with a value of 1 through 254 using the vrrp priority command.
For example, if Router A, the virtual router master in a vrrp group fails, an election process takes place to determine if virtual router backups B or C should take over. If Routers B and C are configured with the priorities of 90 and 100, respectively, Router B is elected to become virtual router master because it has the higher priority.
If Routers B and C are both configured with the priority of 100, the virtual router backup with the higher IP address is elected to become the virtual router master.
Unlike in HSRP, VRRP preemption is enabled by default, which enables a higher priority virtual router backup that becomes accessible to take over from the virtual router backup that was elected to become virtual router master.
However, pre-emption can be disabled 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.
The virtual router (master) sends VRRP advertisements to other VRRP routers in the same group. The priority and state of the virtual router master are carried in the advertisements.
The VRRP advertisements are encapsulated in IP packets and sent to the IP Version multicast address assigned to the VRRP group.
Advertisements are sent every second by default; you can also configure what intervals you want the adverts sent.
How to configure VRRP on Cisco Router.
We are going to use the topology below for an vrrp configuration example.
we will configure VRRP on R1 and R2 using the virtual IP address 10.1.20.1 and priority command with the value 10 on R1 .
R1(config)# interface Gi0/0
R1(config-if)# ip address 10.1.20.2 255.255.255.0
R1(config-if)# vrrp 10 ip 10.1.20.1
R1(config-if)# vrrp 10 priority 100
R2(config)# interface Gi0/0
R2(config-if)# ip address 10.1.20.3 255.255.255.0
R2(config-if)# vrrp 10 ip 10.1.20.1
From the above, we configured VRRP on R1 and R2 using the virtual IP address 10.1.20.1 and priority command with the value 10 on R1 .
You can see that the vrrp group preempt command is not used because preempt is enabled by default for VRRP.
If you need to turn preempting off for any circumstance, use the command no vrrp group preempt.