Example: Configuring VRRP load balancing

Network configuration

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

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

Configure VFs on Switch A, Switch B, or Switch C to monitor their respective VLAN-interface 3. When the interface on any of them fails, the weights of the VFs on the problematic switch decrease so another AVF can take over.

Figure 56: Network diagram

Procedure


[IMPORTANT: ]

IMPORTANT:

By default, interfaces on the device are disabled (in ADM or Administratively Down state). To have an interface operate, you must use the undo shutdown command to enable that interface.


  1. Configure Switch A:

    # Configure VLAN 2.

    <SwitchA> system-view
    [SwitchA] vlan 2
    [SwitchA-vlan2] port fortygige 1/0/5
    [SwitchA-vlan2] quit
    

    # Configure VRRP to operate in load balancing mode.

    [SwitchA] vrrp ipv6 mode load-balance
    

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

    [SwitchA] interface vlan-interface 2
    [SwitchA-Vlan-interface2] ipv6 address fe80::1 link-local
    [SwitchA-Vlan-interface2] ipv6 address 1::1 64
    [SwitchA-Vlan-interface2] vrrp ipv6 vrid 1 virtual-ip fe80::10 link-local
    [SwitchA-Vlan-interface2] vrrp ipv6 vrid 1 virtual-ip 1::10
    

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

    [SwitchA-Vlan-interface2] vrrp ipv6 vrid 1 priority 120
    

    # Configure Switch 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.

    [SwitchA-Vlan-interface2] vrrp ipv6 vrid 1 preempt-mode delay 5000
    

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

    [SwitchA-Vlan-interface2] undo ipv6 nd ra halt
    [SwitchA-Vlan-interface2] quit
    

    # Create track entry 1 to monitor the upstream link status of VLAN-interface 3. When the upstream link fails, the track entry transits to Negative.

    [SwitchA] track 1 interface vlan-interface 3
    

    # 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.

    [SwitchA] interface vlan-interface 2
    [SwitchA-Vlan-interface2] vrrp ipv6 vrid 1 track 1 weight reduced 250
    
  2. Configure Switch B:

    # Configure VLAN 2.

    <SwitchB> system-view
    [SwitchB] vlan 2
    [SwitchB-vlan2] port fortygige 1/0/5
    [SwitchB-vlan2] quit
    

    # Configure VRRP to operate in load balancing mode.

    [SwitchB] vrrp ipv6 mode load-balance
    

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

    [SwitchB] interface vlan-interface 2
    [SwitchB-Vlan-interface2] ipv6 address fe80::2 link-local
    [SwitchB-Vlan-interface2] ipv6 address 1::2 64
    [SwitchB-Vlan-interface2] vrrp ipv6 vrid 1 virtual-ip fe80::10 link-local
    [SwitchB-Vlan-interface2] vrrp ipv6 vrid 1 virtual-ip 1::10
    

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

    [SwitchB-Vlan-interface2] vrrp ipv6 vrid 1 priority 110
    

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

    [SwitchB-Vlan-interface2] vrrp ipv6 vrid 1 preempt-mode delay 5000
    

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

    [SwitchB-Vlan-interface2] undo ipv6 nd ra halt
    [SwitchB-Vlan-interface2] quit
    

    # Create track entry 1 to monitor the upstream link status of VLAN-interface 3. When the upstream link fails, the track entry transits to Negative.

    [SwitchB] track 1 interface vlan-interface 3
    

    # 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.

    [SwitchB] interface vlan-interface 2
    [SwitchB-Vlan-interface2] vrrp ipv6 vrid 1 track 1 weight reduced 250
    
  3. Configure Switch C:

    # Configure VLAN 2.

    <SwitchC> system-view
    [SwitchC] vlan 2
    [SwitchC-vlan2] port fortygige 1/0/5
    [SwitchC-vlan2] quit
    

    # Configure VRRP to operate in load balancing mode.

    [SwitchC] vrrp ipv6 mode load-balance
    

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

    [SwitchC] interface vlan-interface 2
    [SwitchC-Vlan-interface2] ipv6 address fe80::3 link-local
    [SwitchC-Vlan-interface2] ipv6 address 1::3 64
    [SwitchC-Vlan-interface2] vrrp ipv6 vrid 1 virtual-ip fe80::10 link-local
    [SwitchC-Vlan-interface2] vrrp ipv6 vrid 1 virtual-ip 1::10
    

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

    [SwitchC-Vlan-interface2] vrrp ipv6 vrid 1 preempt-mode delay 5000
    

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

    [SwitchC-Vlan-interface2] undo ipv6 nd ra halt
    [SwitchC-Vlan-interface2] quit
    

    # Create track entry 1 to monitor the upstream link status of VLAN-interface 3. When the upstream link fails, the track entry transits to Negative.

    [SwitchC] track 1 interface vlan-interface 3
    

    # 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.

    [SwitchC] interface vlan-interface 2
    [SwitchC-Vlan-interface2] 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 Switch A.

[SwitchA-Vlan-interface2] display vrrp ipv6 verbose
IPv6 Virtual Router Information:
 Running Mode      : Load Balance
 Total number of virtual routers : 1
   Interface Vlan-interface2
     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 Switch B.

[SwitchB-Vlan-interface2] display vrrp ipv6 verbose
IPv6 Virtual Router Information:
 Running Mode      : Load Balance
 Total number of virtual routers : 1
   Interface Vlan-interface2
     VRID             : 1                    Adver Timer  : 100
     Admin Status     : Up                   State        : Backup
     Config Pri       : 110                  Running Pri  : 110
     Preempt Mode     : Yes                  Delay Time   : 5000
     Become Master    : 401ms 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 Switch C.

[SwitchC-Vlan-interface2] display vrrp ipv6 verbose
IPv6 Virtual Router Information:
 Running Mode      : Load Balance
 Total number of virtual routers : 1
   Interface Vlan-interface2
     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 Switch A is the master in VRRP group 1, and each of the three switches has one AVF and two LVFs.

# Disconnect the link of VLAN-interface 3 on Switch A and display detailed information about VRRP group 1 on Switch A.

[SwitchA-Vlan-interface2] display vrrp ipv6 verbose
IPv6 Virtual Router Information:
 Running Mode      : Load Balance
 Total number of virtual routers : 1
   Interface Vlan-interface2
     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 Switch C.

[SwitchC-Vlan-interface2] display vrrp ipv6 verbose
IPv6 Virtual Router Information:
 Running Mode      : Load Balance
 Total number of virtual routers : 1
   Interface Vlan-interface2
     VRID             : 1                    Adver Timer  : 100
     Admin Status     : Up                   State        : Backup
     Config Pri       : 100                  Running Pri  : 100
     Preempt Mode     : Yes                  Delay Time   : 5000
     Become Master    : 410ms 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 VLAN-interface 3 on Switch A fails, the weights of the VFs on Switch A drop below the lower limit of failure. All VFs on Switch A transit to the Initialize state and cannot forward traffic. The VF for MAC address 000f-e2ff-4011 on Switch C becomes the AVF to forward traffic.

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

[SwitchC-Vlan-interface2] display vrrp ipv6 verbose
IPv6 Virtual Router Information:
 Running Mode      : Load Balance
 Total number of virtual routers : 1
   Interface Vlan-interface2
     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 Switch A fails, display detailed information about VRRP group 1 on Switch B.

[SwitchB-Vlan-interface2] display vrrp ipv6 verbose
IPv6 Virtual Router Information:
 Running Mode      : Load Balance
 Total number of virtual routers : 1
   Interface Vlan-interface2
     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: