Configure VRRP for Load Balancing

Source: Internet
Author: User

Configure VRRP for Load Balancing
Application Environment
Server Load balancer creates multiple backup groups to share network traffic. A vro can belong to multiple backup groups. The operation is as follows:
 
Vroa A acts as the Master of Backup group 1 and Backup of Backup group 2.
Vrob B acts as the Master of Backup group 2 and Backup of Backup group 1.
Some hosts in the network use backup group 1 as the gateway, while some hosts use backup group 2 as the gateway.
In this way, both the purpose of mutual backup and the network traffic can be shared.
 
Description
 
Interfaces that support VRRP include Ethernet, Fast Ethernet, Gigabit Ethernet, VE (Virtual Ethernet), Eth-Trunk, Ethernet sub-interfaces, and VLANIF.
 
Configuration ideas
When configuring the VRRP for load balancing, use the following configuration ideas:
 
Configure the network layer properties of each router interface to connect the network.
Create at least two VRRP configuration groups under the specified interface of the router.
Specify the priority of interfaces in different VRRP Backup groups so that a router is both a Mater router of a Backup group and a Backup router of other Backup groups.
Configuration considerations
When configuring the VRRP for load balancing, you need to prepare the following data:
 
VRRP backup group ID and virtual IP Address
Router priority in the backup group
Configure an instance
Networking requirements
As shown in.
 
As the Master of the Backup group 1 and the Backup of the Backup group 2.
RouterB acts as the Master of Backup group 2 and is also the Backup of Backup group 1.
The HostA in the internal network uses the backup group 1 as the gateway, and the HostC host uses the backup group 2 as the default gateway to share data streams and back up each other.
VRRP Network Diagram of Server Load balancer
 
 
 
Applicable products and versions
Vro can use any NE series product. The vro version is VRP5.30 and later versions.
 
Procedure
Step 1 configure the network connection between devices
 
# Configure the default gateway of the host HostA as the virtual IP address 10.1.1.111 of the backup group 1, and the default gateway of the host HostC as the virtual IP address 10.1.1.112 of the backup group 2.
 
# Configure OSPF between RouterB and RouterC routers.
 
Step 2 configure VRRP
 
# Configure the interface GE2/0/0 on routeside, create backup group 1, and set the priority of routeside in backup group 1 to 120 (as the Master ). Create a Backup group 2 and configure the priority of routegroup 2 as the default value 100 (as Backup ).
 
<Roupid> system-view
 
[Route] interface gigabitethernet 2/0/0
 
[RouterA-GigabitEthernet2/0/0] ip address 10.1.1.1 24
 
[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 2 virtual-ip 10.1.1.112
 
[RouterA-GigabitEthernet2/0/0] quit
 
# Configure interface GE2/0/0 on RouterB, create Backup group 1, and set RouterB's priority in Backup group 1 to the default value 100 (as Backup ). Create backup group 2 and configure RouterB's priority in backup group 2 as 120 (as Master ).
 
<RouterB> system-view
 
[RouterB] interface gigabitethernet 2/0/0
 
[RouterB-GigabitEthernet2/0/0] ip address 10.1.1.2 24
 
[RouterB-GigabitEthernet2/0/0] vrrp vrid 1 virtual-ip 10.1.1.111
 
[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] quit
 
Verification Result
After completing the preceding configurations, the HostA and HostC hosts in the network can Ping the HostB respectively.
 
Perform a tracert test on the HostB address on HostA and HostC respectively. We can see that HostA arrives at HostB after RouterC and RouterC, while HostC arrives at HostB after RouterB and RouterC. That is, RouterB and RouterB share the load of internal network traffic.
 
Run the "display vrrp" command on the routerworker to check that the routerworker is used as the Master of the Backup group 1 and the Backup of the Backup group 2 respectively.
 
<Rouyun> display vrrp
 
GigabitEthernet2/0/0 | Virtual Router 1
 
State: Master
 
Virtual IP: 10.1.1.111
 
PriorityRun: 120
 
PriorityConfig: 120
 
MasterPriority: 120
 
Preempt: YES Delay Time: 0
 
Timer: 1
 
Auth Type: NONE
 
Check TTL: YES
 
GigabitEthernet2/0/0 | Virtual Router 2
 
State: Backup
 
Virtual IP: 10.1.1.112
 
PriorityRun: 100
 
PriorityConfig: 100
 
MasterPriority: 120
 
Preempt: YES Delay Time: 0
 
Timer: 1
 
Auth Type: NONE
 
Check TTL: YES
 
Configuration File
Routeconfig File
#
 
Sysname roupid
 
#
 
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 2 virtual-ip 10.1.1.112
 
#
 
Interface Pos1/0/0
 
Link-protocol ppp
 
Ip address 192.168.1.1 255.255.255.0
 
#
 
Ospf 1
 
Area 0.0.0.0
 
Network 192.168.1.0 0.0.255
 
Network 10.1.1.0 0.0.255
 
#
 
Return
 
Configuration file of RouterB
#
 
Sysname RouterB
 
#
 
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
 
#
 
Interface Pos1/0/0
 
Link-protocol ppp
 
Ip address 192.168.2.1 255.255.255.0
 
#
 
Ospf 1
 
Area 0.0.0.0
 
Network 192.168.2.0 0.0.255
 
Network 10.1.1.0 0.0.255
 
#
 
Return
 
RouterC configuration file
#
 
Sysname RouterC
 
#
 
Interface Ethernet3/0/0
 
Ip address 255.1.1.1 255.255.255.0
 
#
 
Interface Pos1/0/0
 
Link-protocol ppp
 
Clock master
 
Ip address 192.168.1.2 255.255.255.0
 
#
 
Interface Pos2/0/0
 
Link-protocol ppp
 
Clock master
 
Ip address 192.168.2.2 255.255.255.0
 
#
 
Ospf 1
 
Area 0.0.0.0
 
Network 192.168.1.0 0.0.255
 
Network 192.168.2.0 0.0.255
 
Network latency 1.1.0 0.0.255
 
#
 
Return
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.