Multiple VRRP groups configuration example

To implement load sharing between the VRRP groups, manually configure the default gateway 10.1.1.111 for some hosts and 10.1.1.112 for the other on the subnet 10.1.1.0/24.

Network requirements

As shown in Figure 24, Router A and Router B form two VRRP groups to implement load sharing and mutual backup. VRRP group 1 uses the virtual IP address 10.1.1.111/24 to provide gateway service for some hosts on the subnet 10.1.1.0/24. VRRP group 2 uses the virtual IP address 10.1.1.112/24 to provide gateway service for the other hosts on the subnet.

Figure 24: Network diagram

Configuration procedure

  1. Configure Router A:

    # Specify an IP address for Router A.

    <RouterA> system-view
    [RouterA] interface gigabitethernet 1/0/1
    [RouterA-GigabitEthernet1/0/1] ip address 10.1.1.1 255.255.255.0
    

    # Create VRRP group 1 and set its virtual IP address to 10.1.1.111.

    [RouterA-GigabitEthernet1/0/1] vrrp vrid 1 virtual-ip 10.1.1.111
    

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

    [RouterA-GigabitEthernet1/0/1] vrrp vrid 1 priority 110
    

    # Create VRRP group 2, and set its virtual IP address to 10.1.1.112.

    [RouterA-GigabitEthernet1/0/1] vrrp vrid 2 virtual-ip 10.1.1.112
    
  2. Configure Router B:

    # Specify an IP address for Router B.

    <RouterB> system-view
    [RouterB] interface gigabitethernet 1/0/1
    [RouterB-GigabitEthernet1/0/1] ip address 10.1.1.2 255.255.255.0
    

    # Create VRRP group 1, and set its virtual IP address to 10.1.1.111.

    [RouterB-GigabitEthernet1/0/1] vrrp vrid 1 virtual-ip 10.1.1.111
    

    # Create VRRP group 2, and set its virtual IP address to 10.1.1.112.

    [RouterB-GigabitEthernet1/0/1] vrrp vrid 2 virtual-ip 10.1.1.112
    

    # Assign Router B a higher priority than Router A in VRRP group 2, so Router B can become the master in the group.

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

Verifying the configuration

# Display detailed information about the VRRP groups on Router A.

[RouterA-GigabitEthernet1/0/1] display vrrp verbose
IPv4 Virtual Router Information:
 Running Mode      : Standard
 Total number of virtual routers : 2
   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   : 0
     Auth Type      : None
     Virtual IP     : 10.1.1.111
     Virtual MAC    : 0000-5e00-0101
     Master IP      : 10.1.1.1

   Interface GigabitEthernet1/0/1
     VRID           : 2                    Adver Timer  : 100
     Admin Status   : Up                   State        : Backup
     Config Pri     : 100                  Running Pri  : 100
     Preempt Mode   : Yes                  Delay Time   : 0
     Become Master  : 201ms left
     Auth Type      : None
     Virtual IP     : 10.1.1.112
     Master IP      : 10.1.1.2

# Display detailed information about the VRRP groups on Router B.

[RouterB-GigabitEthernet1/0/1] display vrrp verbose
IPv4 Virtual Router Information:
 Running Mode      : Standard
 Total number of virtual routers : 2
   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   : 0
     Become Master  : 185ms left
     Auth Type      : None
     Virtual IP     : 10.1.1.111
     Master IP      : 10.1.1.1

   Interface GigabitEthernet1/0/1
     VRID           : 2                    Adver Timer  : 100
     Admin Status   : Up                   State        : Master
     Config Pri     : 110                  Running Pri  : 110
     Preempt Mode   : Yes                  Delay Time   : 0
     Auth Type      : None
     Virtual IP     : 10.1.1.112
     Virtual MAC    : 0000-5e00-0102
     Master IP      : 10.1.1.2

The output shows the following information: