Hello,
Please check this example, it's using AR routers. Hope it's useful for you :
Networking diagram for configuring VRRP in multi-gateway load balancing mode
Networking Requirements:
As shown in figure, HostA and HostC are dual-homed to
RouterA and
RouterB through the switch. The requirements are as follows:
- HostA uses RouterA as the default gateway to connect to the Internet, and RouterB functions as the backup gateway.
- HostC uses RouterB as the default gateway to connect to the Internet, and RouterA functions as the backup gateway.
Therefore, load balancing can be implemented.Configuration Roadmap:
Multi-gateway load balancing are used to load balance traffic. The configuration roadmap is as follows:
- Assign an IP address to each interface and configure a routing protocol to ensure network connectivity.
- Create VRRP groups 1 and 2 on RouterA and RouterB. In VRRP group 1, configure RouterA as the master and RouterB as the backup. In VRRP group 2, configure RouterB as the master and RouterA as the backup.
Procedure:
- Configure devices to ensure network connectivity.
# Assign an IP address to each interface. RouterA is used as an example. The configurations of RouterB and RouterC are similar to the configuration of RouterA, and are not mentioned here.
<Huawei> system-view
[Huawei] sysname RouterA
[RouterA] interface gigabitethernet 1/0/0
[RouterA-GigabitEthernet1/0/0] ip address 192.168.1.1 24
[RouterA-GigabitEthernet1/0/0] quit
[RouterA] interface gigabitethernet 2/0/0
[RouterA-GigabitEthernet2/0/0] ip address 10.1.1.1 24
[RouterA-GigabitEthernet2/0/0] quit
# Configure OSPF between RouterA, RouterB, and RouterC. RouterA is used as an example. The configurations of RouterB and RouterC are similar to the configuration of RouterA, and are not mentioned here.
[RouterA] ospf 1
[RouterA-ospf-1] area 0
[RouterA-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255
[RouterA-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255
[RouterA-ospf-1-area-0.0.0.0] quit
[RouterA-ospf-1] quit
- Configure VRRP groups.
# Configure VRRP group 1 on RouterA and RouterB, set the priority of RouterA to 120 and the preemption delay to 20s, and set the default priority for RouterB.
[RouterA] interface gigabitethernet 2/0/0
[RouterA-GigabitEthernet2/0/0] vrrp vrid 1 virtual-ip 10.1.1.111
[RouterA-GigabitEthernet2/0/0] vrrp vrid 1 priority 120
[RouterA-GigabitEthernet2/0/0] vrrp vrid 1 preempt-mode timer delay 20
[RouterA-GigabitEthernet2/0/0] quit
[RouterB] interface gigabitethernet 2/0/0
[RouterB-GigabitEthernet2/0/0] vrrp vrid 1 virtual-ip 10.1.1.111
[RouterB-GigabitEthernet2/0/0] quit
# Configure VRRP group 2 on RouterA and RouterB, set the priority of RouterB to 120 and the preemption delay to 20s, and set the default priority for RouterA.
[RouterB] interface gigabitethernet 2/0/0
[RouterB-GigabitEthernet2/0/0] vrrp vrid 2 virtual-ip 10.1.1.112
[RouterB-GigabitEthernet2/0/0] vrrp vrid 2 priority 120
[RouterB-GigabitEthernet2/0/0] vrrp vrid 2 preempt-mode timer delay 20
[RouterB-GigabitEthernet2/0/0] quit
[RouterA] interface gigabitethernet 2/0/0
[RouterA-GigabitEthernet2/0/0] vrrp vrid 2 virtual-ip 10.1.1.112
[RouterA-GigabitEthernet2/0/0] quit
- Verify the configuration.
# After the configuration is complete, run the display vrrp command on RouterA. You can see that RouterA is the master in VRRP group 1 and the backup in VRRP group 2.
[RouterA] display vrrp
GigabitEthernet2/0/0 | Virtual Router 1
State : Master
Virtual IP : 10.1.1.111
Master IP : 10.1.1.1
PriorityRun : 120
PriorityConfig : 120
MasterPriority : 120
Preempt : YES Delay Time : 20 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Backup-forward : disabled
Create time : 2012-05-11 03:39
Last change time : 2012-05-11 03:39
GigabitEthernet2/0/0 | Virtual Router 2
State : Backup
Virtual IP : 10.1.1.112
Master IP : 10.1.1.2
PriorityRun : 100
PriorityConfig : 100
MasterPriority : 120
Preempt : YES Delay Time : 0 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-0102
Check TTL : YES
Config type : normal-vrrp
Backup-forward : disabled
Create time : 2012-05-11 03:39
Last change time : 2012-05-11 03:39
# After the configuration is complete, run the display vrrp command on RouterB. You can see that RouterB is the backup in VRRP group 1 and the master in VRRP group 2.
[RouterB] display vrrp
GigabitEthernet2/0/0 | Virtual Router 1
State : Backup
Virtual IP : 10.1.1.111
Master IP : 10.1.1.1
PriorityRun : 100
PriorityConfig : 100
MasterPriority : 120
Preempt : YES Delay Time : 0 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Backup-forward : disabled
Create time : 2012-05-11 03:39
Last change time : 2012-05-11 03:39
GigabitEthernet2/0/0 | Virtual Router 2
State : Master
Virtual IP : 10.1.1.112
Master IP : 10.1.1.2
PriorityRun : 120
PriorityConfig : 120
MasterPriority : 120
Preempt : YES Delay Time : 20 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-0102
Check TTL : YES
Config type : normal-vrrp
Backup-forward : disabled
Create time : 2012-05-11 03:39
Last change time : 2012-05-11 03:39
Configuration Files:
RouterA configuration file
#
sysname RouterA
#
interface GigabitEthernet1/0/0
ip address 192.168.1.1 255.255.255.0
#
interface GigabitEthernet2/0/0
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 1 preempt-mode timer delay 20
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
RouterB configuration file
#
sysname RouterB
#
interface GigabitEthernet1/0/0
ip address 192.168.2.1 255.255.255.0
#
interface GigabitEthernet2/0/0
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
vrrp vrid 2 preempt-mode timer delay 20
#
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
RouterC configuration file
#
sysname RouterC
#
interface GigabitEthernet1/0/0
ip address 192.168.1.2 255.255.255.0
#
interface GigabitEthernet2/0/0
ip address 192.168.2.2 255.255.255.0
#
interface GigabitEthernet3/0/0
ip address 172.16.1.1 255.255.255.0
#
ospf 1
area 0.0.0.0
network 172.16.1.0 0.0.0.255
network 192.168.1.0 0.0.0.255
network 192.168.2.0 0.0.0.255
#
return