VRRP load balancing configuration example

Network requirements

As shown in Figure 28, Router A, Router B, and Router C form a load balanced VRRP group and use the virtual IPv6 addresses FE80::10 and 1::10 to provide gateway service for the subnet 1::/64.

Hosts on subnet 1::/64 learn 1::10 as their default gateway from RA messages sent by the routers.

Configure VFs on Router A, Router B, or Router C to monitor their respective GigabitEthernet 1/0/2. When the interface on any of them fails, the weights of the VFs on the problematic router decrease so another AVF can take over.

Figure 28: Network diagram

Configuration procedure

  1. Configure Router A:

    # Configure VRRP to operate in load balancing mode.

    <RouterA> system-view
    [RouterA] vrrp ipv6 mode load-balance
    

    # Create VRRP group 1, and set its virtual IPv6 addresses to FE80::10 and 1::10.

    [RouterA] interface gigabitethernet 1/0/1
    [RouterA-GigabitEthernet1/0/1] ipv6 address fe80::1 link-local
    [RouterA-GigabitEthernet1/0/1] ipv6 address 1::1 64
    [RouterA-GigabitEthernet1/0/1] vrrp ipv6 vrid 1 virtual-ip fe80::10 link-local
    [RouterA-GigabitEthernet1/0/1] vrrp ipv6 vrid 1 virtual-ip 1::10
    

    # Assign Router A the highest priority in VRRP group 1, so Router A can become the master.

    [RouterA-GigabitEthernet1/0/1] vrrp ipv6 vrid 1 priority 120
    

    # Configure Router A to operate in preemptive mode, so it can become the master whenever it operates correctly. Set the preemption delay to 5000 centiseconds to avoid frequent status switchover.

    [RouterA-GigabitEthernet1/0/1] vrrp ipv6 vrid 1 preempt-mode delay 5000
    

    # Enable Router A to send RA messages, so hosts on subnet 1::/64 can learn the default gateway address.

    [RouterA-GigabitEthernet1/0/1] undo ipv6 nd ra halt
    [RouterA-GigabitEthernet1/0/1] quit
    

    # Create track entry 1 to monitor the upstream link status of GigabitEthernet 1/0/2. When the upstream link fails, the track entry transits to Negative.

    [RouterA] track 1 interface gigabitethernet 1/0/2
    

    # Configure the VFs in VRRP group 1 to monitor track entry 1, and decrease their weights by 250 when the track entry transits to Negative.

    [RouterA] interface gigabitethernet 1/0/1
    [RouterA-GigabitEthernet1/0/1] vrrp ipv6 vrid 1 track 1 weight reduced 250
    
  2. Configure Router B:

    # Configure VRRP to operate in load balancing mode.

    <RouterB> system-view
    [RouterB] vrrp ipv6 mode load-balance
    

    # Create VRRP group 1, and set its virtual IPv6 addresses to FE80::10 and 1::10.

    [RouterB] interface gigabitethernet 1/0/1
    [RouterB-GigabitEthernet1/0/1] ipv6 address fe80::2 link-local
    [RouterB-GigabitEthernet1/0/1] ipv6 address 1::2 64
    [RouterB-GigabitEthernet1/0/1] vrrp ipv6 vrid 1 virtual-ip fe80::10 link-local
    [RouterB-GigabitEthernet1/0/1] vrrp ipv6 vrid 1 virtual-ip 1::10
    

    # Assign Router B a higher priority than Router C in VRRP group 1, so Router B can become the master when Router A fails.

    [RouterB-GigabitEthernet1/0/1] vrrp ipv6 vrid 1 priority 110
    

    # Configure Router B to operate in preemptive mode and set the preemption delay to 5000 centiseconds.

    [RouterB-GigabitEthernet1/0/1] vrrp ipv6 vrid 1 preempt-mode delay 5000
    

    # Enable Router B to send RA messages, so hosts on subnet 1::/64 can learn the default gateway address.

    [RouterB-GigabitEthernet1/0/1] undo ipv6 nd ra halt
    [RouterB-GigabitEthernet1/0/1] quit
    

    # Create track entry 1 to monitor the upstream link status of GigabitEthernet 1/0/2. When the upstream link fails, the track entry transits to Negative.

    [RouterB] track 1 interface gigabitethernet 1/0/2
    

    # Configure the VFs in VRRP group 1 to monitor track entry 1, and decrease their weights by 250 when the track entry transits to Negative.

    [RouterB] interface gigabitethernet 1/0/1
    [RouterB-GigabitEthernet1/0/1] vrrp ipv6 vrid 1 track 1 weight reduced 250
    
  3. Configure Router C:

    # Configure VRRP to operate in load balancing mode.

    <RouterC> system-view
    [RouterC] vrrp ipv6 mode load-balance
    

    # Create VRRP group 1 and set its virtual IPv6 addresses to FE80::10 and 1::10.

    [RouterC] interface gigabitethernet 1/0/1
    [RouterC-GigabitEthernet1/0/1] ipv6 address fe80::3 link-local
    [RouterC-GigabitEthernet1/0/1] ipv6 address 1::3 64
    [RouterC-GigabitEthernet1/0/1] vrrp ipv6 vrid 1 virtual-ip fe80::10 link-local
    [RouterC-GigabitEthernet1/0/1] vrrp ipv6 vrid 1 virtual-ip 1::10
    

    # Configure Router C to operate in preemptive mode and set the preemption delay to 5000 centiseconds.

    [RouterC-GigabitEthernet1/0/1] vrrp ipv6 vrid 1 preempt-mode delay 5000
    

    # Enable Router C to send RA messages, so hosts on subnet 1::/64 can learn the default gateway address.

    [RouterC-GigabitEthernet1/0/1] undo ipv6 nd ra halt
    [RouterC-GigabitEthernet1/0/1] quit
    

    # Create track entry 1 to monitor the upstream link status of GigabitEthernet 1/0/2. When the upstream link fails, the track entry transits to Negative.

    [RouterC] track 1 interface gigabitethernet 1/0/2
    

    # Configure the VFs in VRRP group 1 to monitor track entry 1, and decrease their weights by 250 when the track entry transits to Negative.

    [RouterC] interface gigabitethernet 1/0/1
    [RouterC-GigabitEthernet1/0/1] vrrp ipv6 vrid 1 track 1 weight reduced 250
    

