Configuring VRRP

What is VRRP and why to use it?

Virtual Router Redundancy Protocol (VRRP) is an election protocol that dynamically assigns responsibility for one or more virtual routers to the VRRP routers on a LAN, allowing several routers on a multiaccess link to utilize the same virtual IP address. A VRRP router is configured to run the VRRP protocol in conjunction with one or more other routers attached to a LAN. In a VRRP configuration, one router is elected as the virtual router master, with the other routers acting as backups in case the virtual router master fails.

In regards to using VRRP with dynamic routing protocols, routers do not use the virtual IP addresses of VRRP to form adjacencies. VRRP is designed to provide end-users devices and servers default gateway/router redundancy. For instance, EIGRP neighbor relationship are not formed with the VRRP Virtual IP Address but with the physical interface IP address. As such if you are using VRRP along with a dynamic routing protocol you should ensure your routes prefer the active router unless offline to avoid issues as only the active VRRP router for a group will forward packets.

In the network below there are a total of two routers, two end-user computers and one server. In the example below we will configure three VRRP groups, two for the LAN and one for the WAN network. R1 will be the primary gateway for PC1, and R2 the primary gateway for PC2. This will make use of both routers to prevent network capacity from being underutilized. R1 will be the active router for the 1.1.1.0/29 network and failover and failback must occur automatically. VRRP groups will also make use of authentication to prevent any rogue routers from interfering with VRRP operations.

Step 2: On Router R1 configure VRRP groups using the vrrp command, set the group virtual IP and priority 105 for VRRP groups 1 and 2 only. This will be repeated for both interfaces but each interface will participate in a separate VRRP group.

Step 3: On Router R2 configure a VRRP group using the vrrp command, set the group virtual IP and priority 105 for VRRP group 3 only. This will be repeated for both interfaces but each interface again will participate in separate VRRP groups.

NOTE: The vrrp 1 priority 105 is used to specify a higher priority for R1 ensuring it is always the active VRRP router. The default priority for VRRP routers is 100 and the default decrement is 10. This is the mechanism for R1 to enforce the higher priority and fail back from R2 to R1 when R1 comes back online.

Step 4: Configure VRRP tracking on R1 to decrement the routers priority when it sees any interface down. This is important because if one interface on either side of the router is down any traffic coming into the router will be unable to reach the desired destination.

Verify the configuration

Now that the configuration is finished lets verify our VRRP deployment. Using the ping, traceroute and show ip route on PC1 we can verify connectivity, the path used to reach the destination and default gateway. You will find ping is successful from PC1 to Server and the path is PC1 to R1 to Server. On PC2 you will find ping is also successful but the path PC2 takes to reach Server is PC2 to R2 to Server.

On R1 issue the show vrrp command to verify the active VRRP routers. This will confirm R1 is the active router for groups 1 and 2, and R2 is the active router for group 3.

Now let's shutdown an interface on R1 and perform the same steps from PC1. As you can see everything functions the same with the only exception your default gateway, 10.1.0.3, is routed through the backup router R2 which is now the active VRRP router for VRRP groups 1, 2, and 3.

For the last verification step turn R1 back on and repeat the steps again. Your default gateway, 10.1.0.3, will again be routed through tR1 and is once again the active router for groups 1 and 2.

Related Posts

What is load sharing and why to use it?Load balancing with BGP is not possible in a multihomed environment with two ISPs. BGP selects only the single best path to a destination among the BGP Read more…

What is a Dynamic Multipoint VPN and why to use it?DMVPN provides the capability for creating a dynamic-mesh VPN network without having to pre-configure (static) all possible tunnel end-point peers, including IPsec (Internet Protocol Security) Read more…