Professional Documents
Culture Documents
01-03 VRRP Configuration
01-03 VRRP Configuration
3 VRRP Configuration
This chapter describes how to configure the Virtual Router Redundancy Protocol
(VRRP). VRRP switches services from the master to the backup when the gateway
becomes faulty, providing continuous and reliable communication services.
Definition
VRRP groups multiple routing devices into a virtual router and uses the virtual
gateway device's IP address as the default gateway address. When the gateway
fails, VRRP selects a new gateway to transmit service traffic to ensure reliable
communication.
Purpose
As networks rapidly develop and applications become diversified, various value-
added services such as Internet Protocol television (IPTV) and video conferencing
services are widely deployed. Demands for network infrastructure reliability are
increasing, especially for nonstop service transmission.
Generally, all hosts on the same network segment are configured with the same
default route with the gateway address as the next hop address. The hosts use the
default route to send packets to the gateway and the gateway forwards the
packets to other network segments. When the gateway fails, hosts with the same
default route cannot communicate with external networks. A common method to
improve network reliability is to configure multiple egress gateways. However,
route selection between the gateways becomes an issue.
VRRP resolves this issue. VRRP virtualizes multiple routing devices into a virtual
router without changing the networking. The virtual router IP address is
configured as the default gateway address. When the gateway fails, VRRP selects
a new gateway to transmit service traffic to ensure reliable communication.
Benefits
On a multicast or broadcast LAN, such as Ethernet, VRRP provides a highly reliable
link when the gateway fails, without modifying host and gateway configurations.
VRRP prevents network interruptions when a single link fails.
3.2 Principles
This section describes the implementation of VRRP.
Master
10.1.1.10/24
Switch
SwitchA
Internet
HostA SwitchB
Gateway:10.1.1.10/24
IP Address:10.1.1.3/24
Backup
10.1.1.1/24
● Virtual MAC address: MAC address that is generated by the virtual router
based on the VRID. A virtual router has one virtual MAC address and is in the
format of 00-00-5E-00-01-{VRID} (VRRP for IPv4) or 00-00-5E-00-02-{VRID}
(VRRP for IPv6). The virtual router sends ARP Reply packets carrying the
virtual MAC address but not the interface MAC address. The VRID of the
virtual router composed of SwitchA and SwitchB is 1, so the MAC address of
the VRRP group is 00-00-5E-00-01-01.
IP Address (n)
Authentication Data (1)
Authentication Data (2)
IPvX Address(es)
VRRPv2 VRRPv3
Virtual Rtr Virtual router ID. The value Virtual router ID. The value
ID (VRID) ranges from 1 to 255. ranges from 1 to 255.
Field Description
VRRPv2 VRRPv3
IP Address/ Virtual IPv4 address in the VRRP Virtual IPv4 or IPv6 address in
IPvX group. The Count IP Addrs field the VRRP group. The Count IPvX
Address(es) determines the number of Addrs field determines the
virtual IPv4 addresses in the number of virtual IPv4 or IPv6
VRRP group. addresses in the VRRP group.
VRRP Authentication
Different authentication modes and authentication keys can be set in VRRPv2
Advertisement packets:
● Non-authentication: The local device does not authenticate VRRP
Advertisement packets before sending them. The remote device does not
authenticate the received VRRP Advertisement packets and considers all the
received packets valid.
● Simple authentication: The local device encapsulates the authentication mode
and authentication key into an outgoing VRRP Advertisement packet. When
the remote device receives the VRRP Advertisement packet, it checks whether
the authentication mode and authentication key in the packet are the same
as those configured locally. If so, the device considers the received VRRP
Advertisement packet valid. If not, the device considers the received VRRP
Advertisement packet invalid and discards it.
● MD5 authentication: The local device uses the MD5 algorithm to encrypt the
authentication key and encapsulates the key in the Authentication Data field
of an outgoing VRRP Advertisement packet. When the remote device receives
the VRRP Advertisement packet, it decrypts the authentication key, and then
checks whether the authentication mode and authentication key are the same
as those configured locally. The remote device then accepts or discards the
packet depending on the authentication result.
Status Description
If congestion occurs on an unstable network, the backup may not receive VRRP
Advertisement packets from the master within the period of Master_Down_Interval. A
backup then switches to the Master state. If the VRRP Advertisement packet from the
original master reaches the backup (new master), the new master switches to the
Backup state. In this case, the VRRP group status changes frequently. To solve the
problem, the preemption delay is used. When the Master_Down_Interval timer expires,
the backup waits for the preemption delay. If the backup does not receive a VRRP
Advertisement packet within the preemption delay, it switches to the Master state.
SwitchC based on their priorities. The new master then takes over traffic
forwarding.
Switch
Internet
SwitchB
Backup Router
HostB
SwitchC
Backup
VRRP
SwitchA
Initialize
HostA
Switch
Internet
SwitchB
Backup Router
HostB
● SwitchA is the master, with the priority 120. It uses the delayed preemption
mode.
● SwitchB is the backup, with the priority 100. It uses the immediate
preemption mode.
● SwitchC is the backup, with the priority 110. It uses the immediate
preemption mode.
1. When SwitchA is running properly, traffic sent from users is transmitted along
the path Switch -> SwitchA -> Router. SwitchA periodically sends VRRP
Before enabling VRRP smooth switching, you must configure the backup to learn the interval at
which VRRP Advertisement packets are sent.
1. The backup receives a VRRP Advertisement packet from the master and
checks the interval in the packet. If the interval in the packet is different from
the locally configured interval, the backup changes its own interval in
accordance with the interval in the received packet.
2. When the master starts an active/standby switchover, it will save the current
interval at which VRRP Advertisement packets are sent and set the VRRP
smooth switching time to a new interval. During smooth VRRP switching, the
master sends a VRRP Advertisement packet at the new interval.
3. When the backup receives the VRRP Advertisement packet, it l changes its
own interval in accord with the new interval in the packet.
4. After the switchover is complete, the master restores its original interval and
sends a VRRP Advertisement packet at the new interval. The backup learns
the interval after receiving the packet.
● During VRRP smooth switching, the learning function takes precedence over the
preemption function. When the interval carried in the received packet is different from
the current interval and the priority carried in the received packet is lower than the
configured priority, the learning function takes effect and the timer is reset.
● VRRP smooth switching also depends on the system. If the system is busy since the
switchover and cannot schedule tasks of the VRRP module, VRRP smooth switching
cannot take effect.
3.2.5 mVRRP
A switch is usually dual-homed to two devices to improve network reliability.
Multiple VRRP groups can be configured on the two devices to transmit various
types of services. Each VRRP group needs to maintain its own state machine;
therefore, a large number of VRRP Advertisement packets are transmitted
between devices.
As shown in Figure 3-5, to decrease bandwidth and CPU resources occupied by
protocol packets, configure a VRRP group as a management Virtual Router
Redundancy Protocol (mVRRP) group and bind other VRRP groups to the mVRRP
group. The mVRRP group sends VRRP Advertisement packets to determine the
master and backup status for its VRRP groups. The bound VRRP groups do not
send VRRP Advertisement packets and the VRRP status is the same as the mVRRP
group status.
Switch
2
Service mVRRP Internet
VRRP
1 mVRRP
HostB SwitchB
Backup
● mVRRP group
An mVRRP group has all functions of a common VRRP group, and determines
the statuses of its member VRRP groups by sending VRRP Advertisement
packets. An mVRRP group can be deployed on the same side as service VRRP
groups or on the interfaces that directly connect SwitchA and SwitchB:
– When an mVRRP group functions as the gateway (mVRRP1 in Figure
3-5), the mVRRP group determines the Master and Backup statuses and
forwards service traffic. You must first create a VRRP group and configure
a virtual IP address as the gateway address, and then configure this VRRP
group as an mVRRP group.
– When an mVRRP group does not function as the gateway (mVRRP2 in
Figure 3-5), the mVRRP group only determines the master and backup
statuses, and cannot forward service traffic. The mVRRP group does not
require a virtual IP address, and you can directly create an mVRRP group
on an interface. mVRRP simplifies maintenance.
● Service VRRP group
After common VRRP groups are bound to an mVRRP group, they become
service VRRP groups (member VRRP groups). Service VRRP groups do not
need to send VRRP Advertisement packets to determine their statuses. The
mVRRP group sends VRRP Advertisement packets to determine its status and
the statuses of all its bound service VRRP groups.
it detects that the priority in the VRRP Advertisement packets is lower than its
priority. The backup switches to the master. This ensures traffic forwarding.
Figure 3-6 Association between a VRRP group and the interface status
Master Interface1
SwitchA SwitchC
HostA
Switch
Internet
VRRP
Backup Interface1
SwitchA SwitchC
HostA
Switch
Internet
Faulty interface
Figure 3-7 Associating VRRP with BFD/NQA/routing to monitor the uplink status
Master
SwitchA SwitchC
HostA
Switch
Internet
SwitchE
HostB SwitchB SwitchD
Backup
VRRP
Backup
SwitchA SwitchC
HostA
Switch
Internet
SwitchE
HostB SwitchB SwitchD
Master
Service traffic
VRRP BFD/NQA/Routing
to a VRRP group fail, VRRP Advertisement packets cannot be sent for negotiation.
A backup will switch to the master after three times the duration of the interval
(about 3s) at which point VRRP Advertisement packets are sent. During the
switchover period, service traffic is still sent to the original master, causing user
traffic loss.
BFD can rapidly detect connectivity of links on the network. Association between
VRRP and BFD implements a fast switchover within 1 second. A BFD session is set
up between the master and backup and is bound to a VRRP group. BFD detects
faults of the VRRP group. When a fault occurs, BFD notifies the VRRP group of
performing an active/standby switchover, greatly reducing the service interruption
time.
A VRRP group can be associated with a static BFD session or a BFD session with
automatically negotiated parameters.
HostB SwitchB
Backup
VRRP
Initialize
SwitchA
HostA
Switch
Internet
HostB SwitchB
Master
Service traffic
VRRP BFD packets
When a fault occurs in the VRRP group, BFD rapidly detects the fault and instructs
SwitchB to increase the priority to a value higher than that of SwitchA. SwitchB
immediately switches to the master and forwards user-side traffic, implementing a
rapid active/standby switchover.
Network
Interface1 Interface2
SwitchA SwitchB
Master Backup
STP
VRRP
Switch
Switch
Internet
SwitchB
Backup Router
HostB
SwitchC
Backup
VRRP
SwitchA
Initialize
HostA
Switch
Internet
SwitchB
Router
Backup
HostB
As shown in Figure 3-10, SwitchA is the master and forwards service packets.
SwitchB and SwitchC are backups and do not forward services. If SwitchA is faulty,
a new master is selected from SwitchB and SwitchC based on their priorities. The
new master then takes over traffic.
You can configure VRRP to monitor the uplink status and association between
VRRP and BFD to enhance the VRRP active/standby function.
● To detect the faults on the uplink, configure VRRP to monitor the uplink
status. When the uplink interface or uplink fails, the priority of the master is
Internet
HostB
Default gateway: SwitchB
10.1.1.112 VRID2:Master
VRID1:Backup
VRRP VRID 2
Virtual IP Address: Data flow 1
10.1.1.112 Data flow 2
VRRP groups 1 and 2 are gateways for different user hosts. The VRRP groups load
balance traffic and back up each other.
Licensing Requirements
VRRP is a basic feature of a switch and is not under license control.
VRRP6 can be only used on the device enabled with IPv6. IPv6 requires a license.
By default, IPv6 of a newly purchased device is disabled. To use IPv6, apply for and
purchase the license from the equipment supplier.
Version Requirements
Feature Limitations
● In V200R003 and earlier versions, VRRP can be configured only on the VLANIF
interface.
In V200R005, VRRP can be configured on the VLANIF interface and Layer 3
Ethernet interface.
In V200R006 and later versions, VRRP can be configured on the VLANIF
interface, Layer 3 Ethernet interface, Dot1q termination sub-interface, and
QinQ termination sub-interface.
● In V200R010 and later versions, VRRP6 can be configured on Dot1q
termination sub-interfaces or QinQ termination sub-interfaces.
● Switches of a VRRP group must be configured with the same VRID.
● VRRP groups must use different virtual IP addresses. The virtual IP address of
a VRRP group must be on the same network segment as the IP address of the
interface where the VRRP group is configured.
● If each switch in the VRRP group uses a different VRRP version, VRRP packets
may fail to be transmitted. When a VRRPv3-enabled switch and a VRRPv2-
enabled switch belong to the same VRRP group, run the vrrp version-3 send-
packet-mode { v2-only | v2v3-both } command to configure the switch to
send VRRPv2 packets.
● If both VRRP and static ARP are configured on a VLANIF interface, a Dot1q
termination sub-interface, a QinQ termination sub-interface, or an Ethernet
interface on a device, an IP address mapped to a static ARP entry cannot be
used as a virtual IP address. If a VRRP virtual IP address is an IP address
mapped to a static ARP entry on the device, the device generates incorrect
host routes, affecting traffic forwarding.
● The virtual MAC address of a VRRP group cannot be configured as a static or
blackhole MAC address.
● In V200R003 and earlier versions, a maximum of 255 VRRP groups can be
configured on the switch by default. In V200R005 and later versions, a
maximum of 256 VRRP groups can be configured on the switch by default. In
V200R010C00 and later versions, the set vrrp max-group-number max-
group-number command can be used to set the maximum number of allowed
VRRP groups.
● When configuring VRRP on the subinterface view, pay attention to the
following points:
– In V200R009 and earlier versions, when VRRP is configured on a Dot1q
termination sub-interface, only one VLAN can be configured on the sub-
interface. When VRRP is configured on a QinQ termination sub-interface,
only one PE VLAN and one CE VLAN can be configured on the sub-
interface.
– When configuring the VRRP groups on a VLAN tag termination sub-
interface, run the arp broadcast enable command to enable ARP
broadcast on the VLAN tag termination sub-interface.
● The ARP aging probe packets sent by a VRRP device use an interface IP
address, instead of a virtual IP address, as the source IP address.
Pre-configuration Tasks
An IPv4 VRRP group implements gateway backup and ensures stable and highly-
efficient data forwarding.
Before configuring basic functions of an IPv4 VRRP group, configure network layer
attributes of interfaces to ensure network connectivity.
Context
VRRP virtualizes multiple devices into one gateway without changing the
networking, and uses the virtual gateway's IP address as the default gateway
address to implement next-hop gateway backup. After a VRRP group is configured,
traffic is forwarded through the master. If the master fails, a new master is
selected from the backups to forward traffic. This implements gateway backup.
Procedure
● Create a VRRP group working in active/standby mode.
a. Run:
system-view
You are advised not to configure a VRRP group on the VLANIF interface
corresponding to a super-VLAN. If VRRP groups are configured on the VLANIF
interface corresponding to a super-VLAN, ensure that a maximum of 256 VLANs
including common VLANs, super-VLANs, and sub-VLANs are used. Otherwise,
device performance may be affected.
c. (Optional) On an Ethernet interface, run:
undo portswitch
● Do not configure more than 1000 virtual IP addresses. Otherwise, the VRRP
group may flap.
● If many VRRP groups are configured, you can configure an mVRRP group and
bind VRRP groups to the mVRRP group to prevent CPU resources consumed
by protocol packets.
● Create VRRP groups working in multi-gateway load balancing mode.
If VRRP groups need to work in multi-gateway load balancing mode, repeat
the steps to configure two or more VRRP groups on the interface and assign
different VRIDs to them.
Context
Devices with higher priorities in a VRRP group are more likely to become the
master. You can specify the master to forward traffic by setting device priorities.
Procedure
1. Run:
system-view
Context
IPv4 VRRP supports VRRPv2 and VRRPv3. If devices in a VRRP group use different
VRRP versions, VRRP Advertisement packets may fail to be forwarded.
● A VRRPv2 group can send and receive only VRRPv2 Advertisement packets,
and discards received VRRPv3 Advertisement packets.
● A VRRPv3 group can send and receive both VRRPv2 and VRRPv3
Advertisement packets. You can configure the mode in which VRRPv3
Advertisement packets are sent as v2-only, v3-only, or v2v3-both.
Procedure
Step 1 Run:
system-view
----End
Context
On an unstable network, if the BFD session status monitored by a VRRP group
flaps frequently or the backups cannot receive VRRP Advertisement packets within
a specified period, an active/standby switchover is performed, which causes
network flapping. The VRRP preemption mode and preemption delay can be
configured on the switch to enhance the stability of the master and backup.
It is recommended that immediate preemption be configured on the backup,
delayed preemption be configured on the master, and the preemption delay be
set. On an unstable network, these settings allow a period of time for status
synchronization between the uplink and downlink. If the preceding settings are
not used, two masters may coexist and users' devices may learn the incorrect
address of the master.
Procedure
● Configure non-preemption for the VRRP group on the switch.
a. Run:
system-view
In non-preemption mode, the master that works properly can retain the
Master state. This state cannot be preempted even if the priority of the
master decreases.
● Configure a preemption mode on the switch and set the preemption delay.
a. Run:
system-view
----End
Context
You can set VRRP time parameters as needed. Table 3-6 lists applicable scenarios.
Procedure
● Set the interval at which VRRP Advertisement packets are sent.
a. Run:
system-view
The interval at which gratuitous ARP packets are sent by the master is
set.
The interval at which the master sends gratuitous ARP packets must be shorter
than the aging time of ARP entries on user devices.
▪ If the master does not need to send gratuitous ARP packets, run the
vrrp gratuitous-arp timeout disable command in the system view.
● Set the delay before a VRRP group recovers.
a. Run:
system-view
● After this command is used, all VRRP groups on the device are configured
with the same delay.
● When the device in a VRRP group restarts, VRRP status flapping may occur. It
is recommended that the delay be set based on actual networking.
----End
Context
When a VRRP group is configured in a super-VLAN, configure VRRP Advertisement
packets to be sent to a specified sub-VLAN. Otherwise, Advertisement packets
would be broadcast in all sub-VLANs, wasting network bandwidth.
Prerequisites
A Super-VLAN has been configured.
Procedure
Step 1 Run:
system-view
The mode in which VRRP Advertisement packets are sent in a super-VLAN is set.
By default, the master sends VRRP Advertisement packets to a sub-VLAN that is
Up and has the smallest VLAN ID in a super-VLAN.
● If sub-vlan-id is specified, the master sends VRRP Advertisement packets to a
specified sub-VLAN.
● If all is specified, the master broadcasts VRRP Advertisement packets to all
sub-VLANs of a super-VLAN.
If all is specified, the master broadcasts VRRP Advertisement packets to all sub-VLANs of a
super-VLAN, increasing the CPU usage. Therefore, do not specify all.
----End
Context
The system checks the TTL value in received VRRP Advertisement packets, and
discards VRRP Advertisement packets with TTL values other than 255. On a
network where devices of different vendors are deployed, if TTL check is enabled
on the device, the device may incorrectly discard valid packets. In this case, disable
TTL check so that devices of different vendors can communicate.
Procedure
Step 1 Run:
system-view
Step 2 Run:
interface interface-type interface-number
Step 4 Run:
vrrp un-check ttl
The device is configured not to check the TTL value in VRRP Advertisement
packets.
By default, the system checks the TTL value in VRRP Advertisement packets.
----End
Context
Different authentication modes and authentication keys can be set in VRRPv2
Advertisement packets:
● Non-authentication: The device does not send authentication information in
outgoing VRRP Advertisement packets, and does not authenticate received
VRRP Advertisement packets, considering them all to be valid.
● Simple authentication: The device encapsulates the authentication mode and
authentication key into outgoing VRRP Advertisement packets. When a device
receives a VRRP Advertisement packet, it compares the authentication mode
and authentication key in the packet with those configured on the device. If
the values are the same, the device considers the received VRRP
Advertisement packet to be valid; otherwise, it discards it.
● MD5 authentication: The device uses the MD5 algorithm to encrypt the
authentication key and encapsulates the key in the Authentication Data field
of an outgoing VRRP Advertisement packet. The device that receives the VRRP
Advertisement packet matches the authentication mode with the decrypted
authentication key in the packet.
Only VRRPv2 supports authentication. VRRPv3 does not support authentication. VRRPv2
reserves the authentication field in VRRP Advertisement packets to be compatible with
VRRP defined in earlier versions. VRRP authentication cannot improve security.
Procedure
Step 1 Run:
system-view
Step 2 Run:
interface interface-type interface-number
Step 4 Run:
vrrp vrid virtual-router-id authentication-mode { simple { key | plain key | cipher cipher-key } | md5 md5-
key }
● Devices in a VRRP group must be configured with the same authentication mode and
authentication key; otherwise, the VRRP group cannot negotiate the Master and Backup
states.
● To ensure security, you are advised to use MD5 authentication.
----End
Context
The device allows user devices to ping a virtual IP address for the following
purposes:
● Monitoring the operating status of the master in a VRRP group
● Ensuring the reachable route between a user device and a network connected
through a default gateway that uses the virtual IP address
NOTICE
Procedure
Step 1 Run:
system-view
Step 2 Run:
vrrp virtual-ip ping enable
By default, the ping function is enabled, and the master in a VRRP group responds
to ping packets sent to the virtual IP address.
----End
Context
On a network where VRRP groups are configured, the master and backup cannot
communicate in real time during an active/standby switchover on the master
equipped with dual MPUs. When the master fails, the backup becomes the master.
When the original master recovers, it switches to the master again because its
priority is higher than the priority of the original backup. Because the system is
busy during the switchover, the master cannot send Hello packets and the backup
cannot receive packets immediately. In this case, the backup switches to the
master. Then a link switchover is performed, causing packet loss.
Enabling VRRP smooth switching on the switch equipped with dual MPUs can
optimize VRRP performance and reduce the impact on user traffic.
After VRRP smooth switching is enabled, the learning function takes precedence
over the preemption function. Therefore, the VRRP group status is not switched
and service traffic is not affected.
Procedure
Step 1 Run:
system-view
Step 2 Run:
vrrp timer-advertise learning enable
The device is enabled to learn the interval at which VRRP Advertisement packets
are sent.
Step 3 Run:
vrrp smooth-switching timer timer-value
VRRP smooth switching is enabled, and the interval carried in VRRP Advertisement
packets during VRRP smooth switching is configured.
By default, VRRP smooth switching is enabled and the interval contained in VRRP
Advertisement packets is 100s.
The learning function must be enabled before this command is run. When the
learning function is disabled, VRRP smooth switching is also disabled.
● When the backup is restarted, it resets the Master_Down_Interval timer after the
interface recovers. If the interval for sending VRRP Advertisement packets on the master
is much longer than the interval on the backup, the master may not send VRRP
Advertisement packets after the Master_Down_Interval timer expires. In this case, the
backup becomes the master, and two masters exist in the group.
● During VRRP smooth switching, the master sends VRRP Advertisement packets at the
configured interval. If the time for VRRP smooth switching (for example, 1s) is shorter
than the interval for sending VRRP Advertisement packets (for example 10s), VRRP
Advertisement packets are sent at intervals of 10s, and the interval contained in the
VRRP Advertisement packet is 1s. As a result, the VRRP group status frequently flaps.
----End
Procedure
● Run either of the following commands to check the VRRP group status and
parameters:
– display vrrp [ interface interface-type interface-number ] [ virtual-
router-id ] [ brief ]
– display vrrp { interface interface-type interface-number [ virtual-router-
id ] | virtual-router-id } verbose
● Run the display vrrp protocol-information command to check VRRP
information.
● Run the display vrrp [ interface interface-type interface-number ] [ virtual-
router-id ] statistics command to check statistics about sent and received
packets of the VRRP group.
----End
Pre-configuration Tasks
An mVRRP group can be bound to VRRP groups and determine the status of its
bound VRRP groups. mVRRP is used when multiple VRRP groups coexist. mVRRP
helps decrease the number of VRRP Advertisement packets to be sent and
minimize network bandwidth and system resource consumption.
Context
Each VRRP group needs to maintain its own state machine. Configuring an mVRRP
group reduces bandwidth occupied by VRRP Advertisement packets.
Procedure
1. Run:
system-view
3.7.2.2 Configuring a VRRP Group and Binding the VRRP Group to an mVRRP
Group
Context
You can bind VRRP groups to an mVRRP group so that mVRRP determines the
status of the bound VRRP groups.
Procedure
1. Run:
system-view
After a VRRP group is bound to an mVRRP group, VRRP Advertisement packets are not
sent periodically. MAC addresses are updated based on ARP Reply packets for
gratuitous ARP or from a gateway.
Procedure
● Run the display vrrp binding admin-vrrp [ interface interface-type1
interface-number1 ] [ vrid virtual-router-id1 ] member-vrrp [ interface
interface-type2 interface-number2 ] [ vrid virtual-router-id2 ] command to
check bindings between the mVRRP group and VRRP groups.
● Run the display vrrp binding admin-vrrp [ interface interface-type1
interface-number1 ] [ vrid virtual-router-id ] member-interface [ interface
interface-type2 interface-number2 ] command to check the bindings between
the mVRRP group and VRRP-enabled interfaces.
● Run the display vrrp admin-vrrp command to check the status of all mVRRP
groups.
----End
Pre-configuration Tasks
VRRP association enables VRRP to detect faults in a timely manner and triggers an
active/standby switchover when the master or the uplink of the master becomes
Context
When a VRRP group becomes faulty, the backup with the highest priority detects
the fault and becomes the master after the Master_Down_Interval timer expires.
The switchover period lasts at least 3s. During this period, service traffic is still
sent to the original master, causing user traffic loss. In Figure 3-12, the VRRP
group is associated with a BFD session on the backup so that the BFD session can
rapidly detect communication faults of the VRRP group. If the BFD session detects
a fault, it immediately notifies the VRRP group that the priority of the backup
needs to be increased, and an active/standby switchover is triggered. This
millisecond-level switchover reduces traffic loss.
When the fault is rectified, the priority of the backup is restored and the original
master becomes the master again to forward traffic.
● A VRRP group can be associated with only a static BFD session or a static BFD session
with automatically negotiated discriminators.
● The master and backup in the VRRP group must work in preemption mode. It is
recommended that the preemption delay be 0 on the backup and nonzero on the
master.
● Multiple VRRP groups can monitor a BFD session, and a VRRP group can monitor a
maximum of eight BFD sessions simultaneously.
Figure 3-12 Association between VRRP and BFD to implement a rapid active/
standby switchover
Master
SwitchA
HostA
Switch
Internet
HostB
SwitchB
Backup
VRRP BFD packets
Procedure
Step 1 Configure a static BFD session or a static BFD session with automatically
negotiated discriminators. For details, see 2.7.1 Configuring Single-Hop BFD,
2.7.2 Configuring Multi-Hop BFD, and 2.7.3 Configuring Static BFD with
Automatically Negotiated Discriminators.
Step 2 Run:
system-view
The view of the interface on the backup where a VRRP group is configured is
displayed.
Step 4 (Optional) On an Ethernet interface, run:
undo portswitch
When associating a VRRP group with a BFD session, note the following points:
● If session-name bfd-configure-name is specified, the VRRP group can be bound to
only the static BFD session with automatically negotiated discriminators.
● If bfd-session-id is specified, the VRRP group can be bound to only the static BFD
session.
● After the value by which the priority increases is set, ensure that the priority of the
backup is higher than the priority of the master.
----End
Context
When the uplink interface of the master becomes faulty, VRRP cannot detect the
status change of interfaces outside the VRRP group, causing service interruption.
You can associate a VRRP group with the interface status. When the monitored
interface becomes faulty, the priority of the master is reduced. This triggers an
active/standby switchover and reduces the impact of the uplink interface fault on
service forwarding.
When the fault is rectified, the original master restores its priority to become the
master again and begins forwarding traffic.
The master and backup in the VRRP group must work in preemption mode. It is
recommended that the preemption delay be 0 on the backup and nonzero on the master.
Procedure
Step 1 Run:
system-view
Step 2 Run:
interface interface-type interface-number
The view of the interface on the master where a VRRP group is configured is
displayed.
Step 4 Run:
vrrp vrid virtual-router-id track interface interface-type interface-number [ increased value-increased |
reduced value-reduced ]
A VRRP group can monitor a total of eight BFD sessions and interfaces
simultaneously.
● After the value by which the priority decreases is set, ensure that the priority of the
backup is higher than the priority of the master.
● You can configure a VRRP group to monitor a maximum of eight interfaces on a device.
If the device is an IP address owner, the interfaces cannot be monitored.
----End
Context
Because VRRP cannot detect faults on the uplink of a VRRP group, services may be
interrupted. As shown in Figure 3-13, a VRRP group is associated with a BFD
session on the master so that the BFD session monitors the uplink status of the
master. If the BFD session detects a fault on the uplink, it immediately notifies the
VRRP group that the priority of the master needs to be decreased, and an active/
standby switchover is triggered. This reduces the impact of the uplink fault on
service forwarding.
When the fault is rectified, the original master restores its priority to become the
master again and begins forwarding traffic.
BFD implements millisecond-level detection. Association between VRRP and BFD
provides a rapid active/standby switchover.
● A VRRP group can be associated with only a static BFD session or a static BFD session
with automatically negotiated discriminators.
● The master and backup in the VRRP group must work in preemption mode. It is
recommended that the preemption delay be 0 on the backup and nonzero on the
master.
● Multiple VRRP groups can monitor a BFD session, and a VRRP group can monitor a
maximum of eight BFD sessions simultaneously.
Internet
RouterE
HostB SwitchB SwitchD
Backup
VRRP BFD packets
Procedure
Step 1 Configure a static BFD session or a static BFD session with automatically
negotiated discriminators. For details, see 2.7.1 Configuring Single-Hop BFD,
2.7.2 Configuring Multi-Hop BFD, and 2.7.3 Configuring Static BFD with
Automatically Negotiated Discriminators.
Step 2 Run:
system-view
The view of the interface on the master where a VRRP group is configured is
displayed.
Step 4 (Optional) On an Ethernet interface, run:
undo portswitch
Step 5 Run:
vrrp vrid virtual-router-id track bfd-session { bfd-session-id | session-name bfd-configure-name }
[ increased value-increased | reduced value-reduced ]
By default, when the monitored BFD session becomes Down, the VRRP priority
decreases by 10.
When associating a VRRP group with a BFD session, note the following points:
● If session-name bfd-configure-name is specified, the VRRP group can be bound to
only the static BFD session with automatically negotiated discriminators.
● If bfd-session-id is specified, the VRRP group can be bound to only the static BFD
session.
● After a VRRP group is associated with a BFD session, the BFD session type cannot be
modified. Before deleting the BFD session type, you must delete all original
configurations.
● After the value by which the priority decreases is set, ensure that the priority of the
backup is higher than the priority of the master.
----End
Context
Because VRRP cannot detect faults on the uplink of a VRRP group, services may be
interrupted. You can associate a VRRP group with an NQA test instance on the
master so that the NQA test instance monitors the uplink status of the master. If
the NQA test instance detects a fault on the uplink, it immediately notifies the
VRRP group that the priority of the master needs to be decreased, and an active/
standby switchover is triggered. This reduces the impact of the uplink fault on
service forwarding.
When the fault is rectified, the original master restores its priority to become the
master again and begins forwarding traffic.
NQA technology collects statistics on the delay, jitter, and packet loss ratio. You
can configure the percentage of failed NQA test instances and NQA association to
trigger an active/standby switchover when the uplink is unstable.
● A VRRP group can only be associated with an NQA ICMP test instance.
● The master and backup in the VRRP group must work in preemption mode. It is
recommended that the preemption delay be 0 on the backup and nonzero on the
master.
Procedure
Step 1 Create an NQA ICMP test instance. For details, see Configuring an ICMP Test
Instance.
Step 2 Run:
system-view
Step 3 Run:
interface interface-type interface-number
The view of the interface on the master where a VRRP group is configured is
displayed.
Step 5 Run:
vrrp vrid virtual-router-id track nqa admin-name test-name [ reduced value-reduced ]
By default, if the associated NQA test instance fails, the priority of the device
decreases by 10.
When setting the value by which the priority decreases, ensure that the priority of the
backup is higher than the priority of the master in order to trigger an active/standby
switchover.
----End
Context
Because VRRP cannot detect faults on the uplink of a VRRP group, services may be
interrupted. The VRRP group monitors the number of routes on the uplink
forwarding path. When the route is withdrawn or becomes inactive, the master's
priority is adjusted and an active/standby switchover is performed. This reduces
the effect of a link fault on service forwarding.
When the fault is rectified, the original master restores its priority to become the
master again and begins forwarding traffic.
● When a VRRP group is associated with a static route, the device can detect only faults
on the direct uplink.
● The master and backup in the VRRP group must work in preemption mode. It is
recommended that the preemption delay be 0 on the backup and nonzero on the
master.
Procedure
Step 1 Run:
system-view
Step 2 Run:
interface interface-type interface-number
The view of the interface on the master where a VRRP group is configured is
displayed.
Step 4 Run:
vrrp vrid virtual-router-id track ip route ip-address { mask-address | mask-length } [ vpn-instance vpn-
instance-name ] [ reduced value-reduced ]
When setting the value by which the priority decreases, ensure that the priority of
the backup is higher than the priority of the master.
----End
Procedure
● Run either of the following commands to check the VRRP group status and
parameters:
– display vrrp [ interface interface-type interface-number ] [ virtual-
router-id ] [ brief ]
– display vrrp { interface interface-type interface-number [ virtual-router-
id ] | virtual-router-id } verbose
● Run the display vrrp protocol-information command to check VRRP
information.
Context
VRRP6 virtualizes multiple devices into one gateway without changing the
networking, and uses the virtual gateway's IP address as the default gateway
address to implement next-hop gateway backup. After a VRRP6 group is
configured, traffic is forwarded through the master. When the master fails, a new
master is selected among backups to forward traffic. This ensures device-level
reliability.
If load balancing is required in addition to gateway backup, configure two or more
VRRP6 groups on an interface in single-gateway load balancing mode or multi-
gateway load balancing mode.
Procedure
Step 1 Create a VRRP6 group working in active/standby mode.
1. Run:
system-view
5. Run:
ipv6 enable
A VRRP6 group is created, and a virtual IPv6 address is assigned to the VRRP6
group.
By default, no VRRP6 group is created.
The first virtual IPv6 address of a VRRP6 group must be a link-local address.
Step 2 Create VRRP6 groups working in multi-gateway load balancing mode.
If VRRP6 groups need to work in multi-gateway load balancing mode, repeat the
Create a VRRP6 group working in master/backup mode steps to configure two
or more VRRP6 groups on the interface and assign different VRIDs to them.
----End
Context
Devices with higher priorities in a VRRP6 group are more likely to become the
master. You can specify the master to forward traffic by setting device priorities.
Procedure
Step 1 Run:
system-view
● Priority 0 is reserved in the system. Priority 255 is reserved for the IP address
owner. The configurable priority ranges from 1 to 254.
● The priority of an IP address owner is fixed at 255 and cannot be manually
changed. You can run the vrrp vrid virtual-router-id priority priority-value
command to change the priority of an IP address owner, but the configured
priority does not take effect. If a VRRP device is no longer an IP address
owner, the configured priority is used.
● When devices in a VRRP6 group have the same priority and attempt to be the
master simultaneously, the device where the interface with the largest IP
address resides becomes the master. The device that first enters the Master
state becomes the master, and other backups remain unchanged.
----End
Context
On an unstable network, if the BFD session status monitored by a VRRP6 group
flaps frequently or the backups cannot receive VRRP6 Advertisement packets
within a specified period, an active/standby switchover is performed, which causes
network flapping. The VRRP6 preemption mode and preemption delay can be
configured on the switch to enhance the stability of the master and backup.
You are advised to set the preemption delay of the backup in a VRRP6 group to 0, configure
the master in preemption mode, and set the preemption delay. On an unstable network,
these settings allow a period of time for status synchronization between the uplink and
downlink. If the preceding settings are not used, two masters may coexist and users' devices
may learn the incorrect address of the master.
Procedure
● Configure non-preemption for the VRRP6 group on the switch.
a. Run:
system-view
Context
You can set VRRP6 time parameters as needed. Table 3-7 lists applicable
scenarios.
Procedure
● Set the interval at which VRRP6 Advertisement packets are sent.
a. Run:
system-view
If devices in a VRRP6 group use different intervals, VRRP6 may not work.
● Set the interval at which ND packets are sent by the master.
a. Run:
system-view
The interval at which the master sends ND packets must be shorter than
the aging time of ND entries on each user device.
● After this command is used, all VRRP6 groups on the device are configured
with the same delay.
● When the device in a VRRP6 group restarts, VRRP6 status flapping may occur.
It is recommended that the delay be set based on actual networking.
----End
Context
The system checks the TTL value in received VRRP6 Advertisement packets, and
discards VRRP6 Advertisement packets with TTL values other than 255. On a
network where devices of different vendors are deployed, if TTL check is enabled
on the device, the device may incorrectly discard valid packets. In this case, disable
TTL check so that devices of different vendors can communicate.
Procedure
Step 1 Run:
system-view
The device is configured not to check the TTL value in VRRP6 Advertisement
packets.
By default, the system checks the TTL value in VRRP6 Advertisement packets.
----End
Context
The device allows user devices to ping a virtual IP address for the following
purposes:
● Monitoring the operating status of the master in a VRRP group
● Ensuring the reachable route between a user device and a network connected
through a default gateway that uses the virtual IP address
NOTICE
Procedure
Step 1 Run:
system-view
By default, the ping function is enabled, and the master in a VRRP group responds
to ping packets sent to the virtual IP address.
----End
Context
On a network where VRRP groups are configured, the master and backup cannot
communicate in real time during an active/standby switchover on the master
equipped with dual MPUs. When the master fails, the backup becomes the master.
When the original master recovers, it switches to the master again because its
priority is higher than the priority of the original backup. Because the system is
busy during the switchover, the master cannot send Hello packets and the backup
cannot receive packets immediately. In this case, the backup switches to the
master. Then a link switchover is performed, causing packet loss.
Enabling VRRP smooth switching on the switch equipped with dual MPUs can
optimize VRRP performance and reduce the impact on user traffic.
After VRRP smooth switching is enabled, the learning function takes precedence
over the preemption function. Therefore, the VRRP group status is not switched
and service traffic is not affected.
Procedure
Step 1 Run:
system-view
Step 2 Run:
vrrp timer-advertise learning enable
The device is enabled to learn the interval at which VRRP Advertisement packets
are sent.
Step 3 Run:
vrrp smooth-switching timer timer-value
VRRP smooth switching is enabled, and the interval carried in VRRP Advertisement
packets during VRRP smooth switching is configured.
By default, VRRP smooth switching is enabled and the interval contained in VRRP
Advertisement packets is 100s.
The learning function must be enabled before this command is run. When the
learning function is disabled, VRRP smooth switching is also disabled.
● When the backup is restarted, it resets the Master_Down_Interval timer after the
interface recovers. If the interval for sending VRRP Advertisement packets on the master
is much longer than the interval on the backup, the master may not send VRRP
Advertisement packets after the Master_Down_Interval timer expires. In this case, the
backup becomes the master, and two masters exist in the group.
● During VRRP smooth switching, the master sends VRRP Advertisement packets at the
configured interval. If the time for VRRP smooth switching (for example, 1s) is shorter
than the interval for sending VRRP Advertisement packets (for example 10s), VRRP
Advertisement packets are sent at intervals of 10s, and the interval contained in the
VRRP Advertisement packet is 1s. As a result, the VRRP group status frequently flaps.
----End
Procedure
● Run the display vrrp6 [ interface interface-type interface-number ] [ vrid
virtual-router-id ] [ brief ] command to check the VRRP6 group status and
parameters.
● Run the display vrrp6 [ interface interface-type interface-number ] [ vrid
virtual-router-id ] statistics command to check statistics about sent and
received packets of the VRRP6 group.
----End
Pre-configuration Tasks
An mVRRP6 group can be bound to VRRP6 groups and determine the status of its
bound VRRP6 groups. mVRRP6 is used when multiple VRRP6 groups coexist.
mVRRP6 helps decrease the number of VRRP6 Advertisement packets to be sent
and minimize network bandwidth and system resource consumption.
Before configuring basic functions of an mVRRP6 group, configure network layer
attributes of interfaces to ensure network connectivity.
Context
Each VRRP6 group needs to maintain its own state machine. Configuring an
mVRRP6 group reduces bandwidth occupied by VRRP6 Advertisement packets.
Procedure
Step 1 Run:
system-view
Step 2 Run:
interface interface-type interface-number
A VRRP6 group is created, and a virtual IPv6 address is assigned to the VRRP6
group.
By default, no VRRP6 group is created.
Step 5 Run:
admin-vrrp6 vrid virtual-router-id
----End
Context
You can bind VRRP6 groups to an mVRRP6 group so that mVRRP6 determines the
status of the bound VRRP6 groups.
Procedure
Step 1 Run:
system-view
A VRRP6 group is created, and a virtual IPv6 address is assigned to the VRRP6
group.
Because the mVRRP6 group determines the status of its member VRRP6 groups,
you do not need to set priorities for the member VRRP6 groups.
Step 5 Run:
vrrp6 vrid virtual-router-id1 track admin-vrrp6 interface interface-type interface-number vrid virtual-
router-id2 unflowdown
After the binding is complete, the state machine of the bound VRRP6 group
depends on the status of the mVRRP6 group. That is, the bound VRRP6 group
inherits the status of the mVRRP6 group, deletes its VRRP6 Advertisement packet
timeout timer, and stops sending or receiving VRRP6 Advertisement packets. A
VRRP6 group can be bound to only one mVRRP6 group.
----End
Procedure
● Run the display vrrp6 binding admin-vrrp6 [ interface interface-type1
interface-number1 ] [ vrid virtual-router-id1 ] member-vrrp [ interface
interface-type2 interface-number2 ] [ vrid virtual-router-id2 ] command to
check bindings between the mVRRP6 group and VRRP6 groups.
● Run the display vrrp6 admin-vrrp6 command to check the status of all
mVRRP groups.
----End
Pre-configuration Tasks
VRRP6 association enables VRRP6 to detect faults in a timely manner and triggers
an active/standby switchover when the master or the uplink of the master
becomes faulty. VRRP6 association optimizes VRRP6 switchover and enhances
network reliability.
Before configuring VRRP6 association, perform the task of 3.7.4 Configuring Basic
Functions of an IPv6 VRRP Group.
Context
You can associate a VRRP6 group with a BFD session. When the BFD session status
changes, BFD notifies the VRRP6 group. This process triggers a rapid active/
standby switchover.
Procedure
Step 1 Run:
system-view
Step 2 Run:
interface interface-type interface-number
Step 4 Run:
vrrp6 vrid virtual-router-id track bfd-session { session-id | session-name bfd-configure-name } [ increased
value-increased | reduced value-reduced ]
increased value-increased: specifies the value by which the priority increases when
the monitored BFD session becomes Down. The value is an integer that ranges
from 1 to 255. The value 255 is reserved for the IP address owner, so the
maximum value of value-increased is 254. This parameter is valid only when the
VRRP6 group is in Backup state.
reduced value-reduced: specifies the value by which the priority decreases when
the monitored BFD session becomes Down. The value is an integer that ranges
from 1 to 254. The lowest priority is 1. When the priority is decreased to 1, the
master sends a VRRP6 Advertisement packet with priority 0. The value 0 is
reserved. When the backup receives a VRRP6 Advertisement packet with priority 0,
the backup becomes the master immediately. By default, the value is 10.
When setting the value by which the priority increases or decreases, ensure that the backup
has higher priority than the master so that a rapid active/standby switchover is performed.
When associating a VRRP6 group with a BFD session, note the following points:
● If session-name bfd-configure-name is specified, the VRRP6 group can be bound to
only the static BFD session with automatically negotiated discriminators.
● If session-id is specified, the VRRP6 group can be bound to only the static BFD session.
Currently, the device supports only association between VRRP6 and BFD for IPv4.
----End
Context
When the uplink interface of the master becomes faulty, VRRP6 cannot detect the
status change of interfaces outside the VRRP6 group, causing service interruption.
You can associate a VRRP6 group with the interface status. When the monitored
interface becomes faulty, the priority of the master is reduced. This triggers an
active/standby switchover and reduces the impact of the uplink interface fault on
service forwarding.
When the fault is rectified, the original master restores its priority to become the
master again and begins forwarding traffic.
The master and backup in the VRRP6 group must work in preemption mode. It is
recommended that the preemption delay be 0 on the backup and nonzero on the master.
Procedure
Step 1 Run:
system-view
Step 2 Run:
interface interface-type interface-number
The view of the interface on the master where a VRRP6 group is configured is
displayed.
Step 4 Run:
vrrp6 vrid virtual-router-id track interface interface-type interface-number [ increased value-increased |
reduced value-reduced ]
If the IPv4 protocol status on the monitored interface configured with an IPv4 address
changes, the priority of the master is reduced. If the IPv6 protocol status on the monitored
interface configured with an IPv6 address changes, the VRRP6 group remains unchanged.
----End
Procedure
● Run the display vrrp6 [ interface interface-type interface-number ] [ vrid
virtual-router-id ] [ brief ] command to check the VRRP6 group status and
parameters.
● Run the display vrrp6 [ interface interface-type interface-number ] [ vrid
virtual-router-id ] statistics command to check statistics about sent and
received packets of the VRRP6 group.
----End
Context
During routine maintenance, you can run the following commands to view VRRP
Advertisement packet statistics and monitor the VRRP running status.
Procedure
● Run the display vrrp [ interface interface-type interface-number ] [ virtual-
router-id ] statistics command in any view to view statistics about sent and
received packets of a VRRP group.
● Run the display vrrp6 [ interface interface-type interface-number ] [ vrid
virtual-router-id ] statistics command in any view to view statistics about
sent and received packets of a VRRP6 group.
Context
Before recollecting statistics about VRRP Advertisement packets in a given period
of time, clear existing statistics.
NOTICE
The cleared statistics cannot be restored. Exercise caution when you run the reset
command.
Procedure
● Run the reset vrrp [ interface interface-type interface-number ] [ vrid
virtual-router-id ] statistics command in the user view to clear statistics
about a VRRP group.
Networking Requirements
In Figure 3-14, HostA is dual-homed to SwitchA and SwitchB through the switch.
To ensure nonstop service transmission, a VRRP group in active/standby mode
needs to be configured on SwitchA and SwitchB.
● The host uses SwitchA as the default gateway to connect to the Internet.
When SwitchA becomes faulty, SwitchB functions as the gateway. This
implements gateway backup.
● After SwitchA recovers, it switches to the master to transmit data after a
preemption delay of 20s.
Configuration Roadmap
The configuration roadmap is as follows:
1. Assign an IP address to each interface and configure a routing protocol to
ensure network connectivity.
2. Configure a VRRP group on SwitchA and SwitchB, set a higher priority for
SwitchA so that SwitchA functions as the master to forward traffic and set the
preemption delay to 20s on SwitchA, and set a lower priority for SwitchB so
that SwitchB functions as the backup.
Procedure
Step 1 Configure devices to ensure network connectivity.
# Assign an IP address to each interface. SwitchA is used as an example. The
configurations of SwitchB and SwitchC are similar to the configuration of SwitchA,
and are not mentioned here. For details, see the configuration files.
<Quidway> system-view
[Quidway] sysname SwitchA
[SwitchA] vlan batch 100 300
[SwitchA] interface gigabitethernet 1/0/1
[SwitchA-GigabitEthernet1/0/1] port hybrid pvid vlan 300
[SwitchA-GigabitEthernet1/0/1] port hybrid untagged vlan 300
[SwitchA-GigabitEthernet1/0/1] quit
[SwitchA] interface gigabitethernet 1/0/2
[SwitchA-GigabitEthernet1/0/2] port hybrid pvid vlan 100
[SwitchA-GigabitEthernet1/0/2] port hybrid untagged vlan 100
[SwitchA-GigabitEthernet1/0/2] quit
[SwitchA] interface vlanif 100
[SwitchA-Vlanif100] ip address 10.1.1.1 24
[SwitchA-Vlanif100] quit
[SwitchA] interface vlanif 300
[SwitchA-Vlanif300] ip address 192.168.1.1 24
[SwitchA-Vlanif300] quit
configuration of SwitchA, and are not mentioned here. For details, see the
configuration files.
[SwitchA] ospf 1
[SwitchA-ospf-1] area 0
[SwitchA-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255
[SwitchA-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255
[SwitchA-ospf-1-area-0.0.0.0] quit
[SwitchA-ospf-1] quit
# Run the display vrrp command on SwitchB to view the VRRP status. The
command output shows that SwitchB is in Master state.
[SwitchB] display vrrp
Vlanif100 | Virtual Router 1
State : Master
Virtual IP : 10.1.1.111
Master IP : 10.1.1.2
PriorityRun : 100
PriorityConfig : 100
MasterPriority : 100
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
# After 20s, run the display vrrp command on SwitchA to view the VRRP status.
SwitchA restores to be in Master state.
[SwitchA] display vrrp
Vlanif100 | 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-01-12 20:15:46
Last change time : 2012-01-12 20:20:56
----End
Configuration Files
● SwitchA configuration file
#
sysname SwitchA
#
vlan batch 100 300
#
interface Vlanif100
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
#
interface Vlanif300
ip address 192.168.1.1 255.255.255.0
#
interface GigabitEthernet1/0/1
port hybrid pvid vlan 300
port hybrid untagged vlan 300
#
interface GigabitEthernet1/0/2
port hybrid pvid vlan 100
port hybrid untagged vlan 100
#
ospf 1
area 0.0.0.0
network 10.1.1.0 0.0.0.255
network 192.168.1.0 0.0.0.255
#
return
#
vlan batch 100 200
#
interface Vlanif100
ip address 10.1.1.2 255.255.255.0
vrrp vrid 1 virtual-ip 10.1.1.111
#
interface Vlanif200
ip address 192.168.2.1 255.255.255.0
#
interface GigabitEthernet1/0/1
port hybrid pvid vlan 200
port hybrid untagged vlan 200
#
interface GigabitEthernet1/0/2
port hybrid pvid vlan 100
port hybrid untagged vlan 100
#
ospf 1
area 0.0.0.0
network 10.1.1.0 0.0.0.255
network 192.168.2.0 0.0.0.255
#
return
● SwitchC configuration file
#
sysname SwitchC
#
vlan batch 200 300 400
#
interface Vlanif200
ip address 192.168.2.2 255.255.255.0
#
interface Vlanif300
ip address 192.168.1.2 255.255.255.0
#
interface Vlanif400
ip address 172.16.1.1 255.255.255.0
#
interface GigabitEthernet1/0/1
port hybrid pvid vlan 300
port hybrid untagged vlan 300
#
interface GigabitEthernet1/0/2
port hybrid pvid vlan 200
port hybrid untagged vlan 200
#
interface GigabitEthernet1/0/3
port hybrid pvid vlan 400
port hybrid untagged vlan 400
#
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
● Switch configuration file
#
sysname Switch
#
vlan batch 100
#
interface GigabitEthernet1/0/1
port hybrid pvid vlan 100
port hybrid untagged vlan 100
#
interface GigabitEthernet1/0/2
port hybrid pvid vlan 100
port hybrid untagged vlan 100
#
return
Networking Requirements
In Figure 3-15, HostA and HostC are dual-homed to SwitchA and SwitchB through
the switch. To reduce the load of data traffic on SwitchA, HostA uses SwitchA as
the default gateway to connect to the Internet, and SwitchB functions as the
backup gateway. HostC uses SwitchB as the default gateway to connect to the
Internet, and SwitchA functions as the backup gateway. This implements load
balancing.
Figure 3-15 Networking diagram for configuring a VRRP group in load balancing
mode
VRRP VRID 1 SwitchA
Virtual IP address: VRID 1: Master
10.1.1.111 VRID 2: Backup
GE1/0/1
HostA 192.168.1.1/24
10.1.1.100/24
GE1/0/2 GE1/0/1
GE1/0/1 10.1.1.1/24 192.168.1.2/24
Switch GE1/0/3 Internet
SwitchC 172.16.1.1/24
GE1/0/2 GE1/0/2 GE1/0/2
10.1.1.2/24 192.168.2.2/24
HostC GE1/0/1
10.1.1.101/24 192.168.2.1/24
SwitchB
VRID 1: Backup
VRRP VRID 2 VRID 2: Master
Virtual IP address:
10.1.1.112
Configuration Roadmap
The configuration roadmap is as follows:
1. Assign an IP address to each interface and configure a routing protocol to
ensure network connectivity.
2. Create VRRP groups 1 and 2 on SwitchA and SwitchB. In VRRP group 1,
configure SwitchA as the master and SwitchB as the backup. In VRRP group 2,
configure SwitchB as the master and SwitchA as the backup.
Procedure
Step 1 Configure devices to ensure network connectivity.
# Assign an IP address to each interface. SwitchA is used as an example. The
configurations of SwitchB and SwitchC are similar to the configuration of SwitchA,
and are not mentioned here. For details, see the configuration files.
<Quidway> system-view
[Quidway] sysname SwitchA
[SwitchA] vlan batch 100 300
[SwitchA] interface gigabitethernet 1/0/1
[SwitchA-GigabitEthernet1/0/1] port hybrid pvid vlan 300
[SwitchA-GigabitEthernet1/0/1] port hybrid untagged vlan 300
[SwitchA-GigabitEthernet1/0/1] quit
[SwitchA] interface gigabitethernet 1/0/2
[SwitchA-GigabitEthernet1/0/2] port hybrid pvid vlan 100
[SwitchA-GigabitEthernet1/0/2] port hybrid untagged vlan 100
[SwitchA-GigabitEthernet1/0/2] quit
[SwitchA] interface vlanif 100
[SwitchA-Vlanif100] ip address 10.1.1.1 24
[SwitchA-Vlanif100] quit
[SwitchA] interface vlanif 300
[SwitchA-Vlanif300] ip address 192.168.1.1 24
[SwitchA-Vlanif300] quit
[SwitchA] ospf 1
[SwitchA-ospf-1] area 0
[SwitchA-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255
[SwitchA-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255
[SwitchA-ospf-1-area-0.0.0.0] quit
[SwitchA-ospf-1] quit
# Configure VRRP group 2 on SwitchA and SwitchB, set the priority of SwitchB to
120 and the preemption delay to 20s, and set the default priority for SwitchA.
[SwitchB] interface vlanif 100
[SwitchB-Vlanif100] vrrp vrid 2 virtual-ip 10.1.1.112
[SwitchB-Vlanif100] vrrp vrid 2 priority 120
[SwitchB-Vlanif100] vrrp vrid 2 preempt-mode timer delay 20
[SwitchB-Vlanif100] quit
[SwitchA] interface vlanif 100
[SwitchA-Vlanif100] vrrp vrid 2 virtual-ip 10.1.1.112
[SwitchA-Vlanif100] quit
# After the configuration is complete, run the display vrrp command on SwitchB.
You can see that SwitchB is the backup in VRRP group 1 and the master in VRRP
group 2.
[SwitchB] display vrrp
Vlanif100 | 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-01-12 20:15:46
Last change time : 2012-01-12 20:15:46
----End
Configuration Files
● SwitchA configuration file
#
sysname SwitchA
#
vlan batch 100 300
#
interface Vlanif100
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
#
interface Vlanif300
ip address 192.168.1.1 255.255.255.0
#
interface GigabitEthernet1/0/1
port hybrid pvid vlan 300
port hybrid untagged vlan 300
#
interface GigabitEthernet1/0/2
port hybrid pvid vlan 100
port hybrid untagged vlan 100
#
ospf 1
area 0.0.0.0
network 10.1.1.0 0.0.0.255
network 192.168.1.0 0.0.0.255
#
return
● SwitchB configuration file
#
sysname SwitchB
#
vlan batch 100 200
#
interface Vlanif100
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
#
interface Vlanif200
ip address 192.168.2.1 255.255.255.0
#
interface GigabitEthernet1/0/1
port hybrid pvid vlan 200
port hybrid untagged vlan 200
#
interface GigabitEthernet1/0/2
port hybrid pvid vlan 100
port hybrid untagged vlan 100
#
ospf 1
area 0.0.0.0
network 10.1.1.0 0.0.0.255
network 192.168.2.0 0.0.0.255
#
return
● SwitchC configuration file
#
sysname SwitchC
#
vlan batch 200 300 400
#
interface Vlanif200
ip address 192.168.2.2 255.255.255.0
#
interface Vlanif300
ip address 192.168.1.2 255.255.255.0
#
interface Vlanif400
ip address 172.16.1.1 255.255.255.0
#
interface GigabitEthernet1/0/1
port hybrid pvid vlan 300
port hybrid untagged vlan 300
#
interface GigabitEthernet1/0/2
port hybrid pvid vlan 200
port hybrid untagged vlan 200
#
interface GigabitEthernet1/0/3
Networking Requirements
In Figure 3-16, hosts on a LAN are dual-homed to SwitchA and SwitchB through
the switch. A VRRP group is established on SwitchA and SwitchB, and SwitchA is
the master.
If SwitchA or a link between SwitchA and SwitchB becomes faulty, VRRP
Advertisement packet negotiation takes time. To implement a rapid active/standby
switchover, deploy a BFD session on the link and associate the VRRP group with
the BFD session. When the primary interface on the master or the link fails, the
BFD session rapidly detects the fault and notifies the VRRP group of it. The VRRP
group then performs a rapid active/standby switchover. The backup becomes the
Master and takes over traffic forwarding. This reduces the impact of the fault on
service transmission.
Figure 3-16 Association between VRRP and BFD to implement a rapid active/
standby switchover
VRRP VRID 1
Virtual IP Address:
10.1.1.3/24 GE1/0/1
Master
VLANIF100 SwitchA
10.1.1.1/24
HostA
GE1/0/1
Switch Internet
GE1/0/2
HostB GE1/0/1
VLANIF100 SwitchB
10.1.1.2/24 Backup BFD packets
Configuration Roadmap
Association between a VRRP group and a BFD session is used to implement a
rapid active/standby switchover. The configuration roadmap is as follows:
1. Assign an IP address to each interface and configure a routing protocol to
ensure network connectivity.
2. Configure a VRRP group on SwitchA and SwitchB. SwitchA functions as the
master, its priority is 120, and the preemption delay is 20s. SwitchB functions
as the backup and uses the default priority.
3. Configure a static BFD session on SwitchA and SwitchB to monitor the link of
the VRRP group.
4. Configure association between VRRP and BFD on SwitchB to implement a
rapid active/standby switchover when the link is faulty.
Procedure
Step 1 Configure devices to ensure network connectivity.
# Assign an IP address to each interface. SwitchA is used as an example. The
configuration of SwitchB is similar to the configuration of SwitchA, and is not
mentioned here. For details, see the configuration files.
<Quidway> system-view
[Quidway] sysname SwitchA
[SwitchA] vlan 100
[SwitchA-vlan100] quit
[SwitchA] interface gigabitethernet 1/0/1
[SwitchA-GigabitEthernet1/0/1] port hybrid pvid vlan 100
[SwitchA-GigabitEthernet1/0/1] port hybrid untagged vlan 100
[SwitchA-GigabitEthernet1/0/1] quit
[SwitchA] interface vlanif 100
[SwitchA-Vlanif100] ip address 10.1.1.1 24
[SwitchA-Vlanif100] quit
Run the display bfd session command on SwitchA and SwitchB. You can see that
the BFD session is Up. The display on SwitchA is used as an example.
[SwitchA] display bfd session all
--------------------------------------------------------------------------------
# After 20s, run the display vrrp command on SwitchA and SwitchB. You can see
that SwitchA restores to be the master and SwitchB the backup, and the
associated BFD session is in Up state.
[SwitchA] display vrrp
Vlanif100 | Virtual Router 1
State : Master
Virtual IP : 10.1.1.3
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-01-12 20:15:46
Last change time : 2012-01-12 20:15:46
[SwitchB] display vrrp
Vlanif100 | Virtual Router 1
State : Backup
Virtual IP : 10.1.1.3
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
Track BFD : 2 Priority increased : 40
BFD-session state : UP
Create time : 2012-01-12 20:15:46
Last change time : 2012-01-12 20:15:46
----End
Configuration Files
● SwitchA configuration file
#
sysname SwitchA
#
vlan batch 100
#
bfd
#
interface Vlanif100
ip address 10.1.1.1 255.255.255.0
vrrp vrid 1 virtual-ip 10.1.1.3
vrrp vrid 1 priority 120
vrrp vrid 1 preempt-mode timer delay 20
#
interface GigabitEthernet1/0/1
port hybrid pvid vlan 100
port hybrid untagged vlan 100
#
bfd atob bind peer-ip 10.1.1.2 interface Vlanif100
discriminator local 1
discriminator remote 2
min-tx-interval 100
min-rx-interval 100
commit
#
ospf 1
area 0.0.0.0
network 10.1.1.0 0.0.0.255
#
return
Networking Requirements
In Figure 3-17, hosts on a LAN are dual-homed to SwitchA and SwitchB through
the switch. A VRRP group is established on SwitchA and SwitchB, and SwitchA is
the master. Generally, SwitchA functions as the gateway and user traffic is along
the path Switch -> SwitchA -> SwitchC -> SwitchE.
When the link between SwitchC and SwitchE becomes faulty, the VRRP group is
required to be able to detect the fault. Then an active/standby switchover is
performed rapidly andSwitchB takes over services. This reduces the impact of the
link fault on service forwarding.
Figure 3-17 Association between VRRP and NQA to monitor the uplink status
GE1/0/2
192.168.1.1/24
VRRP VRID 1 Master
Virtual IP address: SwitchA SwitchC
GE1/0/1 GE1/0/2
10.1.1.10
192.168.1.2/24 172.16.1.1/24
GE1/0/1
GE1/0/1 172.16.1.2/24
GE1/0/0
10.1.1.1/24
SwitchE Internet
GE1/0/1
Switch 10.1.1.2/24 GE1/0/1 GE1/0/2
GE2/0/0
192.168.2.2/24 172.16.2.2/24
GE1/0/2
SwitchB 172.16.2.1/24
SwitchD
Backup
GE1/0/2
HostA 192.168.2.1/24 NQA packets
Configuration Roadmap
The configuration roadmap is as follows:
Procedure
Step 1 Configure devices to ensure network connectivity.
# Assign an IP address to each interface. SwitchA is used as an example. The
configurations of SwitchB, SwitchC, SwitchD, and SwitchE are similar to the
configuration of SwitchA, and are not mentioned here. For details, see the
configuration files.
<Quidway> system-view
[Quidway] sysname SwitchA
[SwitchA] vlan batch 100 300
[SwitchA] interface gigabitethernet 1/0/1
[SwitchA-GigabitEthernet1/0/1] port link-type trunk
[SwitchA-GigabitEthernet1/0/1] port trunk allow-pass vlan 100
[SwitchA-GigabitEthernet1/0/1] port trunk pvid vlan 100
[SwitchA-GigabitEthernet1/0/1] undo port trunk allow-pass vlan 1
[SwitchA-GigabitEthernet1/0/1] quit
[SwitchA] interface gigabitethernet 1/0/2
[SwitchA-GigabitEthernet1/0/2] port link-type trunk
[SwitchA-GigabitEthernet1/0/2] port trunk allow-pass vlan 300
[SwitchA-GigabitEthernet1/0/2] quit
[SwitchA] interface vlanif 100
[SwitchA-Vlanif100] ip address 10.1.1.1 24
[SwitchA-Vlanif100] quit
[SwitchA] interface vlanif 300
[SwitchA-Vlanif300] ip address 192.168.1.1 24
[SwitchA-Vlanif300] quit
# Run the display nqa results test-instance user test command on SwitchA. The
command output shows that the NQA test instance status is success.
[SwitchA] display nqa results test-instance user test
NQA entry(user, test) :testflag is active ,testtype is icmp
1 . Test 1 result The test is finished
Send operation times: 3 Receive response times: 2
Completion:success RTD OverThresholds number: 0
Attempts number:1 Drop operation number:0
Disconnect operation number:0 Operation timeout number:1
System busy operation number:0 Connection fail number:0
Operation sequence errors number:0 RTT Status errors number:0
Destination ip address:172.16.1.2
Min/Max/Average Completion Time: 6/6/6
Sum/Square-Sum Completion Time: 12/72
Last Good Probe Time: 2012-05-22 17:32:56.1
Lost packet ratio: 33 %
PriorityRun : 120
PriorityConfig : 120
MasterPriority : 120
Preempt : YES Delay Time : 20 s
TimerRun :1s
TimerConfig :1s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Backup-forward : disabled
Track NQA : user test Priority reduced : 40
NQA state : success
Create time : 2012-05-22 17:32:56
Last change time : 2012-05-22 17:33:00
[SwitchB] display vrrp
Vlanif100 | Virtual Router 1
State : Backup
Virtual IP : 10.1.1.10
Master IP : 10.1.1.1
PriorityRun : 100
PriorityConfig : 100
MasterPriority : 120
Preempt : YES Delay Time : 0 s
TimerRun :1s
TimerConfig :1s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Backup-forward : disabled
Create time : 2012-05-22 17:33:00
Last change time : 2012-05-22 17:33:04
# Run the display vrrp command on SwitchA and SwitchB. You can see that
SwitchA is in Backup state, SwitchB becomes the master, and the NQA test
instance is failed.
[SwitchA] display vrrp
Vlanif100 | Virtual Router 1
State : Backup
Virtual IP : 10.1.1.10
Master IP : 10.1.1.2
PriorityRun : 80
PriorityConfig : 120
MasterPriority : 100
Preempt : YES Delay Time : 20 s
TimerRun :1s
TimerConfig :1s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Backup-forward : disabled
Track NQA : user test Priority reduced : 40
NQA state : failed
Create time : 2012-05-22 17:34:56
Last change time : 2012-05-22 17:35:00
[SwitchB] display vrrp
Vlanif100 | Virtual Router 1
State : Master
Virtual IP : 10.1.1.10
Master IP : 10.1.1.2
PriorityRun : 100
PriorityConfig : 100
MasterPriority : 100
Preempt : YES Delay Time : 0 s
TimerRun :1s
TimerConfig :1s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Backup-forward : disabled
Create time : 2012-05-22 17:35:00
Last change time : 2012-05-22 17:35:04
# After 20s, run the display vrrp command on SwitchA and SwitchB. You can see
that SwitchA restores to be the master and SwitchB the backup, and the
associated NQA test instance status is success.
[SwitchA] display vrrp
Vlanif100 | Virtual Router 1
State : Master
Virtual IP : 10.1.1.10
Master IP : 10.1.1.1
PriorityRun : 120
PriorityConfig : 120
MasterPriority : 120
Preempt : YES Delay Time : 20 s
TimerRun :1s
TimerConfig :1s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Backup-forward : disabled
Track NQA : user test Priority reduced : 40
NQA state : success
Create time : 2012-05-22 17:36:56
Last change time : 2012-05-22 17:37:00
[SwitchB] display vrrp
Vlanif100 | Virtual Router 1
State : Backup
Virtual IP : 10.1.1.10
Master IP : 10.1.1.1
PriorityRun : 100
PriorityConfig : 100
MasterPriority : 120
Preempt : YES Delay Time : 0 s
TimerRun :1s
TimerConfig :1s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Backup-forward : disabled
Create time : 2012-05-22 17:37:00
Last change time : 2012-05-22 17:37:04
----End
Configuration Files
● SwitchA configuration file
#
sysname SwitchA
#
vlan batch 100 300
#
interface Vlanif100
ip address 10.1.1.1 255.255.255.0
vrrp vrid 1 virtual-ip 10.1.1.10
vrrp vrid 1 priority 120
vrrp vrid 1 preempt-mode timer delay 20
vrrp vrid 1 track nqa user test reduced 40
#
interface Vlanif300
ip address 192.168.1.1 255.255.255.0
#
interface GigabitEthernet1/0/1
port link-type trunk
port trunk pvid vlan 100
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 100
#
interface GigabitEthernet1/0/2
port link-type trunk
port trunk allow-pass vlan 300
#
ospf 1
area 0.0.0.0
network 10.1.1.0 0.0.0.255
network 192.168.1.0 0.0.0.255
#
nqa test-instance user test
test-type icmp
destination-address ipv4 172.16.1.2
frequency 15
start now
#
return
#
sysname SwitchC
#
vlan batch 300 500
#
interface Vlanif300
ip address 192.168.1.2 255.255.255.0
#
interface Vlanif500
ip address 172.16.1.1 255.255.255.0
#
interface GigabitEthernet1/0/1
port link-type trunk
port trunk allow-pass vlan 300
#
interface GigabitEthernet1/0/2
port link-type trunk
port trunk allow-pass vlan 500
#
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
#
return
● SwitchD configuration file
#
sysname SwitchD
#
vlan batch 200 400
#
interface Vlanif200
ip address 192.168.2.2 255.255.255.0
#
interface Vlanif400
ip address 172.16.2.1 255.255.255.0
#
interface GigabitEthernet1/0/1
port link-type trunk
port trunk allow-pass vlan 200
#
interface GigabitEthernet1/0/2
port link-type trunk
port trunk allow-pass vlan 400
#
ospf 1
area 0.0.0.0
network 172.16.2.0 0.0.0.255
network 192.168.2.0 0.0.0.255
#
return
● SwitchE configuration file
#
sysname SwitchE
#
vlan batch 400 500
#
interface Vlanif400
ip address 172.16.2.2 255.255.255.0
#
interface Vlanif500
ip address 172.16.1.2 255.255.255.0
#
interface GigabitEthernet1/0/1
port link-type trunk
port trunk allow-pass vlan 500
#
interface GigabitEthernet1/0/2
Networking Requirements
As shown in Figure 3-18, hosts on a LAN are dual-homed to SwitchA and SwitchB
through the switch. A VRRP group is established on SwitchA and SwitchB, and
SwitchA is the master. SwitchA functions as the gateway and user traffic is
forwarded along the path Switch -> SwitchA -> SwitchC -> SwitchE.
When the route between SwitchC and SwitchE is withdrawn or becomes inactive,
the VRRP group is required to be able to detect the fault. Then an active/standby
switchover is performed rapidly and SwitchB takes over services. This reduces the
impact of the link fault on service forwarding.
Figure 3-18 Association between VRRP and routing to monitor the uplink status
GE1/0/2
192.168.1.1/24
VRRP VRID 1 Master
Virtual IP address: SwitchA SwitchC
GE1/0/1 GE1/0/2
10.1.1.10
192.168.1.2/24 172.16.1.1/24
GE1/0/1
GE1/0/0 GE1/0/1 172.16.1.2/24
10.1.1.1/24
SwitchE Internet
GE1/0/1
Switch 10.1.1.2/24 GE1/0/1 GE1/0/2
GE2/0/0
192.168.2.2/24 172.16.2.2/24
GE1/0/2
SwitchB SwitchD 172.16.2.1/24
Backup
GE1/0/2
HostA 192.168.2.1/24
Configuration Roadmap
The configuration roadmap is as follows:
Procedure
Step 1 Assign an IP address to each interface. SwitchA is used as an example. The
configurations of SwitchB, SwitchC, SwitchD, and SwitchE are similar to the
configuration of SwitchA, and are not mentioned here. For details, see the
configuration files.
<Quidway> system-view
[Quidway] sysname SwitchA
[SwitchA] vlan batch 100 300
[SwitchA] interface gigabitethernet 1/0/1
[SwitchA-GigabitEthernet1/0/1] port link-type trunk
[SwitchA-GigabitEthernet1/0/1] port trunk allow-pass vlan 100
[SwitchA-GigabitEthernet1/0/1] port trunk pvid vlan 100
[SwitchA-GigabitEthernet1/0/1] undo port trunk allow-pass vlan 1
[SwitchA-GigabitEthernet1/0/1] quit
[SwitchA] interface gigabitethernet 1/0/2
[SwitchA-GigabitEthernet1/0/2] port link-type trunk
[SwitchA-GigabitEthernet1/0/2] port trunk allow-pass vlan 300
[SwitchA-GigabitEthernet1/0/2] quit
[SwitchA] interface vlanif 100
[SwitchA-Vlanif100] ip address 10.1.1.1 24
[SwitchA-Vlanif100] quit
[SwitchA] interface vlanif 300
[SwitchA-Vlanif300] ip address 192.168.1.1 24
[SwitchA-Vlanif300] quit
# Configure VRRP group 1 on SwitchA, and set the priority of SwitchA to 120 and
the preemption delay to 20s.
[SwitchA] interface vlanif 100
[SwitchA-Vlanif100] vrrp vrid 1 virtual-ip 10.1.1.10
[SwitchA-Vlanif100] vrrp vrid 1 priority 120
[SwitchA-Vlanif100] vrrp vrid 1 preempt-mode timer delay 20
[SwitchA-Vlanif100] quit
Step 4 Configure IS-IS. SwitchA, SwitchC, and SwitchE are used as an example. The
configurations of SwitchB and SwitchD are similar to the configuration of SwitchA,
and are not mentioned here. For details, see the configuration files.
# Set the IS-IS NET of SwitchA to 10.0000.0000.0001.00, and set the IS-IS level to
1.
[SwitchA] isis 1
[SwitchA-isis-1] is-level level-1
[SwitchA-isis-1] network-entity 10.0000.0000.0001.00
[SwitchA-isis-1] quit
[SwitchA] interface vlanif 300
[SwitchA-Vlanif300] isis enable 1
[SwitchA-Vlanif300] quit
# Set the IS-IS NET of SwitchC to 10.0000.0000.0002.00, and set the IS-IS level to
1.
[SwitchC] isis 1
[SwitchC-isis-1] is-level level-1
[SwitchC-isis-1] network-entity 10.0000.0000.0002.00
[SwitchC-isis-1] quit
[SwitchC] interface vlanif 300
[SwitchC-Vlanif300] isis enable 1
[SwitchC-Vlanif300] quit
[SwitchC] interface vlanif 500
[SwitchC-Vlanif500] isis enable 1
[SwitchC-Vlanif500] quit
Step 5 Configure association between VRRP and routing on SwitchA. When the associated
route is withdrawn, the priority of SwitchA decreases by 40.
[SwitchA] interface vlanif 100
[SwitchA-Vlanif100] vrrp vrid 1 track ip route 172.16.1.0 24 reduced 40
[SwitchA-Vlanif100] quit
-------------------------------------------------------------------------------
172.16.1.0/24 20 NULL Vlanif300 192.168.1.2 A/-/-/-
192.168.1.0/24 10 NULL Vlanif300 Direct D/-/L/-
Flags: D-Direct, A-Added to URT, L-Advertised in LSPs, S-IGP Shortcut,
U-Up/Down Bit Set
# Run the display vrrp command on SwitchA and SwitchB. You can see that
SwitchA is the master, SwitchB is the backup, and the associated route is
reachable.
[SwitchA] display vrrp
Vlanif100 | Virtual Router 1
State : Master
Virtual IP : 10.1.1.10
Master IP : 10.1.1.1
PriorityRun : 120
PriorityConfig : 120
MasterPriority : 120
Preempt : YES Delay Time : 20 s
TimerRun :1s
TimerConfig :1s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Backup-forward : disabled
Track IP route : 172.16.1.0/24 Priority reduced : 40
IP route state : Reachable
Create time : 2012-05-29 21:25:47
Last change time : 2012-05-29 21:25:51
[SwitchB] display vrrp
Vlanif100 | Virtual Router 1
State : Backup
Virtual IP : 10.1.1.10
Master IP : 10.1.1.1
PriorityRun : 100
PriorityConfig : 100
MasterPriority : 120
Preempt : YES Delay Time : 0 s
TimerRun :1s
TimerConfig :1s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Backup-forward : disabled
Create time : 2012-05-29 21:25:47
Last change time : 2012-05-29 21:25:51
# Run the display isis route command on SwitchA. You can see that the route to
network segment 172.16.1.0/24 is withdrawn.
[SwitchA] display isis route
# Run the display vrrp command on SwitchA and SwitchB. You can see that
SwitchA is in Backup state, SwitchB is in Master state, and the associated route is
unreachable.
[SwitchA] display vrrp
Vlanif100 | Virtual Router 1
State : Backup
Virtual IP : 10.1.1.10
Master IP : 10.1.1.2
PriorityRun : 80
PriorityConfig : 120
MasterPriority : 100
Preempt : YES Delay Time : 20 s
TimerRun :1s
TimerConfig :1s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Backup-forward : disabled
Track IP route : 172.16.1.0/24 Priority reduced : 40
IP route state : Unreachable
Create time : 2012-05-29 21:25:47
Last change time : 2012-05-29 21:25:51
[SwitchB] display vrrp
Vlanif100 | Virtual Router 1
State : Master
Virtual IP : 10.1.1.10
Master IP : 10.1.1.2
PriorityRun : 100
PriorityConfig : 100
MasterPriority : 100
Preempt : YES Delay Time : 0 s
TimerRun :1s
TimerConfig :1s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Backup-forward : disabled
Create time : 2012-05-29 21:25:47
Last change time : 2012-05-29 21:25:51
# After 20s, run the display vrrp command on SwitchA and SwitchB. You can see
that SwitchA restores to be the master and SwitchB the backup, and the
associated route is reachable.
[SwitchA] display vrrp
Vlanif100 | Virtual Router 1
State : Master
Virtual IP : 10.1.1.10
Master IP : 10.1.1.1
PriorityRun : 120
PriorityConfig : 120
MasterPriority : 120
Preempt : YES Delay Time : 20 s
TimerRun :1s
TimerConfig :1s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
----End
Configuration Files
● SwitchA configuration file
#
sysname SwitchA
#
vlan batch 100 300
#
isis 1
is-level level-1
network-entity 10.0000.0000.0001.00
#
interface Vlanif100
ip address 10.1.1.1 255.255.255.0
vrrp vrid 1 virtual-ip 10.1.1.10
vrrp vrid 1 priority 120
vrrp vrid 1 preempt-mode timer delay 20
vrrp vrid 1 track ip route 172.16.1.0 255.255.255.0 reduced 40
#
interface Vlanif300
ip address 192.168.1.1 255.255.255.0
isis enable 1
#
interface GigabitEthernet1/0/1
port link-type trunk
port trunk pvid vlan 100
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 100
#
interface GigabitEthernet1/0/2
port link-type trunk
port trunk allow-pass vlan 300
#
return
#
isis 2
is-level level-1
network-entity 20.0000.0000.0001.00
#
interface Vlanif100
ip address 10.1.1.2 255.255.255.0
vrrp vrid 1 virtual-ip 10.1.1.10
#
interface Vlanif200
ip address 192.168.2.1 255.255.255.0
isis enable 2
#
interface GigabitEthernet1/0/1
port link-type trunk
port trunk pvid vlan 100
undo port trunk allow-pass vlan 1
port trunk allow-pass vlan 100
#
interface GigabitEthernet1/0/2
port link-type trunk
port trunk allow-pass vlan 200
#
return
● SwitchC configuration file
#
sysname SwitchC
#
vlan batch 300 500
#
isis 1
is-level level-1
network-entity 10.0000.0000.0002.00
#
interface Vlanif300
ip address 192.168.1.2 255.255.255.0
isis enable 1
#
interface Vlanif500
ip address 172.16.1.1 255.255.255.0
isis enable 1
#
interface GigabitEthernet1/0/1
port link-type trunk
port trunk allow-pass vlan 300
#
interface GigabitEthernet1/0/2
port link-type trunk
port trunk allow-pass vlan 500
#
return
● SwitchD configuration file
#
sysname SwitchD
#
vlan batch 200 400
#
isis 2
is-level level-1
network-entity 20.0000.0000.0002.00
#
interface Vlanif200
ip address 192.168.2.2 255.255.255.0
isis enable 2
#
interface Vlanif400
ip address 172.16.2.1 255.255.255.0
isis enable 2
#
interface GigabitEthernet1/0/1
port link-type trunk
port trunk allow-pass vlan 200
#
interface GigabitEthernet1/0/2
port link-type trunk
port trunk allow-pass vlan 400
#
return
1/0 /1
/2 1/0
GE
SwitchC MSTP Internet
GE1/0/2
GE
3
1 /0/SwitchC 1/0/4
G E
GE RouterB
HostB 1/0 /0 /3
/1 GE1
VLAN3
10.1.3.101/24 SwitchB
VRID 1:Backup
VRRP VRID 2 VRID 2:Master
Virtual IP Address:
10.1.3.100
MSTI1: MSTI2:
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure basic MSTP on the switches, including:
a. Configure MST and create multi-instance, map VLAN 2 to MSTI1, and
map VLAN 3 to MSTI2 to load balance traffic.
b. Configure the root bridge and backup bridge in the MST region.
c. Configure the path cost on an interface so that the interface can be
blocked.
d. Enable MSTP to prevent loops:
Procedure
Step 1 Configure basic MSTP functions.
1. Add SwitchA, SwitchB, and SwitchC to region RG1, and create instances MSTI1
and MSTI2.
# Configure an MST region on SwitchA.
<Quidway> system-view
[Quidway] sysname SwitchA
[SwitchA] stp region-configuration
[SwitchA-mst-region] region-name RG1
[SwitchA-mst-region] instance 1 vlan 2
[SwitchA-mst-region] instance 2 vlan 3
[SwitchA-mst-region] active region-configuration
[SwitchA-mst-region] quit
2. Configure the root bridges and backup bridges for MSTI1 and MSTI2 in RG1.
– Configure the root bridge and backup bridge for MSTI1.
# Set SwitchA as the root bridge of MSTI1.
[SwitchA] stp instance 1 root primary
3. Set the path costs of the interfaces that you want to block on MSTI1 and
MSTI2 to be greater than the default value.
– The path cost range is decided by the calculation method. The Huawei calculation
method is used as an example. Set the path costs of the interfaces to 20000.
– The switches on the same network must use the same calculation method to
calculate path costs.
# Set the path cost calculation method on SwitchA to Huawei calculation
method.
If edge ports are connected to network devices that have STP enabled and BPDU
protection is enabled, the edge ports will be shut down and their attributes
remain unchanged after they receive BPDUs.
Step 2 Enable the protection function on the designated interfaces of each root bridge.
After the preceding configurations are complete and the network topology
becomes stable, perform the following operations to verify the configuration.
MSTI 1 and MSTI 2 are used as examples. You do not need to focus on the interface status
in MSTI 0.
# Run the display stp brief command on SwitchA to view the status and
protection type on interfaces. The displayed information is as follows:
[SwitchA] display stp brief
MSTID Port Role STP State Protection
0 GigabitEthernet1/0/1 DESI FORWARDING ROOT
0 GigabitEthernet1/0/2 DESI FORWARDING NONE
1 GigabitEthernet1/0/1 DESI FORWARDING ROOT
1 GigabitEthernet1/0/2 DESI FORWARDING NONE
2 GigabitEthernet1/0/1 DESI FORWARDING ROOT
2 GigabitEthernet1/0/2 ROOT FORWARDING NONE
# Run the display stp brief command on SwitchB. The displayed information is as
follows:
[SwitchB] display stp brief
MSTID Port Role STP State Protection
0 GigabitEthernet1/0/1 DESI FORWARDING ROOT
0 GigabitEthernet1/0/2 ROOT FORWARDING NONE
1 GigabitEthernet1/0/1 DESI FORWARDING ROOT
1 GigabitEthernet1/0/2 ROOT FORWARDING NONE
2 GigabitEthernet1/0/1 DESI FORWARDING ROOT
2 GigabitEthernet1/0/2 DESI FORWARDING NONE
# Run the display stp interface brief command on SwitchC. The displayed
information is as follows:
[SwitchC] display stp interface gigabitethernet 1/0/1 brief
MSTID Port Role STP State Protection
0 GigabitEthernet1/0/1 ROOT FORWARDING NONE
1 GigabitEthernet1/0/1 ROOT FORWARDING NONE
2 GigabitEthernet1/0/1 ALTE DISCARDING NONE
[SwitchC] display stp interface gigabitethernet 1/0/4 brief
MSTID Port Role STP State Protection
0 GigabitEthernet1/0/4 ALTE DISCARDING NONE
1 GigabitEthernet1/0/4 ALTE DISCARDING NONE
2 GigabitEthernet1/0/4 ROOT FORWARDING NONE
# Run OSPF on SwitchA, SwitchB, and routers. The configurations on SwitchA are
used as an example. The configurations on SwitchB are similar to the
configurations on SwitchA. For details, see the configuration file.
[SwitchA] ospf 1
[SwitchA-ospf-1] area 0
[SwitchA-ospf-1-area-0.0.0.0] network 10.1.2.0 0.0.0.255
[SwitchA-ospf-1-area-0.0.0.0] network 10.1.3.0 0.0.0.255
[SwitchA-ospf-1-area-0.0.0.0] network 10.1.4.0 0.0.0.255
[SwitchA-ospf-1-area-0.0.0.0] quit
[SwitchA-ospf-1] quit
# Create VRRP group 2 on SwitchA and SwitchB. Set SwitchB as the master device,
priority to 120, and preemption delay to 20 seconds. Set SwitchA as the backup
device and retain the default priority.
[SwitchB] interface vlanif 3
[SwitchB-Vlanif3] vrrp vrid 2 virtual-ip 10.1.3.100
[SwitchB-Vlanif3] vrrp vrid 2 priority 120
[SwitchB-Vlanif3] vrrp vrid 2 preempt-mode timer delay 20
[SwitchB-Vlanif3] quit
[SwitchA] interface vlanif 3
[SwitchA-Vlanif3] vrrp vrid 2 virtual-ip 10.1.3.100
[SwitchA-Vlanif3] quit
# Set the virtual IP address 10.1.2.100 of VRRP group 1 as the default gateway of
Host A, and the virtual IP address 10.1.3.100 of VRRP group 2 as the default
gateway of Host B.
Step 7 Verify the configuration.
# After completing the preceding configurations, run the display vrrp command
on SwitchA. SwitchA's VRRP status is master in VRRP group 1 and backup in VRRP
group 2.
[SwitchA] display vrrp
Vlanif2 | Virtual Router 1
State : Master
Virtual IP : 10.1.2.100
Master IP : 10.1.2.102
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 11:39:18
Last change time : 2012-05-26 11:38:58
# Run the display vrrp command on SwitchB. SwitchB's VRRP status is backup in
VRRP group 1 and master in VRRP group 2.
[SwitchB] display vrrp
Vlanif2 | Virtual Router 1
State : Backup
Virtual IP : 10.1.2.100
Master IP : 10.1.2.102
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 11:39:18
Last change time : 2012-05-26 11:38:58
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 11:40:18
Last change time : 2012-05-26 11:48:58
----End
Configuration File
● SwitchA configuration file
#
sysname SwitchA
#
vlan batch 2 to 4
#
stp instance 1 root primary
stp instance 2 root secondary
stp bpdu-protection
stp pathcost-standard legacy
stp enable
#
stp region-configuration
region-name RG1
instance 1 vlan 2
instance 2 vlan 3
active region-configuration
#
interface Vlanif2
ip address 10.1.2.102 255.255.255.0
vrrp vrid 1 virtual-ip 10.1.2.100
vrrp vrid 1 priority 120
vrrp vrid 1 preempt-mode timer delay 20
#
interface Vlanif3
ip address 10.1.3.102 255.255.255.0
vrrp vrid 2 virtual-ip 10.1.3.100
#
interface Vlanif4
ip address 10.1.4.102 255.255.255.0
#
interface GigabitEthernet1/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 3
stp root-protection
#
interface GigabitEthernet1/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 3
#
interface GigabitEthernet1/0/3
port link-type trunk
port trunk allow-pass vlan 4
stp edged-port enable
#
ospf 1
area 0.0.0.0
network 10.1.2.0 0.0.0.255
network 10.1.3.0 0.0.0.255
network 10.1.4.0 0.0.0.255
#
return
interface GigabitEthernet1/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 3
stp instance 2 cost 20000
#
interface GigabitEthernet1/0/2
port link-type access
port default vlan 2
stp edged-port enable
#
interface GigabitEthernet1/0/3
port link-type access
port default vlan 3
stp edged-port enable
#
interface GigabitEthernet1/0/4
port link-type trunk
port trunk allow-pass vlan 2 to 3
stp instance 1 cost 20000
#
return
Networking Requirements
In Figure 3-20, hosts on a LAN are dual-homed to SwitchA and SwitchB through
the switch. User packets sent from the switch carry one tag. The requirements are
as follows:
● The host uses SwitchA as the default gateway to connect to the Internet.
When SwitchA becomes faulty, SwitchB functions as the gateway. This
implements gateway backup.
● After SwitchA recovers, it becomes the gateway within 20s.
Figure 3-20 Networking for configuring VRRP on the Dot1q termination sub-
interface
In te rn e t
G E 1 /0 /0 G E 2 /0 /0
1 9 2 .1 6 8 .2 .2 /2 4 1 9 2 .1 6 8 .1 .2 /2 4
G E 1 /0 /0 G E 1 /0 /0
1 9 2 .1 6 8 .2 .1 /2 4 S w itc h C 1 9 2 .1 6 8 .1 .1 /2 4
S w itc h A S w itc h B
G E 2 /0 /0 .1 G E 2 /0 /0 .1
1 0 .1 .1 .1 /2 4 1 0 .1 .1 .2 /2 4
S w itc h V R R P V R ID 1
G E 1 /0 /1 G E 1 /0 /2 V irtu a l IP a d d re s s :
1 0 .1 .1 .1 1 1 /2 4
G E 1 /0 /0
VLAN 10
Host
1 0 .1 .1 .3 /2 4
Configuration Roadmap
VRRP is configured on the Dot1q termination sub-interface to implement gateway
redundancy. The configuration roadmap is as follows:
Procedure
Step 1 Configure devices to ensure network connectivity.
# Configure VRRP group 1 on GE2/0/0.1 of SwitchB, and set the default priority of
100 for SwitchB.
[SwitchB] interface gigabitethernet 2/0/0.1
[SwitchB-GigabitEthernet2/0/0.1] dot1q termination vid 10
[SwitchB-GigabitEthernet2/0/0.1] arp broadcast enable
[SwitchB-GigabitEthernet2/0/0.1] dot1q vrrp vid 10
[SwitchB-GigabitEthernet2/0/0.1] vrrp vrid 1 virtual-ip 10.1.1.111
[SwitchB-GigabitEthernet2/0/0.1] quit
# After the configuration is complete, run the display vrrp command on SwitchA
and SwitchB. You can see that SwitchA is in Master state and SwitchB is in Backup
state.
[SwitchA] display vrrp
GigabitEthernet2/0/0.1 | 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 :1s
TimerConfig :1s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Backup-forward : disabled
Create time : 2012-05-30 21:25:47
Last change time : 2012-05-30 21:25:51
[SwitchB] display vrrp
GigabitEthernet2/0/0.1 | 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 :1s
TimerConfig :1s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Backup-forward : disabled
Create time : 2012-05-30 21:25:47
Last change time : 2012-05-30 21:25:51
routing table of SwitchA and an OSPF route to the virtual IP address exists in the
routing table of SwitchB.
[SwitchA] display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 8 Routes : 9
# Run the display vrrp command on SwitchA and SwitchB. You can see that
SwitchA is in Initialize state and SwitchB is in Master state.
[SwitchA] display vrrp
GigabitEthernet2/0/0.1 | Virtual Router 1
State : Initialize
Virtual IP : 10.1.1.111
Master IP : 0.0.0.0
PriorityRun : 120
PriorityConfig : 120
MasterPriority : 0
Preempt : YES Delay Time : 20 s
TimerRun :1s
TimerConfig :1s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Backup-forward : disabled
Create time : 2012-05-30 21:27:47
Last change time : 2012-05-30 21:27:51
[SwitchB] display vrrp
GigabitEthernet2/0/0.1 | Virtual Router 1
State : Master
Virtual IP : 10.1.1.111
Master IP : 10.1.1.2
PriorityRun : 100
PriorityConfig : 100
MasterPriority : 100
Preempt : YES Delay Time : 0 s
TimerRun :1s
TimerConfig :1s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Backup-forward : disabled
Create time : 2012-05-30 21:27:47
Last change time : 2012-05-30 21:27:51
# After 20s, run the display vrrp command on SwitchA and SwitchB. You can see
that SwitchA is in Master state and SwitchB is in Backup state.
[SwitchA] display vrrp
GigabitEthernet2/0/0.1 | 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 :1s
TimerConfig :1s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Backup-forward : disabled
Create time : 2012-05-30 21:28:47
Last change time : 2012-05-30 21:28:51
[SwitchB] display vrrp
GigabitEthernet2/0/0.1 | 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 :1s
TimerConfig :1s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Backup-forward : disabled
Create time : 2012-05-30 21:28:47
Last change time : 2012-05-30 21:28:51
----End
Configuration Files
● SwitchA configuration file
#
sysname SwitchA
#
interface GigabitEthernet1/0/0
undo portswitch
ip address 192.168.2.1 255.255.255.0
#
interface GigabitEthernet2/0/0.1
dot1q termination vid 10
dot1q vrrp vid 10
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
arp broadcast enable
#
ospf 1
area 0.0.0.0
network 10.1.1.0 0.0.0.255
network 192.168.2.0 0.0.0.255
#
return
● SwitchB configuration file
#
sysname SwitchB
#
interface GigabitEthernet1/0/0
undo portswitch
ip address 192.168.1.1 255.255.255.0
#
interface GigabitEthernet2/0/0.1
dot1q termination vid 10
dot1q vrrp vid 10
ip address 10.1.1.2 255.255.255.0
vrrp vrid 1 virtual-ip 10.1.1.111
arp broadcast enable
#
ospf 1
area 0.0.0.0
network 10.1.1.0 0.0.0.255
network 192.168.1.0 0.0.0.255
#
return
● SwitchC configuration file
#
sysname SwitchC
#
interface GigabitEthernet1/0/0
undo portswitch
ip address 192.168.2.2 255.255.255.0
#
interface GigabitEthernet2/0/0
undo portswitch
ip address 192.168.1.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
#
return
● Switch configuration file
#
sysname Switch
#
vlan batch 10
#
interface GigabitEthernet1/0/0
port link-type access
Networking Requirements
As shown in Figure 3-21, hosts on a LAN are dual-homed to SwitchA and SwitchB
through LSW1. HostA belongs to VLAN 10 and HostB belongs to VLAN 20. User
packets sent from LSW1 carry double tags. The requirements are as follows:
● The host uses SwitchA as the default gateway to connect to the Internet.
When SwitchA becomes faulty, SwitchB functions as the gateway. This
implements gateway backup.
● After SwitchA recovers, it becomes the gateway within 20s.
In te rn e t
G E 1 /0 /0 G E 2 /0 /0
1 9 2 .1 6 8 .2 .2 /2 4 1 9 2 .1 6 8 .1 .2 /2 4
G E 1 /0 /0 G E 1 /0 /0
1 9 2 .1 6 8 .2 .1 /2 4 S w itc h C 1 9 2 .1 6 8 .1 .1 /2 4
S w itc h A S w itc h B
G E 2 /0 /0 .1 1 0 .1 .1 .1 /2 4 G E 2 /0 /0 .1 1 0 .1 .1 .2 /2 4
G E 2 /0 /0 .2 1 0 .1 .2 .1 /2 4 G E 2 /0 /0 .2 1 0 .1 .2 .2 /2 4
V R R P V R ID 2
V irtu re IP a d d re s s:
V R R P V R ID 1
1 0 .1 .2 .1 1 1 /2 4
V irtu re IP a d d re s s: G E 1 /0 /2 G E 1 /0 /3
1 0 .1 .1 .1 1 1 /2 4
G E 1 /0 /0 G E 1 /0 /1
G E 1 /0 /1 LSW 1 G E 1 /0 /1
LSW 2 LSW 3
G E 1 /0 /0 G E 1 /0 /0
VLAN 10 VLAN 20
H o s tA H o s tB
1 0 .1 .1 .3 /2 4 1 0 .1 .2 .3 /2 4
Configuration Roadmap
The configuration roadmap is as follows:
Procedure
Step 1 Configure devices to ensure network connectivity.
# Configure LSW2.
<Quidway> system-view
[Quidway] sysname LSW2
[LSW2] vlan 10
[LSW2-vlan10] quit
[LSW2] interface gigabitethernet 1/0/0
[LSW2-GigabitEthernet1/0/0] port link-type access
[LSW2-GigabitEthernet1/0/0] port default vlan 10
[LSW2-GigabitEthernet1/0/0] quit
[LSW2] interface gigabitethernet 1/0/1
[LSW2-GigabitEthernet1/0/1] port link-type trunk
[LSW2-GigabitEthernet1/0/1] port trunk allow-pass vlan 10
[LSW2-GigabitEthernet1/0/1] quit
# Configure LSW3.
<Quidway> system-view
[Quidway] sysname LSW3
[LSW3] vlan 20
[LSW3-vlan20] quit
[LSW3] interface gigabitethernet 1/0/0
[LSW3-GigabitEthernet1/0/0] port link-type access
[LSW3-GigabitEthernet1/0/0] port default vlan 20
[LSW3-GigabitEthernet1/0/0] quit
[LSW3] interface gigabitethernet 1/0/1
[LSW3-GigabitEthernet1/0/1] port link-type trunk
[LSW3-GigabitEthernet1/0/1] port trunk allow-pass vlan 20
[LSW3-GigabitEthernet1/0/1] quit
# Configure LSW1.
<Quidway> system-view
[Quidway] sysname LSW1
[LSW1] vlan 100
[LSW1-vlan100] quit
[LSW1] interface gigabitethernet 1/0/0
[LSW1-GigabitEthernet1/0/0] port vlan-stacking vlan 10 stack-vlan 100
[LSW1-GigabitEthernet1/0/0] quit
[LSW1] interface gigabitethernet 1/0/1
[LSW1-GigabitEthernet1/0/1] port vlan-stacking vlan 20 stack-vlan 100
[LSW1-GigabitEthernet1/0/1] quit
[LSW1] interface gigabitethernet 1/0/2
[LSW1-GigabitEthernet1/0/2] port link-type trunk
[LSW1-GigabitEthernet1/0/2] port trunk allow-pass vlan 100
[LSW1-GigabitEthernet1/0/2] quit
[LSW1] interface gigabitethernet 1/0/3
[LSW1-GigabitEthernet1/0/3] port link-type trunk
[LSW1-GigabitEthernet1/0/3] port trunk allow-pass vlan 100
[LSW1-GigabitEthernet1/0/3] quit
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-29 21:25:47
Last change time : 2012-05-29 21:27:10
# Run the display vrrp command on SwitchA and SwitchB. You can see that
SwitchA is in Initialize state and SwitchB is in Master state in VRRP group 1.
Backup-forward : disabled
Create time : 2012-05-29 21:25:47
Last change time : 2012-05-29 21:27:10
# After 20s, run the display vrrp command on SwitchA and SwitchB. You can see
that SwitchA is in Master state and SwitchB is in Backup state in VRRP group 1.
[SwitchA] display vrrp
GigabitEthernet2/0/0.1 | 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-29 21:29:47
Last change time : 2012-05-29 21:31:10
Virtual IP : 10.1.2.111
Master IP : 10.1.2.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-0102
Check TTL : YES
Config type : normal-vrrp
Backup-forward : disabled
Create time : 2012-05-29 21:25:47
Last change time : 2012-05-29 21:27:10
----End
Configuration Files
● SwitchA configuration file
#
sysname SwitchA
#
interface GigabitEthernet1/0/0
undo portswitch
ip address 192.168.2.1 255.255.255.0
#
interface GigabitEthernet2/0/0.1
qinq termination pe-vid 100 ce-vid 10
qinq vrrp pe-vid 100 ce-vid 10
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
#
interface GigabitEthernet2/0/0.2
qinq termination pe-vid 100 ce-vid 20
qinq vrrp pe-vid 100 ce-vid 20
ip address 10.1.2.1 255.255.255.0
vrrp vrid 2 virtual-ip 10.1.2.111
vrrp vrid 2 priority 120
vrrp vrid 2 preempt-mode timer delay 20
#
ospf 1
area 0.0.0.0
network 10.1.1.0 0.0.0.255
network 10.1.2.0 0.0.0.255
network 192.168.2.0 0.0.0.255
#
return
Networking Requirements
In Figure 3-22, HostA is dual-homed to SwitchA and SwitchB through the switch
on the IPv6 network. To ensure nonstop service transmission, a VRRP6 group in
active/standby mode needs to be configured on SwitchA and SwitchB.
● The host uses SwitchA as the default gateway to connect to the Internet.
When SwitchA becomes faulty, SwitchB functions as the gateway. This
implements gateway backup.
● After SwitchA recovers, it preempts to be the master to transmit data after a
preemption delay of 20s.
GE1/0/1
GE1/0/1 2002::2/64
SwitchC
GE1/0/3
Switch Internet
2003::2/64
HostA GE1/0/2 GE1/0/2
2001::2/64
FC00::3/64
GE1/0/1
GE1/0/2 2001::1/64
FC00::2/64SwitchB
Backup
Configuration Roadmap
The configuration roadmap is as follows:
1. Assign an IP address to each interface and configure a routing protocol to
ensure network connectivity.
2. Configure a VRRP6 group on SwitchA and SwitchB, set a higher priority for
SwitchA so that SwitchA functions as the master to forward traffic and set the
preemption delay to 20s on SwitchA, and set a lower priority for SwitchB so
that SwitchB functions as the backup.
Procedure
Step 1 Configure devices to ensure network connectivity.
# Configure VLANs that each interface belongs to. SwitchA is used as an example.
The configurations of SwitchB and SwitchC are similar to the configuration of
SwitchA, and are not mentioned here. For details, see the configuration files.
<Quidway> system-view
[Quidway] sysname SwitchA
[SwitchA] vlan batch 100 300
[SwitchA] interface gigabitethernet 1/0/1
[SwitchA-GigabitEthernet1/0/1] port hybrid pvid vlan 300
[SwitchA-GigabitEthernet1/0/1] port hybrid untagged vlan 300
[SwitchA-GigabitEthernet1/0/1] quit
[SwitchA] interface gigabitethernet 1/0/2
[SwitchA-GigabitEthernet1/0/2] port hybrid pvid vlan 100
[SwitchA-GigabitEthernet1/0/2] port hybrid untagged vlan 100
[SwitchA-GigabitEthernet1/0/2] quit
<Quidway> system-view
[Quidway] sysname Switch
[Switch] vlan 100
[Switch-vlan100] quit
[Switch] interface gigabitethernet 1/0/1
[Switch-GigabitEthernet1/0/1] port hybrid pvid vlan 100
[Switch-GigabitEthernet1/0/1] port hybrid untagged vlan 100
[Switch-GigabitEthernet1/0/1] quit
[Switch] interface gigabitethernet 1/0/2
[Switch-GigabitEthernet1/0/2] port hybrid pvid vlan 100
[Switch-GigabitEthernet1/0/2] port hybrid untagged vlan 100
[Switch-GigabitEthernet1/0/2] quit
# Configure VRRP6 group 1 on SwitchB, and set the default priority of 100 for
SwitchB.
[SwitchB] interface vlanif 100
[SwitchB-Vlanif100] vrrp6 vrid 1 virtual-ip FE80::1 link-local
[SwitchB-Vlanif100] vrrp6 vrid 1 virtual-ip FC00::100
[SwitchB-Vlanif100] quit
# Run the display vrrp6 command on SwitchA and SwitchB. You can see that
SwitchA is in Initialize state and SwitchB is in Master state.
[SwitchA] display vrrp6
Vlanif100 | Virtual Router 1
State : Initialize
Virtual IP : FE80::1
FC00::100
Master IP : ::
PriorityRun : 120
PriorityConfig : 120
MasterPriority : 0
Preempt : YES Delay Time : 20 s
TimerRun : 100 cs
TimerConfig : 100 cs
Virtual MAC : 0000-5e00-0201
Check hop limit : YES
Config type : normal-vrrp
Backup-forward : disabled
Create time : 2012-01-12 20:15:46
Last change time : 2012-01-12 20:15:46
[SwitchB] display vrrp6
Vlanif100 | Virtual Router 1
State : Master
Virtual IP : FE80::1
FC00::100
Master IP : FE80::218:82FF:FE68:7455
PriorityRun : 100
PriorityConfig : 100
MasterPriority : 100
Preempt : YES Delay Time : 0 s
TimerRun : 100 cs
TimerConfig : 100 cs
Virtual MAC : 0000-5e00-0201
Check hop limit : YES
Config type : normal-vrrp
Backup-forward : disabled
Create time : 2012-01-12 20:15:46
Last change time : 2012-01-12 20:15:46
# After 20s, run the display vrrp6 command on SwitchA and SwitchB. You can see
that SwitchA is in Master state and SwitchB is in Backup state.
[SwitchA] display vrrp6
Vlanif100 | Virtual Router 1
State : Master
Virtual IP : FE80::1
FC00::100
Master IP : FE80::218:82FF:FED3:2AF3
PriorityRun : 120
PriorityConfig : 120
MasterPriority : 120
Preempt : YES Delay Time : 20 s
TimerRun : 100 cs
TimerConfig : 100 cs
Virtual MAC : 0000-5e00-0201
Check hop limit : YES
Config type : normal-vrrp
Backup-forward : disabled
Create time : 2012-01-12 20:15:46
Last change time : 2012-01-12 20:15:46
[SwitchB] display vrrp6
Vlanif100 | Virtual Router 1
State : Backup
Virtual IP : FE80::1
FC00::100
Master IP : FE80::218:82FF:FED3:2AF3
PriorityRun : 100
PriorityConfig : 100
MasterPriority : 120
Preempt : YES Delay Time : 0 s
TimerRun : 100 cs
TimerConfig : 100 cs
Virtual MAC : 0000-5e00-0201
Check hop limit : YES
Config type : normal-vrrp
Backup-forward : disabled
Create time : 2012-01-12 20:15:46
Last change time : 2012-01-12 20:15:46
----End
Configuration Files
● SwitchA configuration file
#
sysname SwitchA
#
ipv6
#
vlan batch 100 300
#
ospfv3 1
router-id 1.1.1.1
#
interface Vlanif100
ipv6 enable
ipv6 address FC00::1/64
ospfv3 1 area 0.0.0.0
vrrp6 vrid 1 virtual-ip FE80::1 link-local
vrrp6 vrid 1 virtual-ip FC00::100
vrrp6 vrid 1 priority 120
vrrp6 vrid 1 preempt-mode timer delay 20
#
interface Vlanif300
ipv6 enable
ipv6 address 2002::1/64
ospfv3 1 area 0.0.0.0
#
interface GigabitEthernet1/0/1
port hybrid pvid vlan 300
port hybrid untagged vlan 300
#
interface GigabitEthernet1/0/2
port hybrid pvid vlan 100
port hybrid untagged vlan 100
#
return
● SwitchB configuration file
#
sysname SwitchB
#
ipv6
#
vlan batch 100 200
#
ospfv3 1
router-id 2.2.2.2
#
interface Vlanif100
ipv6 enable
ipv6 address FC00::2/64
ospfv3 1 area 0.0.0.0
vrrp6 vrid 1 virtual-ip FE80::1 link-local
vrrp6 vrid 1 virtual-ip FC00::100
#
interface Vlanif200
ipv6 enable
ipv6 address 2001::1/64
ospfv3 1 area 0.0.0.0
#
interface GigabitEthernet1/0/1
port hybrid pvid vlan 200
port hybrid untagged vlan 200
#
interface GigabitEthernet1/0/2
port hybrid pvid vlan 100
port hybrid untagged vlan 100
#
return
● SwitchC configuration file
#
sysname SwitchC
#
ipv6
#
vlan batch 200 300 400
#
ospfv3 1
router-id 3.3.3.3
#
interface Vlanif200
ipv6 enable
ipv6 address 2001::2/64
ospfv3 1 area 0.0.0.0
#
interface Vlanif300
ipv6 enable
ipv6 address 2002::2/64
Networking Requirements
In Figure 3-23, HostA and HostC are dual-homed to SwitchA and SwitchB through
the switch on the IPv6 network. To reduce the load of data traffic on SwitchA,
HostA uses SwitchA as the default gateway to connect to the Internet, and
SwitchB functions as the backup gateway. HostC uses SwitchB as the default
gateway to connect to the Internet, and SwitchA functions as the backup gateway.
This implements load balancing.
Figure 3-23 Networking diagram for a VRRP6 group in load balancing mode
VRRP6 VRID 1
Virtual IP address: SwitchA
FC00::100/64 VRID 1: Master
VRID 2: Backup
HostA GE1/0/1
FC00::3/64 2002::1/64
GE1/0/2 GE1/0/1
GE1/0/1 FC00::1/64 2002::2/64
Switch GE1/0/3 Internet
SwitchC
2003::2/64
GE1/0/2 GE1/0/2 GE1/0/2
FC00::2/64 2001::2/64
HostC GE1/0/1
FC00::4/64 2001::1/64
SwitchB
VRID 1: Backup
VRID 2: Master
VRRP6 VRID 2
Virtual IP address:
FC00::60/64
Configuration Roadmap
The configuration roadmap is as follows:
Procedure
Step 1 Configure devices to ensure network connectivity.
# Configure VLANs that each interface belongs to. SwitchA is used as an example.
The configurations of SwitchB and SwitchC are similar to the configuration of
SwitchA, and are not mentioned here. For details, see the configuration files.
<Quidway> system-view
[Quidway] sysname SwitchA
[SwitchA] vlan batch 100 300
[SwitchA] interface gigabitethernet 1/0/1
[SwitchA-GigabitEthernet1/0/1] port hybrid pvid vlan 300
[SwitchA-GigabitEthernet1/0/1] port hybrid untagged vlan 300
[SwitchA-GigabitEthernet1/0/1] quit
[SwitchA] interface gigabitethernet 1/0/2
[SwitchA-GigabitEthernet1/0/2] port hybrid pvid vlan 100
[SwitchA-GigabitEthernet1/0/2] port hybrid untagged vlan 100
[SwitchA-GigabitEthernet1/0/2] quit
# Configure VRRP6 group 2 on SwitchA and SwitchB, set the priority of SwitchB to
120 and the preemption delay to 20s, and set the default priority for SwitchA.
[SwitchB] interface vlanif 100
[SwitchB-Vlanif100] vrrp6 vrid 2 virtual-ip FE80::2 link-local
[SwitchB-Vlanif100] vrrp6 vrid 2 virtual-ip FC00::60
[SwitchB-Vlanif100] vrrp6 vrid 2 priority 120
[SwitchB-Vlanif100] vrrp6 vrid 2 preempt-mode timer delay 20
[SwitchB-Vlanif100] quit
[SwitchA] interface vlanif 100
[SwitchA-Vlanif100] vrrp6 vrid 2 virtual-ip FE80::2 link-local
[SwitchA-Vlanif100] vrrp6 vrid 2 virtual-ip FC00::60
[SwitchA-Vlanif100] quit
----End
Configuration Files
● SwitchA configuration file
#
sysname SwitchA
#
ipv6
#
vlan batch 100 300
#
ospfv3 1
router-id 1.1.1.1
#
interface Vlanif100
ipv6 enable
ipv6 address FC00::1/64
vrrp6 vrid 1 virtual-ip FE80::1 link-local
vrrp6 vrid 1 virtual-ip FC00::100
vrrp6 vrid 1 priority 120
vrrp6 vrid 1 preempt-mode timer delay 20
vrrp6 vrid 2 virtual-ip FE80::2 link-local
vrrp6 vrid 2 virtual-ip FC00::60
ospfv3 1 area 0.0.0.0
#
interface Vlanif300
ipv6 enable
ipv6 address 2002::1/64
ospfv3 1 area 0.0.0.0
#
interface GigabitEthernet1/0/1
port hybrid pvid vlan 300
port hybrid untagged vlan 300
#
interface GigabitEthernet1/0/2
port hybrid pvid vlan 100
port hybrid untagged vlan 100
#
return
● SwitchB configuration file
#
sysname SwitchB
#
ipv6
#
vlan batch 100 200
#
ospfv3 1
router-id 2.2.2.2
#
interface Vlanif100
ipv6 enable
ipv6 address FC00::2/64
vrrp6 vrid 1 virtual-ip FE80::1 link-local
vrrp6 vrid 1 virtual-ip FC00::100
vrrp6 vrid 2 virtual-ip FE80::2 link-local
vrrp6 vrid 2 virtual-ip FC00::60
vrrp6 vrid 2 priority 120
vrrp6 vrid 2 preempt-mode timer delay 20
ospfv3 1 area 0.0.0.0
#
interface Vlanif200
ipv6 enable
ipv6 address 2001::1/64
ospfv3 1 area 0.0.0.0
#
interface GigabitEthernet1/0/1
port hybrid pvid vlan 200
port hybrid untagged vlan 200
#
interface GigabitEthernet1/0/2
port hybrid pvid vlan 100
port hybrid untagged vlan 100
#
return
● SwitchC configuration file
#
sysname SwitchC
#
ipv6
#
vlan batch 200 300 400
#
ospfv3 1
router-id 3.3.3.3
#
interface Vlanif200
ipv6 enable
ipv6 address 2001::2/64
ospfv3 1 area 0.0.0.0
#
interface Vlanif300
ipv6 enable
ipv6 address 2002::2/64
ospfv3 1 area 0.0.0.0
#
interface Vlanif400
ipv6 enable
ipv6 address 2003::2/64
ospfv3 1 area 0.0.0.0
#
interface GigabitEthernet1/0/1
port hybrid pvid vlan 300
port hybrid untagged vlan 300
#
interface GigabitEthernet1/0/2
port hybrid pvid vlan 200
port hybrid untagged vlan 200
#
interface GigabitEthernet1/0/3
port hybrid pvid vlan 400
port hybrid untagged vlan 400
#
return
Networking Requirements
In Figure 3-24, HostA on the IPv6 network is dual-homed to SwitchA and SwitchB
through the switch. A VRRP6 group is established on SwitchA and SwitchB, and
SwitchA is the master.
When SwitchA or a link between SwitchA and SwitchB becomes faulty, VRRP6
Advertisement packet negotiation takes time. To implement a rapid active/standby
switchover, deploy a BFD session on the link and associate the VRRP6 group with
the BFD session. When the primary interface on the master or the link fails, the
BFD session rapidly detects the fault and notifies the VRRP6 group of it. After
receiving the notification, the VRRP6 group performs a rapid active/standby
switchover. The backup becomes the Master and takes over traffic. This reduces
the impact of the fault on service transmission.
Figure 3-24 Association between VRRP and BFD to implement a rapid active/
standby switchover
VRRP6 VRID 1
Virtual IP address: SwitchA
FC00::100/64 GE1/0/2 Master
GE1/0/1
FC00::1/64 2002::1/64
GE1/0/1
GE1/0/1 2002::2/64
GE1/0/3
Switch SwitchC Internet
2003::2/64
HostA GE1/0/2 GE1/0/2
2001::2/64
FC00::3/64
GE1/0/1
GE1/0/2 2001::1/64
FC00::2/64SwitchB
BFD packets
Backup
Configuration Roadmap
Association between a VRRP6 group and a BFD session is used to implement a
rapid active/standby switchover. The configuration roadmap is as follows:
Procedure
Step 1 Configure devices to ensure network connectivity.
# Configure VLANs that each interface belongs to. SwitchA is used as an example.
The configurations of SwitchB and SwitchC are similar to the configuration of
SwitchA, and are not mentioned here. For details, see the configuration files.
<Quidway> system-view
[Quidway] sysname SwitchA
[SwitchA] vlan batch 100 300
[SwitchA] interface gigabitethernet 1/0/1
[SwitchA-GigabitEthernet1/0/1] port hybrid pvid vlan 300
[SwitchA-GigabitEthernet1/0/1] port hybrid untagged vlan 300
[SwitchA-GigabitEthernet1/0/1] quit
[SwitchA] interface gigabitethernet 1/0/2
[SwitchA-GigabitEthernet1/0/2] port hybrid pvid vlan 100
[SwitchA-GigabitEthernet1/0/2] port hybrid untagged vlan 100
[SwitchA-GigabitEthernet1/0/2] quit
# Configure VRRP6 group 1 on SwitchA, and set the priority of SwitchA to 120 and
the preemption delay to 20s.
[SwitchA] interface vlanif 100
[SwitchA-Vlanif100] vrrp6 vrid 1 virtual-ip FE80::1 link-local
[SwitchA-Vlanif100] vrrp6 vrid 1 virtual-ip FC00::100
[SwitchA-Vlanif100] vrrp6 vrid 1 priority 120
[SwitchA-Vlanif100] vrrp6 vrid 1 preempt-mode timer delay 20
[SwitchA-Vlanif100] quit
# Run the display bfd session command on SwitchA and SwitchB. You can see
that the BFD session is Up. The display on SwitchA is used as an example.
[SwitchA] display bfd session all
--------------------------------------------------------------------------------
Local Remote PeerIpAddr State Type InterfaceName
--------------------------------------------------------------------------------
1 2 10.1.1.2 Up S_IP_IF Vlanif100
--------------------------------------------------------------------------------
Total UP/DOWN Session Number : 1/0
# Configure association between VRRP6 and BFD on SwitchB. When the BFD
session becomes Down, the priority of SwitchB increases by 40.
[SwitchB] interface vlanif 100
[SwitchB-Vlanif100] vrrp6 vrid 1 track bfd-session 2 increased 40
[SwitchB-Vlanif100] quit
# After the configuration is complete, run the display vrrp6 command on SwitchA
and SwitchB. SwitchA is the master, SwitchB is the backup, and the associated BFD
session is in Up state.
[SwitchA] display vrrp6
Vlanif100 | Virtual Router 1
State : Master
Virtual IP : FE80::1
FC00::100
Master IP : FE80::200:AFF:FE88:158D
PriorityRun : 120
PriorityConfig : 120
MasterPriority : 120
Preempt : YES Delay Time : 20 s
TimerRun : 100 cs
TimerConfig : 100 cs
Virtual MAC : 0000-5e00-0201
Check hop limit : YES
Config type : normal-vrrp
Backup-forward : disabled
Create time : 2012-01-12 20:15:46
Last change time : 2012-01-12 20:15:46
[SwitchB] display vrrp6
Vlanif100 | Virtual Router 1
State : Backup
Virtual IP : FE80::1
FC00::100
Master IP : FE80::200:AFF:FE88:158D
PriorityRun : 100
PriorityConfig : 100
MasterPriority : 120
Preempt : YES Delay Time : 0 s
TimerRun : 100 cs
TimerConfig : 100 cs
Virtual MAC : 0000-5e00-0201
Check hop limit : YES
Config type : normal-vrrp
Backup-forward : disabled
Track BFD : 2 Priority increased : 40
BFD-session state : UP
Create time : 2012-01-12 20:15:46
Last change time : 2012-01-12 20:15:46
# Run the display vrrp6 command on SwitchA and SwitchB. You can see that
SwitchA is in Initialize state, SwitchB becomes the master, and the associated BFD
session becomes Down.
[SwitchA] display vrrp6
Vlanif100 | Virtual Router 1
State : Initialize
Virtual IP : FE80::1
FC00::100
Master IP : ::
PriorityRun : 120
PriorityConfig : 120
MasterPriority : 0
Preempt : YES Delay Time : 20 s
TimerRun : 100 cs
TimerConfig : 100 cs
Virtual MAC : 0000-5e00-0201
# After 20s, run the display vrrp6 command on SwitchA and SwitchB. You can see
that SwitchA restores to be the master and SwitchB the backup, and the
associated BFD session is in Up state.
[SwitchA] display vrrp6
Vlanif100 | Virtual Router 1
State : Master
Virtual IP : FE80::1
FC00::100
Master IP : FE80::200:AFF:FE88:158D
PriorityRun : 120
PriorityConfig : 120
MasterPriority : 120
Preempt : YES Delay Time : 20 s
TimerRun : 100 cs
TimerConfig : 100 cs
Virtual MAC : 0000-5e00-0201
Check hop limit : YES
Config type : normal-vrrp
Backup-forward : disabled
Create time : 2012-01-12 20:15:46
Last change time : 2012-01-12 20:15:46
[SwitchB] display vrrp6
Vlanif100 | Virtual Router 1
State : Backup
Virtual IP : FE80::1
FC00::100
Master IP : FE80::200:AFF:FE88:158D
PriorityRun : 100
PriorityConfig : 100
MasterPriority : 120
Preempt : YES Delay Time : 0 s
TimerRun : 100 cs
TimerConfig : 100 cs
Virtual MAC : 0000-5e00-0201
Check hop limit : YES
Config type : normal-vrrp
Backup-forward : disabled
Track BFD : 2 Priority increased : 40
BFD-session state : UP
Create time : 2012-01-12 20:15:46
Last change time : 2012-01-12 20:15:46
----End
Configuration Files
● SwitchA configuration file
#
sysname SwitchA
#
ipv6
#
vlan batch 100 300
#
bfd
#
ospfv3 1
router-id 1.1.1.1
#
interface Vlanif100
ipv6 enable
ip address 10.1.1.1 255.255.255.0
ipv6 address FC00::1/64
ospfv3 1 area 0.0.0.0
vrrp6 vrid 1 virtual-ip FE80::1 link-local
vrrp6 vrid 1 virtual-ip FC00::100
vrrp6 vrid 1 priority 120
vrrp6 vrid 1 preempt-mode timer delay 20
#
interface Vlanif300
ipv6 enable
ipv6 address 2002::1/64
ospfv3 1 area 0.0.0.0
#
interface GigabitEthernet1/0/1
port hybrid pvid vlan 300
port hybrid untagged vlan 300
#
interface GigabitEthernet1/0/2
port hybrid pvid vlan 100
port hybrid untagged vlan 100
#
bfd atob bind peer-ip 10.1.1.2 interface Vlanif100
discriminator local 1
discriminator remote 2
min-tx-interval 100
min-rx-interval 100
commit
#
return
#
sysname SwitchB
#
ipv6
#
vlan batch 100 200
#
bfd
#
ospfv3 1
router-id 2.2.2.2
#
interface Vlanif100
ipv6 enable
ip address 10.1.1.2 255.255.255.0
ipv6 address FC00::2/64
ospfv3 1 area 0.0.0.0
vrrp6 vrid 1 virtual-ip FE80::1 link-local
vrrp6 vrid 1 virtual-ip FC00::100
vrrp6 vrid 1 track bfd-session 2 increased 40
#
interface Vlanif200
ipv6 enable
ipv6 address 2001::1/64
ospfv3 1 area 0.0.0.0
#
interface GigabitEthernet1/0/1
port hybrid pvid vlan 200
port hybrid untagged vlan 200
#
interface GigabitEthernet1/0/2
port hybrid pvid vlan 100
port hybrid untagged vlan 100
#
bfd btoa bind peer-ip 10.1.1.1 interface Vlanif100
discriminator local 2
discriminator remote 1
min-tx-interval 100
min-rx-interval 100
commit
#
return
● SwitchC configuration file
#
sysname SwitchC
#
ipv6
#
vlan batch 200 300 400
#
ospfv3 1
router-id 3.3.3.3
#
interface Vlanif200
ipv6 enable
ipv6 address 2001::2/64
ospfv3 1 area 0.0.0.0
#
interface Vlanif300
ipv6 enable
ipv6 address 2002::2/64
ospfv3 1 area 0.0.0.0
#
interface Vlanif400
ipv6 enable
ipv6 address 2003::2/64
ospfv3 1 area 0.0.0.0
#
interface GigabitEthernet1/0/1
port hybrid pvid vlan 300
port hybrid untagged vlan 300
#
interface GigabitEthernet1/0/2
port hybrid pvid vlan 200
port hybrid untagged vlan 200
#
interface GigabitEthernet1/0/3
port hybrid pvid vlan 400
Fault Description
Multiple masters exist in a VRRP group.
Procedure
Step 1 Ping masters to check network connectivity between masters.
● If the ping operation fails, check whether the network connection is correct.
● If the ping operation is successful and the TTL value of the ping packet is 255,
go to step 2.
Step 2 Run the display vrrp protocol-information command in any view to check
whether the VRRP version on each master is compatible with the mode in which
VRRP Advertisement packets are sent.
● If the version is incompatible with the mode, run the vrrp version { v2 | v3 }
command in the system view to change the version.
● If the version is compatible with the mode, go to step 3.
● A VRRPv2 group can only send and receive VRRPv2 Advertisement packets, and discards
the received VRRPv3 Advertisement packets.
● A VRRPv3 group can send and receive both VRRPv2 and VRRPv3 Advertisement packets.
You can configure the mode in which VRRPv3 Advertisement packets are sent as v2-
only, v3-only, or v2v3-both.
Step 3 Run the display vrrp virtual-router-id command in any view to check whether the
masters use the same virtual IP address, interval at which VRRP Advertisement
packets are sent, authentication mode, and authentication key.
● If the configured virtual IP addresses are different, run the vrrp vrid virtual-
router-id virtual-ip virtual-address command to set the same virtual IP
address.
● If the intervals are different, run the vrrp vrid virtual-router-id timer
advertise advertise-interval command to set the same interval.
● If the authentication modes and keys are different, run the vrrp vrid virtual-
router-id authentication-mode { simple { key | plain key | cipher cipher-
key } | md5 md5-key } command to set the same authentication mode and
key.
----End
Fault Description
The VRRP group status changes frequently.
Procedure
Step 1 Run the display vrrp virtual-router-id command in any view to check whether the
VRRP group is associated with an interface or a BFD session.
● If the VRRP group is associated with the interface or a BFD session, flapping
of the interface or a BFD session causes VRRP group status flapping. Rectify
the fault on the associated module.
● If association is not configured, go to step 2.
Step 2 Run the display vrrp virtual-router-id command in any view to check the
preemption delay of the VRRP group.
● If the preemption delay is 0, run the vrrp vrid virtual-router-id preempt-
mode timer delay delay-value command in the view of the interface where
the VRRP group is configured to set the nonzero preemption delay.
● If the preemption is not 0, go to step 3.
Step 3 Run the vrrp vrid virtual-router-id timer advertise advertise-interval command in
the view of the interface where the VRRP group is configured to set a larger
interval at which VRRP Advertisement packets are sent, or run the vrrp vrid
virtual-router-id preempt-mode timer delay delay-value command to set a larger
preemption delay.
----End
Fault Symptom
A downstream device cannot ping the virtual IP address of a VRRP group.
Procedure
Step 1 Check whether ping to the virtual IP address of the VRRP group is enabled.
By default, the master is enabled to respond to ping packets. If this function is
disabled, a downstream device cannot ping the virtual IP address of a VRRP group.
Run the display current-configuration command in any view of the master to
check whether the undo vrrp virtual-ip ping enable command is used. If the
undo vrrp virtual-ip ping enable command is used, run the vrrp virtual-ip ping
enable command in the system view to enable ping to the virtual IP address of a
VRRP group.
----End
3.11 FAQ
3.11.1 How Does the Master/Slave Switchover Work in VRRP
on the switch?
You can set the VRRP priority when configuring a VRRP group. The switch of the
highest priority functions as the master switch, and the switches of lower priorities
function as the standby switches. If the master switch is Down, a standby switch
functions as a master switch.
● The VRRP preemption mode is as follows:
– If VRRP preemption is disabled, once a switch functions as a master
switch in the VRRP standby group, other switches cannot become a
master switch even if they are configured with higher priorities. If the
master switch is faulty, a standby switch can become the master one.
– If VRRP preemption is enabled, once a switch finds that its priority is
higher than that of the current master switch, it becomes the master
switch, and the previous master switch accordingly becomes a standby
switch.
By default, VRRP preemption is enabled and the delay is 0.
● The VRRP can track the specified interface.
If a tracked interface is down, the priority of the switch is reduced by a certain
value (value-reduced). In this case, the priority of this switch will become
lower than the priorities of other switches. Then, the switch of the highest
priority becomes the master switch. The switch can track VLANIF interfaces
and physical interfaces. If a VLANIF interface consists of multiple interfaces,
the priority of the VLANIF interface is not reduced as long as one interface is
Up.
● VRRP tracking BFD session:
When the tracked BFD session goes Down on a switch, the priority of the
switch increases or decreases (depending on the configuration), triggering re-
election of the master. The switch with a higher priority becomes the master.
The interval configured by the vrrp gratuitous-arp timeout command takes effect globally.
Currently, the interval cannot be configured for a single VRRP group.
You can use the vrrp advertise send-mode command to configure the mode in
which VRRP heartbeat packets are sent in a super-VLAN. To reduce the number of
VRRP heartbeat packets on the Layer 2 network, configure the device to send
VRRP heartbeat packets in all sub-VLANs or a specified sub-VLAN.
Figure 3-25 Networking for configuring MAC address triggered ARP entry update
when a VRRP active/backup switchover is performed
Port2 Port2
Port1 Port1
Port1 Port2
Server
MAC address triggered ARP entry update is disabled by default. You can run the
mac-address update arp command to enable MAC address triggered ARP entry
update.