Verifying the configuration

# Verify that Host A can ping the external network. (Details not shown.)

# Display detailed information about VRRP group 1 on Router A.

[RouterA-GigabitEthernet1/0/1] display vrrp ipv6 verbose
IPv6 Virtual Router Information:
 Running Mode      : Load Balance
 Total number of virtual routers : 1
   Interface GigabitEthernet1/0/1
     VRID           : 1                    Adver Timer  : 100
     Admin Status   : Up                   State        : Master
     Config Pri     : 120                  Running Pri  : 120
     Preempt Mode   : Yes                  Delay Time   : 5000
     Auth Type      : None
     Virtual IP     : FE80::10
                      1::10
     Member IP List : FE80::1 (Local, Master)
                      FE80::2 (Backup)
                      FE80::3 (Backup)
   Forwarder Information: 3 Forwarders 1 Active
     Config Weight  : 255
     Running Weight : 255
    Forwarder 01
     State          : Active
     Virtual MAC    : 000f-e2ff-4011 (Owner)
     Owner ID       : 0000-5e01-1101
     Priority       : 255
     Active         : local
    Forwarder 02
     State          : Listening
     Virtual MAC    : 000f-e2ff-4012 (Learnt)
     Owner ID       : 0000-5e01-1103
     Priority       : 127
     Active         : FE80::2
    Forwarder 03
     State          : Listening
     Virtual MAC    : 000f-e2ff-4013 (Learnt)
     Owner ID       : 0000-5e01-1105
     Priority       : 127
     Active         : FE80::3
   Forwarder Weight Track Information:
     Track Object   : 1          State : Positive   Weight Reduced : 250

# Display detailed information about VRRP group 1 on Router B.

[RouterB-GigabitEthernet1/0/1] display vrrp ipv6 verbose
IPv6 Virtual Router Information:
 Running Mode      : Load Balance
 Total number of virtual routers : 1
   Interface GigabitEthernet1/0/1
     VRID           : 1                    Adver Timer  : 100
     Admin Status   : Up                   State        : Backup
     Config Pri     : 110                  Running Pri  : 110
     Preempt Mode   : Yes                  Delay Time   : 5000
     Become Master  : 400ms left
     Auth Type      : None
     Virtual IP     : FE80::10
                      1::10
     Member IP List : FE80::2 (Local, Backup)
                      FE80::1 (Master)
                      FE80::3 (Backup)
   Forwarder Information: 3 Forwarders 1 Active
     Config Weight  : 255
     Running Weight : 255
    Forwarder 01
     State          : Listening
     Virtual MAC    : 000f-e2ff-4011 (Learnt)
     Owner ID       : 0000-5e01-1101
     Priority       : 127
     Active         : FE80::1
    Forwarder 02
     State          : Active
     Virtual MAC    : 000f-e2ff-4012 (Owner)
     Owner ID       : 0000-5e01-1103
     Priority       : 255
     Active         : local
    Forwarder 03
     State          : Listening
     Virtual MAC    : 000f-e2ff-4013 (Learnt)
     Owner ID       : 0000-5e01-1105
     Priority       : 127
     Active         : FE80::3
   Forwarder Weight Track Information:
     Track Object   : 1          State : Positive   Weight Reduced : 250

