VRRP

1. Function Overview

VRRP is a protocol that provides redundancy for the default gateway by virtualizing multiple routers on the same LAN into a single virtual router.
If the default gateway is configured with only one router, and this router fails, hosts on the same LAN will no longer be able to communicate with external networks.
If you configure a default gateway using the VRRP function, there is a standby router alongside the active router. Therefore, even if the active router fails, the standby router takes over operation, allowing hosts on the same LAN to maintain communication with external networks.

  • Normal times

    image

    Normally, the side with the higher priority (the L3 switch on the left in the diagram) becomes the master router and routes packets destined for the IP address assigned to the virtual router.
    The switch with the lower priority (the L3 switch on the right in the diagram) waits as a backup router.

  • When a failure occurs in the master router

    image

    If a backup router detects a failure in the master router, it will act as the new master router.

This product only supports VRRPv3.

2. Definition of Terms Used

Virtual Router

A router configured by virtualizing multiple routers using VRRP.

Virtual IP Address

The IP address assigned to the virtual router.

Virtual MAC Address

The MAC address assigned to the virtual router.

Master Router

A router that routes packets forwarded to a virtual IP address.

Backup Router

A router that takes over control of the virtual IP address if the master router fails.

3. Function Details

This product supports the following functions.

  • Setting priority

  • Setting preempt mode

  • Configuring circuit failover

3.1. Setting priority

Each VRRP router has a priority. The router with the higher priority becomes the master router, while the other routers become backups.
Priority is set using a number between 1 and 255, but to ensure smooth master/backup switching, it is advisable to make the difference in priority as large as possible.
If the priority values are the same, the VRRP router with the smaller IP address is given priority.
The priority is set using the priority command.

3.2. Setting preempt mode

Preempt mode is one of the operation modes of VRRP.
When preempt mode is disabled, if a VRRP router with a lower priority has become the master router first, even if a VRRP router with a higher priority joins later, the master router will not be switched and the previous master router will continue to operate as the master. On the other hand, if preempt mode is enabled, the master router will always be switched to a VRRP router with a higher priority whenever it joins.
The preempt mode is set using the preempt-mode command.

3.3. Configuring circuit failover

Circuit failover is a function that switches the master router by monitoring a specific VLAN interface or physical interface and changing the VRRP router priority according to the link status of that interface.
If routing becomes impossible when a specific interface goes down, you can maintain routing by enabling circuit failover.
Circuit failover is enabled with the circuit-failover command.

4. Related Commands

Related commands are indicated below.
For details on the commands, refer to the Command Reference.

Operations Operating commands

Switch to VRRP mode

router vrrp

Switch to VRRP mode (IPv6)

router ipv6 vrrp

Advertisement packet transmission interval setting

advertisement-interval

Circuit failover settings

circuit-failover

Enable/disable virtual router

virtual-router

Preempt mode setting

preempt-mode

Virtual router priority setting

priority

Virtual IP address settings

virtual-ip

Virtual IP address settings (IPv6)

virtual-ipv6

Display VRRP information

show vrrp

Display VRRP information (IPv6)

show vrrp ipv6

Display VRRP statistics

show vrrp statistics

Display VRRP statistics (IPv6)

show vrrp ipv6 statistics

5. Examples of Command Execution

5.1. VRRP Configuration (IPv4)

