H3C Campus Fixed-Port Switches CLI-Based Quick Start Configuration Guide-6W101

HomeSupportQuick StartH3C Campus Fixed-Port Switches CLI-Based Quick Start Configuration Guide-6W101
Table of Contents
Related Documents
28-VRRP Quick Start Configuration Guide
Title Size Download
28-VRRP Quick Start Configuration Guide 87.06 KB

VRRP Quick Start Configuration Guide

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Copyright © 2022 New H3C Technologies Co., Ltd. All rights reserved.

No part of this manual may be reproduced or transmitted in any form or by any means without prior written consent of New H3C Technologies Co., Ltd.

Except for the trademarks of New H3C Technologies Co., Ltd., any trademarks that may be mentioned in this document are the property of their respective owners.

The information in this document is subject to change without notice.



Configuring a single VRRP group

Introduction

The following information uses an example to describe the basic procedure for configuring a single VRRP group.

Network configuration

As shown in Figure 1, Host A needs to access Host B on the Internet. Two devices are deployed at the network egress of Host A. Configure a VRRP group on Device A and Device B to act as the default gateway for Host A and implement the following requirements:

·     Device A operates as the master to forward packets from Host A to Host B.

·     When Device A fails, Device B takes over to forward packets for Host A.

·     When Device A recovers, Device A acts as the gateway again.

Figure 1 Network diagram

 

Restrictions and guidelines

·     You cannot specify the virtual IP address as any of the following IP addresses:

¡     All-zero address (0.0.0.0).

¡     Broadcast address (255.255.255.255).

¡     Loopback address.

¡     IP address of other than Class A, Class B, and Class C.

¡     Invalid IP address (for example, 0.0.0.1).

·     You can specify the IPv4 VRRP version as VRRPv2 or VRRPv3 (default version). The version of VRRP on all routers in an IPv4 VRRP group must be the same.

·     The virtual IP address of an IPv4 VRRP group and the downlink interface IP addresses of the VRRP group members must be in the same subnet. Otherwise, the hosts in the subnet might fail to access external networks.

·     Make sure all members in a VRRP group have the same virtual IP address configured.

·     Make sure the reduced priority is lower than the priority of any other devices in the VRRP group, so that another device can be elected as master.

Procedure

Configure Device A

# Configure VLAN 2 and add GigabitEthernet 1/0/1 to VLAN 2.

<DeviceA> system-view

[DeviceA] vlan 2

[DeviceA-vlan2] port gigabitethernet 1/0/1

[DeviceA-vlan2] quit

# Create VLAN-interface 2 and set its IP address to 10.1.1.1/24.

[DeviceA] interface vlan-interface 2

[DeviceA-Vlan-interface2] ip address 10.1.1.1 255.255.255.0

# Create VRRP group 1 on VLAN-interface 2 and set its virtual IP address to 10.1.1.111.

[DeviceA-Vlan-interface2] vrrp vrid 1 virtual-ip 10.1.1.111

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

[DeviceA-Vlan-interface2] vrrp vrid 1 priority 110

# Configure Device A to operate in preemptive mode, so it can become the master whenever it operates correctly. Set the preemption delay to 5000 centiseconds to avoid frequent status switchover.

[DeviceA-Vlan-interface2] vrrp vrid 1 preempt-mode delay 5000

[DeviceA-Vlan-interface2] quit

# Create track entry 1 associated with GigabitEthernet 1/0/2.

[DeviceA] track 1 interface gigabitethernet 1/0/2

[DeviceA-track-1] quit

# Create track entry 1. When the track entry transits to Negative state, Device A decreases its priority by 50 in the VRRP group.

[DeviceA] interface vlan-interface 2

[DeviceA-Vlan-interface2] vrrp vrid 1 track 1 priority reduced 50

[DeviceA-Vlan-interface2] quit

Configure Device B

# Configure VLAN 2.

<DeviceB> system-view

[DeviceB] vlan 2

[DeviceB-Vlan2] port gigabitethernet 1/0/1

[DeviceB-vlan2] quit

[DeviceB] interface vlan-interface 2

[DeviceB-Vlan-interface2] ip address 10.1.1.2 255.255.255.0

# Create VRRP group 1 on VLAN-interface 2 and set its virtual IP address to 10.1.1.111.

[DeviceB-Vlan-interface2] vrrp vrid 1 virtual-ip 10.1.1.111

# Set the priority of Device B to 100 in VRRP group 1.

[DeviceB-Vlan-interface2] vrrp vrid 1 priority 100

Verifying the configuration

# Ping Host B from Host A. (Details not shown.)

