Configuring VRRP in Load Balancing Mode

In this example, by configuring a VRRP backup group in load balancing mode, you can provide the mutual backup function to devices in the VRRP backup group and balance network traffic among these devices.

Networking Requirements


As shown in Figure 1.
  • CX-A serves as the master CX device of backup group 1 and the backup CX device of backup group 2.
  • CX-B serves as the master CX device of backup group 2 and the backup CX device of backup group 1.
  • Host A in the internal network takes backup group 1 as its gateway and Host C takes backup group 2 as its gateway to share the traffic and backup each other.
Figure 1 Networking diagram of configuring VRRP in load balancing mode

Configuration Roadmap

The configuration roadmap is as follows:
  1. Create two backup groups on the GE 2/0/0 interface on CX-A. CX-A is the master CX device in the backup group 1 and the backup in group 2.
  2. Create two backup groups on the GE 2/0/0 interface on CX-B. CX-B is the backup CX device in the backup group 1 and the master in backup group 2.

Data Preparation

To complete the configuration, you need the following data:
  • Virtual router ID and virtual IP address
  • Priority of each CX device in the backup group

Procedure

  1. Configure the network interconnection between devices.
    # Configure the default gateway of Host A as the virtual IP address 10.1.1.111 in backup group 1, the default gateway of Host B as 20.1.1.1, and the default gateway of Host C as the virtual IP address 10.1.1.112 in backup group 2.
    # Configure CX-A, CX-B, and CX- C to use OSPF for interconnection.
  2. Configure VRRP.
    # On CX-A, configure the IP address of the interface, create backup backup group 1 and configure the priority of CX-A in this backup group as 120 (as the master CX device). Create backup group 2 and configure the priority of CX-A in this backup group with the default value 100 (as the backup CX device).
    <CX-A> system-view
    [CX-A] interface gigabitethernet 2/0/0
    [CX-A-GigabitEthernet2/0/0] undo shutdown
    [CX-A-GigabitEthernet2/0/0] ip address 10.1.1.1 24
    [CX-A-GigabitEthernet2/0/0] vrrp vrid 1 virtual-ip 10.1.1.111
    [CX-A-GigabitEthernet2/0/0] vrrp vrid 1 priority 120
    [CX-A-GigabitEthernet2/0/0] vrrp vrid 2 virtual-ip 10.1.1.112
    [CX-A-GigabitEthernet2/0/0] quit
    # On CX-B, configure the IP address of the interface, create backup backup group 1 and configure the priority of CX-B in this backup group with the default value 100 (as the backup CX device). Create backup group 2, and configure the priority of CX-B in this backup group with 120 (as the master CX device).
    <CX-B> system-view
    [CX-B] interface gigabitethernet 2/0/0
    [CX-B-GigabitEthernet2/0/0] undo shutdown
    [CX-B-GigabitEthernet2/0/0] ip address 10.1.1.2 24
    [CX-B-GigabitEthernet2/0/0] vrrp vrid 1 virtual-ip 10.1.1.111
    [CX-B-GigabitEthernet2/0/0] vrrp vrid 2 virtual-ip 10.1.1.112
    [CX-B-GigabitEthernet2/0/0] vrrp vrid 2 priority 120
    [CX-B-GigabitEthernet2/0/0] quit
  3. Verify the configuration.
    After the previous configuration, Host A and Host C in the network can ping through Host B.
    Tracert Host B from Host A and Host C. Packets from Host A to Host B pass through CX-A and CX-C. Packets from Host C to Host B pass through CX-A and CX-C. That is, the load balancing is enabled for CX-A and CX-B to share the internal traffic.
    <HostA> tracert 20.1.1.100
    traceroute to 20.1.1.100 (20.1.1.100), max hops: 30, packet length: 40, press CTRL_C to break
     1   10.1.1.1     120 ms  50 ms  60 ms
     2   192.168.1.2  100 ms  60 ms  60 ms
     3   20.1.1.100   130 ms  90 ms  90 ms
    <HostC> tracert 20.1.1.100
    traceroute to 20.1.1.100 (20.1.1.100), max hops: 30, packet length: 40, press CTRL_C to break
     1   10.1.1.2     30 ms  60 ms  40 ms
     2   192.168.2.2  90 ms  60 ms  60 ms
     3   20.1.1.100   70 ms  60 ms  90 ms
    Running the display vrrp command on CX-A, you can view that CX-A serves as the master CX device in backup group 1 and the backup CX device in backup group 2.
    <CX-A> display vrrp
    <CX-A> 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 : 0
        TimerRun       : 1
        TimerConfig    : 1
        Auth Type      : NONE
        Virtual Mac    :  0000-5e00-0101
        Check TTL      : YES
        Config type    : normal-vrrp
      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
        TimerRun       : 1
        TimerConfig    : 1
        Auth Type      : NONE
        Virtual Mac    :  0000-5e00-0102
        Check TTL      : YES
        Config type    : normal-vrrp


Configuration Files

  • Configuration file of CX-A
    #
     sysname CX-A
    #
    interface GigabitEthernet2/0/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
    #
    interface Pos1/0/0
     link-protocol ppp
     undo shutdown
     ip address 192.168.1.1 255.255.255.0
    #
    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
  • Configuration file of CX-B
    #
     sysname CX-B
    #
    interface GigabitEthernet2/0/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
    #
    interface Pos1/0/0
     link-protocol ppp
     undo shutdown
     ip address 192.168.2.1 255.255.255.0
    #
    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
  • Configuration file of CX-C
    #
     sysname CX-C
    #
    interface Ethernet3/0/0
     undo shutdown
     ip address 20.1.1.1 255.255.255.0
    #
    interface Pos1/0/0
     link-protocol ppp
     undo shutdown
     ip address 192.168.1.2 255.255.255.0
    #
    interface Pos2/0/0
     link-protocol ppp
     undo shutdown
     ip address 192.168.2.2 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 20.1.1.0 0.0.0.255
    #
    return

No comments:

Post a Comment