Hands-on tutorial

Tutorials · Routing & Internet

How to Make the Default Gateway Redundant With VRRP

Use VRRP so two Layer 3 switches or routers share one virtual gateway address, and users keep working when one of them fails or is upgraded.

Intermediate9 min6 steps

Before you start

  • Two Layer 3 switches or routers on the same VLANs
  • One free IP address per VLAN for the virtual gateway
  • Uplinks from both devices to the rest of the network

Step by step

  1. Understand VRRP

    VRRP (Virtual Router Redundancy Protocol) gives a group of routers one virtual IP and MAC address. The master answers for it; if the master stops sending advertisements, the backup takes over within a few seconds.

  2. Plan addresses

    Per VLAN, give each device its own address and reserve one for the virtual gateway, for example .2 and .3 for the devices and .1 for VRRP. Clients use .1 as their gateway.

  3. Configure the group on both devices

    Use the same group ID and virtual IP on both, and a higher priority on the device that should normally be master.

    interface vlan 10
     ip address 10.0.10.2 255.255.255.0
     vrrp 10 ip 10.0.10.1
     vrrp 10 priority 120
     vrrp 10 preempt
    
  4. Track the uplink

    Lower the master's priority if its uplink fails, so the backup takes over even though the master is still running.

    vrrp 10 track interface te1/0/49 decrement 30
    
  5. Align with spanning tree

    Make the VRRP master also the spanning-tree root for the same VLANs, so traffic does not take an extra hop across the inter-switch link.

  6. Test failover

    Ping from a client continuously, then reload the master or unplug its uplink. Expect a few lost pings, not more.

Commands are generic, industry-standard examples. Exact syntax and menu names vary by model and firmware; check your device's manual on the Documentation page.

Pro tips

  • Use authentication or limit VRRP to trusted VLANs.
  • Split VLANs between the two devices as masters to share the load.
  • Document which device is master for which VLAN.