# Display detailed information about VRRP group 1 on Device A.

[DeviceA-Vlan-interface2] display vrrp verbose

IPv4 Virtual Router Information:

 Running mode : Standard

 Total number of virtual routers : 1

   Interface Vlan-interface2

     VRID           : 1                    Adver Timer  : 100

     Admin Status   : Up                   State        : Master

     Config Pri     : 110                  Running Pri  : 110

     Preempt Mode   : Yes                  Delay Time   : 5000

     Auth Type      : Not supported

     Version          : 3

     Virtual IP       : 10.1.1.111

     Virtual MAC      : 0000-5e00-0101

     Master IP        : 10.1.1.1

   VRRP Track Information:

     Track Object   : 1                   State : Positive   Pri Reduced : 50

# Display detailed information about VRRP group 1 on Device B.

[DeviceB-Vlan-interface2] display vrrp verbose

IPv4 Virtual Router Information:

 Running mode : Standard

 Total number of virtual routers : 1

   Interface Vlan-interface2

     VRID           : 1                    Adver Timer  : 100

     Admin Status   : Up                   State        : Backup

     Config Pri     : 100                  Running Pri  : 100

     Preempt Mode   : Yes                  Delay Time   : 0

     Become Master  : 401ms left

     Auth Type        : Not supported

     Version          : 3

     Virtual IP       : 10.1.1.111

     Master IP        : 10.1.1.1

The output shows that Device A is operating as the master in VRRP group 1 to forward packets from Host A to Host B.

# When Device A fails, verify that Host A can still ping Host B. (Details not shown.)

# Display detailed information about VRRP group 1 on Device B.

[DeviceB-Vlan-interface2] display vrrp verbose

IPv4 Virtual Router Information:

 Running Mode : Standard

 Total number of virtual routers : 1

   Interface Vlan-interface2

     VRID           : 1                    Adver Timer  : 100

     Admin Status   : Up                   State        : Master

     Config Pri     : 100                  Running Pri  : 100

     Preempt Mode   : Yes                  Delay Time   : 0

     Auth Type        : Not supported

     Version          : 3

     Virtual IP       : 10.1.1.111

     Master IP        : 10.1.1.2

The output shows that when Device A fails, Device B takes over to forward packets from Host A to Host B.

# After Device A recovers, display detailed information about VRRP group 1 on Device A.

[DeviceA-Vlan-interface2] display vrrp verbose

IPv4 Virtual Router Information:

 Running Mode      : Standard

 Total number of virtual routers : 1

   Interface Vlan-interface2

     VRID           : 1                    Adver Timer  : 100

     Admin Status   : Up                   State        : Master

     Config Pri     : 110                  Running Pri  : 110

     Preempt Mode   : Yes                  Delay Time   : 5000

     Auth Type      : Not supported

     Version          : 3

     Virtual IP       : 10.1.1.111

     Virtual MAC      : 0000-5e00-0101

     Master IP        : 10.1.1.1

   VRRP Track Information:

     Track Object   : 1                   State : Positive   Pri Reduced : 50

The output shows that after Device A resumes normal operation, it becomes the master to forward packets from Host A to Host B.

Configuration files

·     Device A:

#

vlan 2

#

interface Vlan-interface2

 ip address 10.1.1.1 255.255.255.0

 vrrp vrid 1 virtual-ip 10.1.1.111

 vrrp vrid 1 priority 110

 vrrp vrid 1 preempt-mode delay 5000

 vrrp vrid 1 track 1 priority reduced 50

#

interface GigabitEthernet1/0/1

 port link-mode bridge

 port access vlan 2

#

 track 1 interface Ten-GigabitEthernet1/0/2

#

·     Device B:

#

vlan 2

#

interface Vlan-interface2

 ip address 10.1.1.2 255.255.255.0

 vrrp vrid 1 virtual-ip 10.1.1.111

 vrrp vrid 1 priority 100

#

interface Ten-GigabitEthernet1/0/1

 port link-mode bridge

 port access vlan 2

#

Related documentation

·     VRRP configuration in the high availability configuration guide for the device.

·     VRRP commands in the high availability command reference for the device.

 

  • Cloud & AI
  • InterConnect
  • Intelligent Computing
  • Security
  • SMB Products
  • Intelligent Terminal Products
  • Product Support Services
  • Technical Service Solutions
All Services
  • Resource Center
  • Policy
  • Online Help
All Support
  • Become a Partner
  • Partner Resources
  • Partner Business Management
All Partners
  • Profile
  • News & Events
  • Online Exhibition Center
  • Contact Us
All About Us
新华三官网