# Display detailed information about VRRP group 1 on Router C.

[RouterC-GigabitEthernet1/0/1] display vrrp ipv6 verbose
IPv6 Virtual Router Information:
 Running Mode      : Load Balance
 Total number of virtual routers : 1
   Interface GigabitEthernet1/0/1
     VRID           : 1                    Adver Timer  : 100
     Admin Status   : Up                   State        : Backup
     Config Pri     : 100                  Running Pri  : 100
     Preempt Mode   : Yes                  Delay Time   : 5000
     Become Master  : 402ms left
     Auth Type      : None
     Virtual IP     : FE80::10
                      1::10
     Member IP List : FE80::3 (Local, Backup)
                      FE80::1 (Master)
                      FE80::2 (Backup)
   Forwarder Information: 3 Forwarders 1 Active
     Config Weight  : 255
     Running Weight : 255
    Forwarder 01
     State          : Listening
     Virtual MAC    : 000f-e2ff-4011 (Learnt)
     Owner ID       : 0000-5e01-1101
     Priority       : 127
     Active         : FE80::1
    Forwarder 02
     State          : Listening
     Virtual MAC    : 000f-e2ff-4012 (Learnt)
     Owner ID       : 0000-5e01-1103
     Priority       : 127
     Active         : FE80::2
    Forwarder 03
     State          : Active
     Virtual MAC    : 000f-e2ff-4013 (Owner)
     Owner ID       : 0000-5e01-1105
     Priority       : 255
     Active         : local
   Forwarder Weight Track Information:
     Track Object   : 1          State : Positive   Weight Reduced : 250

The output shows that Router A is the master in VRRP group 1, and each of the three routers has one AVF and two LVFs.

# Disconnect the link of GigabitEthernet 1/0/2 on Router A, and display detailed information about VRRP group 1 on Router A.

[RouterA-GigabitEthernet1/0/1] display vrrp ipv6 verbose
IPv6 Virtual Router Information:
 Running Mode      : Load Balance
 Total number of virtual routers : 1
   Interface GigabitEthernet1/0/1
     VRID           : 1                    Adver Timer  : 100
     Admin Status   : Up                   State        : Master
     Config Pri     : 120                  Running Pri  : 120
     Preempt Mode   : Yes                  Delay Time   : 5000
     Auth Type      : None
     Virtual IP     : FE80::10
                      1::10
     Member IP List : FE80::1 (Local, Master)
                      FE80::2 (Backup)
                      FE80::3 (Backup)
   Forwarder Information: 3 Forwarders 0 Active
     Config Weight  : 255
     Running Weight : 5
    Forwarder 01
     State          : Initialize
     Virtual MAC    : 000f-e2ff-4011 (Owner)
     Owner ID       : 0000-5e01-1101
     Priority       : 0
     Active         : FE80::3
    Forwarder 02
     State          : Initialize
     Virtual MAC    : 000f-e2ff-4012 (Learnt)
     Owner ID       : 0000-5e01-1103
     Priority       : 0
     Active         : FE80::2
    Forwarder 03
     State          : Initialize
     Virtual MAC    : 000f-e2ff-4013 (Learnt)
     Owner ID       : 0000-5e01-1105
     Priority       : 0
     Active         : FE80::3
   Forwarder Weight Track Information:
     Track Object   : 1          State : Negative   Weight Reduced : 250

# Display detailed information about VRRP group 1 on Router C.