Spanning tree is disabled. When used in conjunction with spanning tree, MST instances and other settings must be configured correctly.

  1. [Switch #A] Disable spanning tree.

    Yamaha(config)#spanning-tree shutdown
  2. [Switch #A] Define VLAN #100 and VLAN #200.

    Yamaha(config)#vlan database
    Yamaha(config-vlan)#vlan 100 (1)
    Yamaha(config-vlan)#vlan 200 (2)
    Yamaha(config-vlan)#exit
    1 Define VLAN #100
    2 Define VLAN #200
  3. [Switch #A] Assign IP addresses to VLAN #100 and VLAN #200.

    Yamaha(config)#interface vlan100
    Yamaha(config-if)#ip address 192.168.100.240/24 (1)
    Yamaha(config-if)#exit
    Yamaha(config)#interface vlan200
    Yamaha(config-if)#ip address 192.168.200.240/24 (2)
    Yamaha(config-if)#exit
    1 Assign 192.168.100.240 to VLAN #100
    2 Assign 192.168.200.240 to VLAN #200
  4. [Switch #A] Assign LAN port #1 to VLAN #100.

    Yamaha(config)#interface port1.1
    Yamaha(config-if)#switchport access vlan 100 (1)
    Yamaha(config-if)#exit
    1 Assign to VLAN #100
  5. [Switch #A] Assign LAN port #2 to VLAN #200.

    Yamaha(config)#interface port1.2
    Yamaha(config-if)#switchport access vlan 200 (1)
    Yamaha(config-if)#exit
    1 Assign to VLAN #200
  6. [Switch #A] Create virtual router #1 on VLAN #100 and add the settings.

    Yamaha(config)#router vrrp 1 vlan100 (1)
    Yamaha(config-router)#virtual-ip 192.168.100.228 (2)
    Yamaha(config-router)#virtual-router enable (3)
    Yamaha(config-if)#exit
    1 Create virtual router #1 on VLAN #100
    2 Assign virtual IP address 192.168.100.228 to virtual router #1
    3 Enable virtual router #1
  7. [Switch #A] Create virtual router #2 on VLAN #200 and add the settings.

    Yamaha(config)#router vrrp 2 vlan200 (1)
    Yamaha(config-router)#virtual-ip 192.168.200.228 (2)
    Yamaha(config-router)#virtual-router enable (3)
    Yamaha(config-if)#exit
    1 Create virtual router #2 on VLAN #200
    2 Assign virtual IP address 192.168.200.228 to virtual router #2
    3 Enable virtual router #2
  8. [Switch #B] Disable spanning tree.

    Yamaha(config)#spanning-tree shutdown
  9. [Switch #B] Define VLAN #100 and VLAN #200.

    Yamaha(config)#vlan database
    Yamaha(config-vlan)#vlan 100 (1)
    Yamaha(config-vlan)#vlan 200 (2)
    Yamaha(config-vlan)#exit
    1 Define VLAN #100
    2 Define VLAN #200
  10. [Switch #B] Assign IP addresses to VLAN #100 and VLAN #200.

    Yamaha(config)#interface vlan100
    Yamaha(config-if)#ip address 192.168.100.241/24 (1)
    Yamaha(config-if)#exit
    Yamaha(config)#interface vlan200
    Yamaha(config-if)#ip address 192.168.200.241/24 (2)
    Yamaha(config-if)#exit
    1 Assign 192.168.100.241 to VLAN #100
    2 Assign 192.168.200.241 to VLAN #200
  11. [Switch #B] Assign LAN port #1 to VLAN #100.

    Yamaha(config)#interface port1.1
    Yamaha(config-if)#switchport access vlan 100 (1)
    Yamaha(config-if)#exit
    1 Assign to VLAN #100
  12. [Switch #B] Assign LAN port #2 to VLAN #200.

    Yamaha(config)#interface port1.2
    Yamaha(config-if)#switchport access vlan 200 (1)
    Yamaha(config-if)#exit
    1 Assign to VLAN #200
  13. [Switch #B] Create virtual router #1 on VLAN #100 and add the settings.

    Yamaha(config)#router vrrp 1 vlan100 (1)
    Yamaha(config-router)#virtual-ip 192.168.100.228 (2)
    Yamaha(config-router)#priority 50 (3)
    Yamaha(config-router)#virtual-router enable (4)
    Yamaha(config-if)#exit
    1 Create virtual router #1 on VLAN #100
    2 Assign virtual IP address 192.168.100.228 to virtual router #1
    3 Set the priority of virtual router #1 to 50
    4 Enable virtual router #1
  14. [Switch #B] Create virtual router #2 on VLAN #200 and add the settings.

    Yamaha(config)#router vrrp 2 vlan200 (1)
    Yamaha(config-router)#virtual-ip 192.168.200.228 (2)
    Yamaha(config-router)#priority 50 (3)
    Yamaha(config-router)#virtual-router enable (4)
    Yamaha(config-if)#exit
    1 Create virtual router #2 on VLAN #200
    2 Assign virtual IP address 192.168.200.228 to virtual router #2
    3 Set the priority of virtual router #2 to 50
    4 Enable virtual router #2
  15. Connect the LAN cable.

  16. [Switch #A] Check the VRRP settings.

    Yamaha#show vrrp
    VRRP Version: 3
    VMAC enabled
    Backward Compatibility disabled
    
    Address family IPv4
    VRRP Id: 1 on interface: vlan100
     State: AdminUp   - Master
     Virtual IP address: 192.168.100.228 (Not-owner)
     Operational primary IP address: 192.168.100.240
     Operational master IP address: 192.168.100.240
     Priority not configured; Current priority: 100
     Advertisement interval: 100 centi sec
     Master Advertisement interval: 100 centi sec
     Skew time: 72 centi sec
     Accept mode: FALSE
     Preempt mode: TRUE
     Multicast membership on IPv4 interface vlan100: JOINED
     V2-Compatible: FALSE
    
    Address family IPv4
    VRRP Id: 2 on interface: vlan200
     State: AdminUp   - Master
     Virtual IP address: 192.168.200.228 (Not-owner)
     Operational primary IP address: 192.168.200.240
     Operational master IP address: 192.168.200.240
     Priority not configured; Current priority: 100
     Advertisement interval: 100 centi sec
     Master Advertisement interval: 100 centi sec
     Skew time: 60 centi sec
     Accept mode: FALSE
     Preempt mode: TRUE
     Multicast membership on IPv4 interface vlan200: JOINED
     V2-Compatible: FALSE
  17. [Switch #B] Check the VRRP settings.

    Yamaha#show vrrp
    VRRP Version: 3
    VMAC enabled
    Backward Compatibility disabled
    
    Address family IPv4
    VRRP Id: 1 on interface: vlan100
     State: AdminUp   - Backup
     Virtual IP address: 192.168.100.228 (Not-owner)
     Operational primary IP address: 192.168.100.241
     Operational master IP address: 192.168.100.240
     Priority is 50
     Advertisement interval: 100 centi sec
     Master Advertisement interval: 100 centi sec
     Skew time: 72 centi sec
     Accept mode: FALSE
     Preempt mode: TRUE
     Multicast membership on IPv4 interface vlan100: JOINED
     V2-Compatible: FALSE
    
    Address family IPv4
    VRRP Id: 2 on interface: vlan200
     State: AdminUp   - Backup
     Virtual IP address: 192.168.200.228 (Not-owner)
     Operational primary IP address: 192.168.200.241
     Operational master IP address: 192.168.200.240
     Priority is 50
     Advertisement interval: 100 centi sec
     Master Advertisement interval: 100 centi sec
     Skew time: 60 centi sec
     Accept mode: FALSE
     Preempt mode: TRUE
     Multicast membership on IPv4 interface vlan200: JOINED
     V2-Compatible: FALSE

5.2. VRRP Configuration (IPv6)

Spanning tree is disabled. When used in conjunction with spanning tree, MST instances and other settings must be configured correctly.

  1. [Switch #A] Disable spanning tree.

    Yamaha(config)#spanning-tree shutdown
  2. [Switch #A] Define VLAN #100 and VLAN #200.

    Yamaha(config)#vlan database
    Yamaha(config-vlan)#vlan 100 (1)
    Yamaha(config-vlan)#vlan 200 (2)
    Yamaha(config-vlan)#exit
    1 Define VLAN #100
    2 Define VLAN #200
  3. [Switch #A] Enable IPv6 on VLAN #100.

    Yamaha(config)#interface vlan100
    Yamaha(config-if)#ipv6 enable (1)
    Yamaha(config-if)#exit
    1 Enable IPv6
  4. [Switch #A] Enable IPv6 on VLAN #200.

    Yamaha(config)#interface vlan200
    Yamaha(config-if)#ipv6 enable (1)
    Yamaha(config-if)#exit
    1 Enable IPv6
  5. [Switch #A] Assign LAN port #1 to VLAN #100.

    Yamaha(config)#interface port1.1
    Yamaha(config-if)#switchport access vlan 100 (1)
    Yamaha(config-if)#exit
    1 Assign to VLAN #100
  6. [Switch #A] Assign LAN port #2 to VLAN #200.

    Yamaha(config)#interface port1.2
    Yamaha(config-if)#switchport access vlan 200 (1)
    Yamaha(config-if)#exit
    1 Assign to VLAN #200
  7. [Switch #A] Create virtual router #1 on VLAN #100 and add the settings.

    Yamaha(config)#router ipv6 vrrp 1 vlan100 (1)
    Yamaha(config-router)#virtual-ipv6 fe80::100:1 (2)
    Yamaha(config-router)#virtual-router enable (3)
    Yamaha(config-if)#exit
    1 Create virtual router #1 on VLAN #100
    2 Assign virtual IP address fe80::100:1 to Virtual Router #1
    3 Enable virtual router #1
  8. [Switch #A] Create virtual router #2 on VLAN #200 and add the settings.

    Yamaha(config)#router ipv6 vrrp 2 vlan200 (1)
    Yamaha(config-router)#virtual-ipv6 fe80::200:1 (2)
    Yamaha(config-router)#virtual-router enable (3)
    Yamaha(config-if)#exit
    1 Create virtual router #2 on VLAN #200
    2 Assign virtual IP address fe80::200:1 to virtual router #2
    3 Enable virtual router #2
  9. [Switch #B] Disable spanning tree.

    Yamaha(config)#spanning-tree shutdown
  10. [Switch #B] Define VLAN #100 and VLAN #200.

    Yamaha(config)#vlan database
    Yamaha(config-vlan)#vlan 100 (1)
    Yamaha(config-vlan)#vlan 200 (2)
    Yamaha(config-vlan)#exit
    1 Define VLAN #100
    2 Define VLAN #200
  11. [Switch #B] Enable IPv6 on VLAN #100.

    Yamaha(config)#interface vlan100
    Yamaha(config-if)#ipv6 enable (1)
    Yamaha(config-if)#exit
    1 Enable IPv6
  12. [Switch #B] Enable IPv6 on VLAN #200.

    Yamaha(config)#interface vlan200
    Yamaha(config-if)#ipv6 enable (1)
    Yamaha(config-if)#exit
    1 Enable IPv6
  13. [Switch #B] Assign LAN port #1 to VLAN #100.

    Yamaha(config)#interface port1.1
    Yamaha(config-if)#switchport access vlan 100 (1)
    Yamaha(config-if)#exit
    1 Assign to VLAN #100
  14. [Switch #B] Assign LAN port #2 to VLAN #200.

    Yamaha(config)#interface port1.2
    Yamaha(config-if)#switchport access vlan 200 (1)
    Yamaha(config-if)#exit
    1 Assign to VLAN #200
  15. [Switch #B] Create virtual router #1 on VLAN #100 and add the settings.

    Yamaha(config)#router ipv6 vrrp 1 vlan100 (1)
    Yamaha(config-router)#virtual-ipv6 fe80::100:1 (2)
    Yamaha(config-router)#priority 50 (3)
    Yamaha(config-router)#virtual-router enable (4)
    Yamaha(config-if)#exit
    1 Create virtual router #1 on VLAN #100
    2 Assign virtual IP address fe80::100:1 to Virtual Router #1
    3 Set the priority of virtual router #1 to 50
    4 Enable virtual router #1
  16. [Switch #B] Create virtual router #2 on VLAN #200 and add the settings.

    Yamaha(config)#router ipv6 vrrp 2 vlan200 (1)
    Yamaha(config-router)#virtual-ipv6 fe80::200:1 (2)
    Yamaha(config-router)#priority 50 (3)
    Yamaha(config-router)#virtual-router enable (4)
    Yamaha(config-if)#exit
    1 Create virtual router #2 on VLAN #200
    2 Assign virtual IP address fe80::200:1 to virtual router #2
    3 Set the priority of virtual router #2 to 50
    4 Enable virtual router #2
  17. Connect the LAN cable.

  18. [Switch #A] Check the VRRP settings.

    Yamaha#show vrrp
    VRRP Version: 3
    VMAC enabled
    Address family IPv6
    VRRP Id: 1 on interface: vlan100
     State: AdminUp   - Master
     Virtual IP address: fe80::100:1 (Not-owner)
     Operational primary IP address: fe80::ae44:f2ff:fe11:1111
     Operational master IP address: fe80::ae44:f2ff:fe11:1111
     Priority is 100
     Advertisement interval: 100 centi sec
     Master Advertisement interval: 100 centi sec
     Skew time: 60 centi sec
     Accept mode: FALSE
     Preempt mode: TRUE
     Multicast membership on IPv6 interface  vlan100: JOINED
     V2-Compatible: FALSE
    
    Address family IPv6
    VRRP Id: 2 on interface: vlan200
     State: AdminUp   - Master
     Virtual IP address: fe80::200:1 (Not-owner)
     Operational primary IP address: fe80::ae44:f2ff:fe11:1111
     Operational master IP address: fe80::ae44:f2ff:fe11:1111
     Priority is 100
     Advertisement interval: 100 centi sec
     Master Advertisement interval: 100 centi sec
     Skew time: 60 centi sec
     Accept mode: FALSE
     Preempt mode: TRUE
     Multicast membership on IPv6 interface  vlan200: JOINED
     V2-Compatible: FALSE
  19. [Switch #B] Check the VRRP settings.

    Yamaha#show vrrp
    VRRP Version: 3
    VMAC enabled
    Address family IPv6
    VRRP Id: 1 on interface: vlan100
     State: AdminUp   - Backup
     Virtual IP address: fe80::100:1 (Not-owner)
     Operational primary IP address: fe80::ae44:f2ff:fe22:2222
     Operational master IP address: fe80::ae44:f2ff:fe11:1111
     Priority is 50
     Advertisement interval: 100 centi sec
     Master Advertisement interval: 100 centi sec
     Skew time: 60 centi sec
     Accept mode: FALSE
     Preempt mode: TRUE
     Multicast membership on IPv6 interface  vlan100: JOINED
     V2-Compatible: FALSE
    
    Address family IPv6
    VRRP Id: 2 on interface: vlan200
     State: AdminUp   - Backup
     Virtual IP address: fe80::200:1 (Not-owner)
     Operational primary IP address: fe80::ae44:f2ff:fe22:2222
     Operational master IP address: fe80::ae44:f2ff:fe11:1111
     Priority is 50
     Advertisement interval: 100 centi sec
     Master Advertisement interval: 100 centi sec
     Skew time: 60 centi sec
     Accept mode: FALSE
     Preempt mode: TRUE
     Multicast membership on IPv6 interface  vlan200: JOINED
     V2-Compatible: FALSE

6. Points of Caution

  1. This function cannot be used in conjunction with the stack function.

  2. When using both IPv4 and IPv6 with VRRP, make sure that the virtual router IDs do not overlap.

  3. Do not set the secondary IP address as a virtual IP address.