Example for Configuring VRRP Groups to Work in Multi-gateway Load Balancing Mode
In this example, two Virtual Router Redundancy Protocol (VRRP) backup groups are configured to work in multi-gateway load balancing mode. Devices in the VRRP groups back up each other and load-balance traffic.
Networking Requirements
VRRP groups working in master/backup mode can be configured on routers to implement gateway redundancy. To reduce the traffic burden on the master router, configure VRRP groups to work in multi-gateway load balancing mode to load-balance uplink traffic.
Figure 4-12 shows two VRRP backup groups working in load balancing mode. Device D is dual-homed to Device A and Device B. Some users want to use Device A to forward data traffic and Device B to provide backup. Other users want to use Device B to forward data traffic and Device A to provide backup. Device A and Device B functioning as master devices in different backup groups can back up each other and load-balance data traffic.
Interfaces 1 through 3 in this example represent GE 0/1/1, GE 0/1/2, and GE 0/2/0, respectively.
Precautions
The IP address of GE 0/2/0 on Device A and IP address of GE 0/2/0 on Device B must be configured on the same network segment.
Configuration Roadmap
The configuration roadmap is as follows:
Assign an IP address to each interface on each router and configure a routing protocol to ensure IP reachability.
Create two VRRP groups on gateway routers. Device A is configured as the master device in VRRP backup group 1. Device B is configured as the master device in VRRP backup group 2. They can load-balance traffic.
Data Preparation
To complete the configuration, you need the following data:
IP address of each interface on each Device and Layer 2 transparent transmission on Device D
- VRID (1) and virtual IP address (10.1.1.111) for a VRRP backup group configured on Device A and Device B
- VRRP priorities (120 for Device A and 100 for Device B) in VRRP backup group 1
- VRID (2) and virtual IP address (10.1.1.112) for the other VRRP backup group configured on Device A and Device B
- VRRP priorities (120 for Device B and 100 for Device A) in VRRP backup group 2
Procedure
- Assign an IP address to each interface on Device A, Device B, and Device C. Configure OSPF to ensure that these routers can communicate with each other. For details about Device D configurations, see Configuration Files in this section.
# Configure Device A.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceA
[*HUAWEI] commit
[~DeviceA] interface gigabitethernet 0/2/0
[~DeviceA-GigabitEthernet0/2/0] undo shutdown
[*DeviceA-GigabitEthernet0/2/0] ip address 10.1.1.1 24
[*DeviceA-GigabitEthernet0/2/0] commit
[~DeviceA-GigabitEthernet0/2/0] quit
[~DeviceA] interface gigabitethernet 0/1/1
[~DeviceA-GigabitEthernet0/1/1] undo shutdown
[*DeviceA-GigabitEthernet0/1/1] ip address 192.168.1.1 24
[*DeviceA-GigabitEthernet0/1/1] commit
[~DeviceA-GigabitEthernet0/1/1] quit
[~DeviceA] ospf 1
[*DeviceA-ospf-1] area 0
[*DeviceA-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255
[*DeviceA-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255
[*DeviceA-ospf-1-area-0.0.0.0] commit
[~DeviceA-ospf-1-area-0.0.0.0] quit
[~DeviceA-ospf-1] quit
# Configure Device B.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceB
[*HUAWEI] commit
[~DeviceB] interface gigabitethernet 0/2/0
[~DeviceB-GigabitEthernet0/2/0] undo shutdown
[*DeviceB-GigabitEthernet0/2/0] ip address 10.1.1.2 24
[*DeviceB-GigabitEthernet0/2/0] commit
[~DeviceB-GigabitEthernet0/2/0] quit
[~DeviceB] interface gigabitethernet 0/1/2
[~DeviceB-GigabitEthernet0/1/2] undo shutdown
[*DeviceB-GigabitEthernet0/1/2] ip address 192.168.2.1 24
[*DeviceB-GigabitEthernet0/1/2] commit
[~DeviceB-GigabitEthernet0/1/2] quit
[~DeviceB] ospf 1
[*DeviceB-ospf-1] area 0
[*DeviceB-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255
[*DeviceB-ospf-1-area-0.0.0.0] network 192.168.2.0 0.0.0.255
[*DeviceB-ospf-1-area-0.0.0.0] commit
[~DeviceB-ospf-1-area-0.0.0.0] quit
[~DeviceB-ospf-1] quit
# Configure Device C.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceC
[*HUAWEI] commit
[~DeviceC] interface gigabitethernet 0/1/1
[~DeviceC-GigabitEthernet0/1/1] undo shutdown
[*DeviceC-GigabitEthernet0/1/1] ip address 192.168.1.2 24
[*DeviceC-GigabitEthernet0/1/1] commit
[~DeviceC-GigabitEthernet0/1/1] quit
[~DeviceC] interface gigabitethernet 0/1/2
[~DeviceC-GigabitEthernet0/1/2] undo shutdown
[*DeviceC-GigabitEthernet0/1/2] ip address 192.168.2.2 24
[*DeviceC-GigabitEthernet0/1/2] commit
[~DeviceC-GigabitEthernet0/1/2] quit
[~DeviceC] interface gigabitethernet 0/2/0
[~DeviceC-GigabitEthernet0/2/0] undo shutdown
[*DeviceC-GigabitEthernet0/2/0] ip address 172.16.1.1 24
[*DeviceC-GigabitEthernet0/2/0] commit
[~DeviceC-GigabitEthernet0/2/0] quit
[~DeviceC] ospf 1
[*DeviceC-ospf-1] area 0
[*DeviceC-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255
[*DeviceC-ospf-1-area-0.0.0.0] network 192.168.2.0 0.0.0.255
[*DeviceC-ospf-1-area-0.0.0.0] network 172.16.1.0 0.0.0.255
[*DeviceC-ospf-1-area-0.0.0.0] commit
[~DeviceC-ospf-1-area-0.0.0.0] quit
[~DeviceC-ospf-1] quit
- Create VRRP groups.
# Create VRRP groups 1 and 2 on Device A's GE 0/2/0. Set Device A's priority to 120 in VRRP backup group 1, and retain the default priority (100) for Device A in VRRP backup group 2.
<DeviceA> system-view
[~DeviceA] interface gigabitethernet 0/2/0
[~DeviceA-GigabitEthernet0/2/0] vrrp vrid 1 virtual-ip 10.1.1.111
[*DeviceA-GigabitEthernet0/2/0] vrrp vrid 1 priority 120
[*DeviceA-GigabitEthernet0/2/0] vrrp vrid 2 virtual-ip 10.1.1.112
[*DeviceA-GigabitEthernet0/2/0] commit
[~DeviceA-GigabitEthernet0/2/0] quit
# Create VRRP groups 1 and 2 on Device B's GE 0/2/0. Set Device B's priority to 120 in VRRP backup group 2, and retain the default priority (100) for Device B in VRRP backup group 1.
<DeviceB> system-view
[~DeviceB] interface gigabitethernet 0/2/0
[~DeviceB-GigabitEthernet0/2/0] vrrp vrid 1 virtual-ip 10.1.1.111
[*DeviceB-GigabitEthernet0/2/0] vrrp vrid 2 virtual-ip 10.1.1.112
[*DeviceB-GigabitEthernet0/2/0] vrrp vrid 2 priority 120
[*DeviceB-GigabitEthernet0/2/0] commit
[~DeviceB-GigabitEthernet0/2/0] quit
- Verify the configuration.
Run the display vrrp command on Device A. The command output shows that Device A serves as the master device in VRRP backup group 1 and as a backup device in VRRP backup group 2.
<DeviceA> display vrrp
GigabitEthernet0/2/0 | Virtual Router 1 State : Master Virtual IP : 10.1.1.111 Master IP : 10.1.1.1 Local IP : 10.1.1.1 PriorityRun : 120 PriorityConfig : 120 MasterPriority : 120 Preempt : YES Delay Time : 0s Hold Multiplier : 4 TimerRun : 1s TimerConfig : 1s Auth Type : None Virtual MAC : 00e0-fc12-7890 Check TTL : YES Config Type : normal-vrrp Backup-forward : disabled Create Time : 2011-12-29 05:41:23 Last Change Time : 2011-12-29 05:41:33 GigabitEthernet0/2/0 | Virtual Router 2 State : Backup Virtual IP : 10.1.1.112 Master IP : 10.1.1.2 Local IP : 10.1.1.1 PriorityRun : 100 PriorityConfig : 100 MasterPriority : 120 Preempt : YES Delay Time : 0s Hold Multiplier : 4 TimerRun : 1s TimerConfig : 1s Auth Type : None Virtual MAC : 00e0-fc12-7880 Check TTL : YES Config Type : normal-vrrp Backup-forward : disabled Create Time : 2011-12-29 05:41:23 Last Change Time : 2011-12-29 05:41:33
Run the display vrrp command on Device B. The command output shows that Device B serves as a backup device in VRRP backup group 1 and as the master device in VRRP backup group 2.
<DeviceB> display vrrp
GigabitEthernet0/2/0 | Virtual Router 1 State : Backup Virtual IP : 10.1.1.111 Master IP : 10.1.1.1 Local IP : 10.1.1.2 PriorityRun : 100 PriorityConfig : 100 MasterPriority : 120 Preempt : YES Delay Time : 0s Hold Multiplier : 4 TimerRun : 1s TimerConfig : 1s Auth Type : None Virtual MAC : 00e0-fc12-7890 Check TTL : YES Config Type : normal-vrrp Backup-forward : disabled Create Time : 2011-12-29 05:41:23 Last Change Time : 2011-12-29 05:41:33 GigabitEthernet0/2/0 | Virtual Router 2 State : Master Virtual IP : 10.1.1.112 Master IP : 10.1.1.2 Local IP : 10.1.1.2 PriorityRun : 120 PriorityConfig : 120 MasterPriority : 120 Preempt : YES Delay Time : 0s Hold Multiplier : 4 TimerRun : 1s TimerConfig : 1s Auth Type : None Virtual MAC : 00e0-fc12-7880 Check TTL : YES Config Type : normal-vrrp Backup-forward : disabled Create Time : 2011-12-29 05:41:23 Last Change Time : 2011-12-29 05:41:33
Configuration Files
Device A configuration file
# sysname DeviceA # interface GigabitEthernet0/1/1 undo shutdown ip address 192.168.1.1 255.255.255.0 # interface GigabitEthernet0/2/0 undo shutdown ip address 10.1.1.1 255.255.255.0 vrrp vrid 1 virtual-ip 10.1.1.111 vrrp vrid 1 priority 120 vrrp vrid 2 virtual-ip 10.1.1.112 # ospf 1 area 0.0.0.0 network 192.168.1.0 0.0.0.255 network 10.1.1.0 0.0.0.255 # return
Device B configuration file
# sysname DeviceB # interface GigabitEthernet0/1/2 undo shutdown ip address 192.168.2.1 255.255.255.0 # interface GigabitEthernet0/2/0 undo shutdown ip address 10.1.1.2 255.255.255.0 vrrp vrid 1 virtual-ip 10.1.1.111 vrrp vrid 2 virtual-ip 10.1.1.112 vrrp vrid 2 priority 120 # ospf 1 area 0.0.0.0 network 192.168.2.0 0.0.0.255 network 10.1.1.0 0.0.0.255 # return
Device C configuration file
# sysname DeviceC # interface GigabitEthernet0/1/1 undo shutdown ip address 192.168.1.2 255.255.255.0 # interface GigabitEthernet0/1/2 undo shutdown ip address 192.168.2.2 255.255.255.0 # interface GigabitEthernet0/2/0 undo shutdown ip address 172.16.1.1 255.255.255.0 # ospf 1 area 0.0.0.0 network 192.168.1.0 0.0.0.255 network 192.168.2.0 0.0.0.255 network 172.16.1.0 0.0.0.255 # return
Device D configuration file
# sysname DeviceD # vlan batch 10 # interface Vlanif10 ip address 10.1.1.110 255.255.255.0 # interface GigabitEthernet0/1/1 undo shutdown port default vlan 10 # interface GigabitEthernet0/1/2 undo shutdown port default vlan 10 # return