[RouterC-GigabitEthernet1/0/1] display vrrp ipv6 verbose
IPv6 Virtual Router Information:
 Running Mode      : Load Balance
 Total number of virtual routers : 1
   Interface GigabitEthernet1/0/1
     VRID           : 1                    Adver Timer  : 100
     Admin Status   : Up                   State        : Backup
     Config Pri     : 100                  Running Pri  : 100
     Preempt Mode   : Yes                  Delay Time   : 5000
     Become Master  : 401ms left
     Auth Type      : None
     Virtual IP     : FE80::10
                      1::10
     Member IP List : FE80::3 (Local, Backup)
                      FE80::1 (Master)
                      FE80::2 (Backup)
   Forwarder Information: 3 Forwarders 2 Active
     Config Weight  : 255
     Running Weight : 255
    Forwarder 01
     State          : Active
     Virtual MAC    : 000f-e2ff-4011 (Take Over)
     Owner ID       : 0000-5e01-1101
     Priority       : 85
     Active         : local
    Forwarder 02
     State          : Listening
     Virtual MAC    : 000f-e2ff-4012 (Learnt)
     Owner ID       : 0000-5e01-1103
     Priority       : 85
     Active         : FE80::2
    Forwarder 03
     State          : Active
     Virtual MAC    : 000f-e2ff-4013 (Owner)
     Owner ID       : 0000-5e01-1105
     Priority       : 255
     Active         : local
   Forwarder Weight Track Information:
     Track Object   : 1          State : Positive   Weight Reduced : 250

The output shows that when GigabitEthernet 1/0/2 on Router A fails, the weights of the VFs on Router A drop below the lower limit of failure. All VFs on Router A transit to the Initialized state and cannot forward traffic. The VF for MAC address 000f-e2ff-4011 on Router C becomes the AVF to forward traffic.

# When the timeout timer (about 1800 seconds) expires, display detailed information about VRRP group 1 on Router C.

[RouterC-GigabitEthernet1/0/1] display vrrp ipv6 verbose
IPv6 Virtual Router Information:
 Running Mode      : Load Balance
 Total number of virtual routers : 1
   Interface GigabitEthernet1/0/1
     VRID           : 1                    Adver Timer  : 100
     Admin Status   : Up                   State        : Backup
     Config Pri     : 100                  Running Pri  : 100
     Preempt Mode   : Yes                  Delay Time   : 5000
     Become Master  : 400ms left
     Auth Type      : None
     Virtual IP     : FE80::10
                      1::10
     Member IP List : FE80::3 (Local, Backup)
                      FE80::1 (Master)
                      FE80::2 (Backup)
   Forwarder Information: 2 Forwarders 1 Active
     Config Weight  : 255
     Running Weight : 255
    Forwarder 02
     State          : Listening
     Virtual MAC    : 000f-e2ff-4012 (Learnt)
     Owner ID       : 0000-5e01-1103
     Priority       : 127
     Active         : FE80::2
    Forwarder 03
     State          : Active
     Virtual MAC    : 000f-e2ff-4013 (Owner)
     Owner ID       : 0000-5e01-1105
     Priority       : 255
     Active         : local
   Forwarder Weight Track Information:
     Track Object   : 1          State : Positive   Weight Reduced : 250

The output shows that when the timeout timer expires, the VF for virtual MAC address 000f-e2ff-4011 is removed. The VF no longer forwards the packets destined for the MAC address.

# When Router A fails, display detailed information about VRRP group 1 on Router B.

[RouterB-GigabitEthernet1/0/1] display vrrp ipv6 verbose
IPv6 Virtual Router Information:
 Running Mode      : Load Balance
 Total number of virtual routers : 1
   Interface GigabitEthernet1/0/1
     VRID           : 1                    Adver Timer  : 100
     Admin Status   : Up                   State        : Master
     Config Pri     : 110                  Running Pri  : 110
     Preempt Mode   : Yes                  Delay Time   : 5000
     Auth Type      : None
     Virtual IP     : FE80::10
                      1::10
     Member IP List : FE80::2 (Local, Master)
                      FE80::3 (Backup)
   Forwarder Information: 2 Forwarders 1 Active
     Config Weight  : 255
     Running Weight : 255
    Forwarder 02
     State          : Active
     Virtual MAC    : 000f-e2ff-4012 (Owner)
     Owner ID       : 0000-5e01-1103
     Priority       : 255
     Active         : local
    Forwarder 03
     State          : Listening
     Virtual MAC    : 000f-e2ff-4013 (Learnt)
     Owner ID       : 0000-5e01-1105
     Priority       : 127
     Active         : FE80::3
   Forwarder Weight Track Information:
     Track Object   : 1          State : Positive   Weight Reduced : 250

The output shows the following information: