- Table of Contents
-
- 14-High Availability Command Reference
- 00-Preface
- 01-Ethernet OAM commands
- 02-CFD commands
- 03-DLDP commands
- 04-Monitor Link commands
- 05-S-Trunk commands
- 06-Error code detection commands
- 07-VRRP commands
- 08-VSRP commands
- 09-Failover group commands
- 10-Service instance group commands
- 11-BFD commands
- 12-Track commands
- 13-Process placement commands
- Related Documents
-
Title | Size | Download |
---|---|---|
08-VSRP commands | 107.99 KB |
VSRP commands
VSRP peer commands
display vsrp peer
Use display vsrp peer to display VSRP group information.
Syntax
display vsrp peer [ peer-name ]
Views
Any view
Predefined user roles
network-admin
network-operator
Parameters
peer-name: Specifies a VSRP group by its name, a case-sensitive string of 1 to 31 characters. If you do not specify a VSRP group, this command displays information about all VSRP groups.
Examples
# Display information about VSRP group pname.
<Sysname> display vsrp peer pname
VSRP peer name: pname
TCP status: Connected
Peer IP: 11.0.0.3
Local IP: 10.0.0.3
Port: 6000
Track ID: 5
Track status: Positive
# Display information about all VSRP groups.
<Sysname> display vsrp peer
VSRP peer name: pname1
TCP status: Connected
Peer IP: 11.0.0.3
Local IP: 10.0.0.3
Port: 6000
Track ID: 5
Track status: Positive
VSRP peer name: pname2
TCP status: Disconnected
Peer IP: 10.0.0.2
Local IP: 11.0.0.2
Port: 5000
Track ID: 5
Track status: Negative
Table 1 Command output
Field |
Description |
VSRP peer name |
Name of a VSRP group. |
TCP status |
TCP control channel state: Connected or Disconnected. |
Peer IP |
Peer IP address for VSRP channels. |
Local IP |
Local IP address for VSRP channels. |
Port |
Port number for the TCP control channel. |
Track ID |
ID of the track entry associated with the VSRP group. |
Track status |
Track entry state: · Positive. · NotReady. · Negative. |
peer
Use peer to configure the TCP parameters for establishing VSRP channels to the peer.
Use undo peer to delete the VSRP channels to the peer.
Syntax
peer [ ipv6 ] peer-ip-address local local-ip-address [ port port-id ]
undo peer
Default
No VSRP channels are established to the peer.
Views
VSRP peer view
Predefined user roles
network-admin
Parameters
ipv6: Specifies IPv6 addresses. To specify IPv4 addresses, do not specify this keyword.
peer-ip-address: Specifies the IPv4 address of the peer.
local local-ip-address: Specifies the IPv4 address of the local device.
port port-id: Specifies the TCP port number for establishing the control channel. The value range is 1024 to 65535 and the default is 60032. The specified port number cannot be one that is in use. To view the TCP port numbers in use, execute the display [ ipv6 ] tcp command.
Usage guidelines
You must specify different unicast IP addresses for the peer device and the local device in a VSRP group. The IP addresses cannot be all zeros or loopback addresses.
If you have multiple VSRP groups, make sure their IP address pairs are unique.
You cannot configure both IPv4 and IPv6 VSRP channels for the same VSRP peer. To change the TCP parameters for VSRP channel establishment, first execute the undo form of the command to remove the existing VSRP channels.
Examples
# Specify channel establishment parameters for VSRP group pname. Set the local IPv4 address to 11.0.0.2, the peer IPv4 address to 10.0.0.1, and the TCP port number for the control channel to 7000.
<Sysname> system-view
[Sysname] vsrp peer pname
[Sysname-vsrp-peer-pname] peer 10.0.0.1 local 11.0.0.2 port 7000
track
Use track to associate a VSRP group with a track entry.
Use undo track to restore the default.
Syntax
track track-entry-number
undo track
Default
A VSRP group is not associated with any track entry.
Views
VSRP peer view
Predefined user roles
network-admin
Parameters
track-entry-number: Specifies a track entry by its number in the range of 1 to 1024.
Usage guidelines
By default, a VSRP group can detect the state of the failover link based only on the state of the TCP control channel.
You can associate a VSRP group with a track entry to identify the state of the failover link.
· When the track entry is in Positive or NotReady state, a device in the VSRP group attempts to establish a TCP control channel to the peer.
· When the track entry changes to Negative state, the device terminates the TCP control channel.
A VSRP group takes effect only when a TCP control channel is established.
For more information about track entries, see High Availability Configuration Guide.
Examples
# Associate VSRP group pname with track entry 10.
<Sysname> system-view
[Sysname] vsrp peer pname
[Sysname-vsrp-peer-pname] track 10
vsrp peer
Use vsrp peer to create a VSRP group and enter VSRP peer view, or enter the VSRP peer view of an existing VSRP group.
Use undo vsrp peer to remove a VSRP group.
Syntax
vsrp peer peer-name
undo vsrp peer peer-name
Default
No VSRP groups exist.
Views
System view
Predefined user roles
network-admin
Parameters
peer-name: Specifies a VSRP group by its name, a case-sensitive string of 1 to 31 characters.
Usage guidelines
You can create a maximum of 64 VSRP groups on the device.
If a VSRP instance exists on a VSRP group, you must use the undo backup id command to remove that VSRP instance before you can remove the VSRP group.
Examples
# Create a VSRP group named pname and enter VSRP peer view.
<Sysname> system-view
[Sysname] vsrp peer pname
[Sysname-vsrp-peer-pname]
VSRP instance commands
backup id
Use backup id to specify a backup ID for a VSRP instance.
Use undo backup id to restore the default.
Syntax
backup id backup-id peer peer-name
undo backup id
Default
A VSRP instance has no backup ID.
Views
VSRP instance view
Predefined user roles
network-admin
Parameters
backup-id: Specifies a VSRP instance by its backup ID in the range of 1 to 2048.
peer-name: Specifies a VSRP group by its name, a case-sensitive string of 1 to 31 characters.
Usage guidelines
A VSRP instance can be associated with only one VSRP group. The backup ID uniquely identifies a VSRP instance in a VSRP group.
You must specify the same backup ID for a VSRP instance on both devices in a VSRP group.
When you specify a backup ID for a VSRP instance, make sure the following conditions are met:
· The associated VSRP group already exists.
· The backup ID is unique in the VSRP group.
To specify a new backup ID for a VSRP instance, first execute the undo form of the command to remove the existing backup ID setting.
Examples
# Specify the backup ID of VSRP instance aaa as 5 in VSRP group pname.
<Sysname> system-view
[Sysname] vsrp instance aaa
[Sysname-vsrp-instance-aaa] backup id 5 peer pname
backup mode
Use backup mode to set the backup mode for a VSRP instance.
Use undo backup mode to restore the default.
Syntax
backup mode { hot [ dual-active ] | warm }
undo backup mode
Default
A VSRP instance operates in hot backup mode.
Views
VSRP instance view
Predefined user roles
network-admin
Parameters
hot: Specifies hot backup mode.
dual-active: Specifies dual-active hot backup mode. To specify single-active hot backup mode, do not specify this keyword together with the hot keyword.
warm: Specifies warm backup mode.
Usage guidelines
In hot backup mode, the backup device issues backup information to the data plane immediately upon receiving the information from the master. This allows the VSRP instance to perform a fast master and backup switchover to enable the backup to forward packets when the master fails. VSRP provides the following hot backup modes:
· Dual-active hot backup mode—Both the master and backup devices are active to load share traffic.
· Single-active hot backup mode—The master device is active to process service traffic, and the backup device takes over when the master device fails.
In warm backup mode, the backup device does not issue received backup information to the data plane immediately. When the master fails and a switchover occurs, the backup begins to set backup information to the data plane. As a result, the switchover takes longer in warm backup mode than in hot backup mode.
Examples
# Set VSRP instance aaa to operate in warm backup mode.
<Sysname> system-view
[Sysname] vsrp instance aaa
[Sysname-vsrp-instance-aaa] backup mode warm
backup route-advertise
Use backup route-advertise to enable route advertisement for the backup.
Use undo backup route-advertise to restore the default.
Syntax
backup route-advertise [ master-cost master-cost backup-cost backup-cost ]
undo backup route-advertise
Default
Route advertisement is enabled only for the master.
Views
VSRP instance view
Predefined user roles
network-admin
Parameters
master-cost master-cost: Specifies the route cost for the master, in the range of 0 to 4261412863. The default route cost is 10. The master's route cost must be lower than the backup's route cost.
backup-cost backup-cost: Specifies the route cost for the backup, in the range of 1 to 4261412864. The default route cost is 20.
Usage guidelines
An IPoE or PPPoE network requires an address pool to be created on the master and backup of a VSRP instance and route advertisement for subnets of the address pool. By default, only the master advertises the subnet routes, and network devices reach terminal users only through the master. If the master fails or is disconnected, communication with the terminal users is interrupted before the backup takes over.
This command enables the backup to advertise subnet routes for the address pool to reduce the service outage. After you configure this command, the network devices have two routes to reach a terminal user, and the route advertised by the master has a smaller route cost. When both the master and the backup are available, the network devices access terminal users through the master. When the master becomes unavailable, the network devices look up the routing table and use the routes advertised by the backup to reach terminal users.
With route advertisement enabled, the backup can advertise subnet routes for both IPv4 and IPv6 address pools, and subnet routes for PPP IPv6 address pools.
Examples
# Enable route advertisement for the backup of VSRP instance aaa. Set the route costs for the master and the back to 20 and 30, respectively.
<Sysname> system-view
[Sysname] vsrp instance aaa
[Sysname-vsrp-instance-aaa] backup route-advertise master-cost 20 backup-cost 30
bind vrrp ipv6 vrid
Use bind vrrp ipv6 vrid to bind a VSRP instance to an IPv6 VRRP group.
Use undo bind vrrp ipv6 to restore the default.
Syntax
bind vrrp ipv6 vrid virtual-router-id interface interface-type interface-number
undo bind vrrp ipv6
Default
A VSRP instance is not bound to any IPv6 VRRP group.
Views
VSRP instance view
Predefined user roles
network-admin
Parameters
virtual-router-id: Specifies an IPv6 VRRP group by its virtual router ID in the range of 1 to 255.
interface interface-type interface-number: Specifies an interface by its type and number.
Usage guidelines
A VSRP instance is bound to an IPv6 VRRP group to determine the device role (master or backup) in a VSRP group.
You can bind a VSRP instance to only one IPv6 VRRP group. The IPv6 VRRP group can be on any interface.
If you execute the following commands multiple times for a VSRP instance, the most recent configuration takes effect:
· bind vrrp ipv6 vrid
· bind vrrp vrid
Examples
# Bind VSRP instance aaa to IPv6 VRRP group 2 on Ten-GigabitEthernet 3/1/1.
<Sysname> system-view
[Sysname] vsrp instance aaa
[Sysname-vsrp-instance-aaa] bind vrrp ipv6 vrid 2 interface ten-gigabitethernet 3/1/1
Related commands
bind vrrp vrid
bind vrrp vrid
Use bind vrrp vrid to bind a VSRP instance to an IPv4 VRRP group.
Use undo bind vrrp to restore the default.
Syntax
bind vrrp vrid virtual-router-id interface interface-type interface-number
undo bind vrrp
Default
A VSRP instance is not bound to any IPv4 VRRP group.
Views
VSRP instance view
Predefined user roles
network-admin
Parameters
virtual-router-id: Specifies an IPv4 VRRP group by its virtual router ID in the range of 1 to 255.
interface interface-type interface-number: Specifies an interface by its type and number.
Usage guidelines
A VSRP instance is bound to an IPv4 VRRP group to determine the device role (master or backup) in a VSRP group.
You can bind a VSRP instance to only one IPv4 VRRP group. The IPv4 VRRP group can be on any interface.
If you execute the following commands multiple times for a VSRP instance, the most recent configuration takes effect:
· bind vrrp ipv6 vrid
· bind vrrp vrid
Examples
# Bind VSRP instance aaa to IPv4 VRRP group 2 on Ten-GigabitEthernet 3/1/1.
<Sysname> system-view
[Sysname] vsrp instance aaa
[Sysname-vsrp-instance-aaa] bind vrrp vrid 2 interface ten-gigabitethernet 3/1/1
Related commands
bind vrrp ipv6 vrid
display vsrp instance
Use display vsrp instance to display VSRP instance information.
Syntax
display vsrp instance [ instance-name ]
Views
Any view
Predefined user roles
network-admin
network-operator
Parameters
instance-name: Specifies a VSRP instance by its name, a case-sensitive string of 1 to 31 characters. If you do not specify a VSRP instance, this command displays information about all VSRP instances.
Examples
# Display information about VSRP instance aaa.
<Sysname> display vsrp instance aaa
VSRP instance name: aaa
VSRP peer name: pname1
Backup ID: 10
Bound VRID: VRRP VRID 1 Interface: Ten-GigabitEthernet3/1/1
Instance status: Master
Local status: Master
Peer status: Backup
Backup mode: Warm
Traffic backup interval: 10(minutes)
Traffic backup threshold: 50(MB)
NAS IP: 10.0.0.1
NAS port: Ten-GigabitEthernet3/1/2
NAS ID: h3c
Route advertisement: Master and backup
Master cost: 20
Backup cost: 30
# Display information about all VSRP instances.
<Sysname> display vsrp instance
VSRP instance name: aaa
VSRP peer name: pname1
Backup ID: 10
Bound VRID: VRRP VRID 1 Interface: Ten-GigabitEthernet3/1/1
Instance status : Master
Local status: Master
Peer status: Backup
Backup mode: Warm
Traffic backup interval: 10(minutes)
Traffic backup threshold: 50(MB)
NAS IP: 10.0.0.1
NAS port: Ten-GigabitEthernet3/1/2
NAS ID: h3c
Route advertisement: Master only
VSRP instance name: bbb
VSRP peer name: pname2
Backup ID: 10
Bound S-Trunk ID: 1 Interface: Router-Aggregation1
Instance status : Master
Local status: Master
Peer status: Backup
Backup mode: Warm
Traffic backup interval: 5(minutes)
Traffic backup threshold: 100(MB)
NAS IP: 10.0.0.2
NAS port: Ten-GigabitEthernet3/1/4
NAS ID: h3c
Route advertisement: Master and backup
Master cost: 20
Backup cost: 30
Table 2 Command output
Field |
Description |
VSRP peer name |
Name of a VSRP group associated with the VSRP instance. |
Bound VRID Interface: |
Number of the VRRP group bound to the VSRP instance and the interface that hosts the VSRP instance. This field is displayed if the VSRP instance is bound to a VRRP group. |
Bound S-Trunk ID: Interface: |
Smart trunk ID and smart trunk member interface bound to the VSRP instance. This field is displayed if the VSRP instance is bound to a smart trunk member interface. |
Instance status |
VSRP instance state: · Master—The device acts as the master in the VSRP instance. · Backup—The device acts as the backup in the VSRP instance. · Down—The device is not running in the VSRP instance. |
Local status |
Local device state: · Master—The local device is acting as the master. · Backup—The local device is acting as the backup. · Init—The local device is in initialized state. · Down—The state of the local device is unknown. |
Peer status |
Peer state: · Master—The peer is acting as the master. · Backup—The peer is acting as the backup. · Init—The peer is in initialized state. · Down—The state of the peer is unknown. |
Backup mode |
VSRP instance backup mode: · Dual-active—Dual-active hot backup mode. · Hot—Single-active hot backup mode. · Warm—Warm backup mode. |
Traffic backup threshold |
Traffic threshold that triggers a traffic backup. |
NAS IP |
Logical NAS IP address. |
NAS port |
Logical NAS port. |
NAS ID |
Logical host name. |
Route advertisement |
Route advertisement state: · Master and backup—Both the master and the backup advertise subnet routes for address pools. · Master only—Only the master advertises subnet routes for address pools. |
Master cost |
Route cost for the master. This field is displayed only when the value of the Route advertisement field is Master and backup. |
Backup cost |
Route cost for the backup. This field is displayed only when the value of the Route advertisement field is Master and backup. |
nas
Use nas to configure NAS parameters.
Use undo nas to remove the NAS parameters.
Syntax
nas { id host-name | ip ip-address | port interface-type interface-number }
undo nas [ id | ip | port ]
Default
No NAS parameters are configured.
Views
VSRP instance view
Predefined user roles
network-admin
Parameters
id host-name: Specifies a logical host name, a case-insensitive string of 1 to 127 characters.
ip ip-address: Specifies a logical unicast IP address. The IP address cannot be all zeros or a loopback address.
port interface-type interface-number: Specifies a logical interface by its type and number. It must be a Layer 3 Ethernet interface. The logical interface can be an interface that does not belong to the device. Make sure the logical interface number contains three segments in interface-type A/B/C format.
Usage guidelines
This command specifies NAS parameters for outgoing packets. This command enables devices in a VSRP group to share parameters when the devices have the following settings:
· The same NAS-IP-address, NAS-Port, and host name in packets sent to the RADIUS server.
· The same Option 82 in packets sent to the DHCP server.
In this way, the VSRP group is not required to be authenticated again after a master and backup switchover.
Examples
# Specify the logical IP address as 2.2.2.2.
<Sysname> system-view
[Sysname] vsrp instance aaa
[Sysname-vsrp-instance-aaa] nas ip 2.2.2.2
# Specify the logical interface as Ten-GigabitEthernet 3/1/1.
<Sysname> system-view
[Sysname] vsrp instance aaa
[Sysname-vsrp-instance-aaa] nas port ten-gigabitethernet 3/1/1
# Specify the logical host name as bbb.
<Sysname> system-view
[Sysname] vsrp instance aaa
[Sysname-vsrp-instance-aaa] nas id bbb
traffic backup
Use traffic backup to set a traffic backup interval or a traffic threshold that triggers a traffic backup.
Use undo traffic backup to remove the specified traffic backup interval or traffic threshold settings.
Syntax
traffic backup { interval interval-value | threshold threshold-value } *
undo traffic backup [ interval | threshold ]
Default
A VSRP instance backs up traffic at an interval of 10 minutes or when the traffic reaches 50 MB.
Views
VSRP instance view
Predefined user roles
network-admin
Parameters
interval interval-value: Specifies a traffic backup interval in the range of 0 to 1440 minutes.
threshold threshold-value: Specifies a traffic threshold that triggers a traffic backup. The value range for the threshold-value argument is 0 to 100000 MB.
Usage guidelines
A VSRP instance backs up service data at the specified interval or when the specified traffic threshold is reached.
If traffic is not required to be backed up, set both the interval-value argument and the threshold-value argument to 0.
Examples
# Configure VSRP instance aaa to back up traffic every 50 minutes.
<Sysname> system-view
[Sysname] vsrp instance aaa
[Sysname-vsrp-instance-aaa] traffic backup interval 50
# Configure VSRP instance aaa to back up traffic when the traffic reaches 200 MB.
<Sysname> system-view
[Sysname] vsrp instance aaa
[Sysname-vsrp-instance-aaa] traffic backup threshold 200
# Set the traffic backup interval and the traffic threshold to the default value for VSRP instance aaa.
<Sysname> system-view
[Sysname] vsrp instance aaa
[Sysname-vsrp-instance-aaa] undo traffic backup
vsrp instance (system view)
Use vsrp instance to create a VSRP instance and enter its view, or enter the view of an existing VSRP instance.
Use undo vsrp instance to remove a VSRP instance.
Syntax
vsrp instance instance-name
undo vsrp instance instance-name
Default
No VSRP instances exist.
Views
System view
Predefined user roles
network-admin
Parameters
instance-name: Specifies a VSRP instance by its name, a case-sensitive string of 1 to 31 characters.
Usage guidelines
A VSRP instance is associated with a service module. To enable a VSRP instance to function, you must configure the following items for the VSRP instance:
· A VSRP group.
· A bound VRRP group.
· The backup mode.
· The traffic backup interval or traffic threshold.
The device supports a maximum of 1024 VSRP instances.
Examples
# Create a VSRP instance named aaa, and enter VSRP instance view.
<Sysname> system-view
[Sysname] vsrp instance aaa
[Sysname-vsrp-instance-aaa]
IPv6 virtual address commands
ipv6 virtual-address
Use ipv6 virtual-address to specify a virtual IPv6 address for an interface that is associated with a VSRP instance.
Use undo ipv6 virtual-address to restore the default.
Syntax
ipv6 virtual-address ipv6-address vsrp vsrp-instance
undo ipv6 virtual-address
Default
No virtual IPv6 address is configured.
Views
Layer 3 Ethernet interface view
Layer 3 Ethernet subinterface view
Layer 3 aggregate interface view
Layer 3 aggregate subinterface view
Layer 3 FlexE logical interface view
VLAN interface view
Predefined user roles
network-admin
Parameters
ipv6-address: Specifies a virtual IPv6 address. The virtual IPv6 address must be a link local address that can be used as the gateway address by hosts in a LAN.
vsrp vsrp-instance: Specifies a VSRP instance by its name, a case-sensitive string of 1 to 31 characters.
Usage guidelines
Use this command when you enable VSRP for IPv6 IPoE or DHCPv6 services on an interface. For VSRP to operate correctly, specify the same VSRP instance in this command and in the ipv6 subscriber vsrp-instance or the ipv6 dhcp vsrp-instance command. If different VSRP instances are specified, the hosts in the LAN cannot access the Internet after a master and backup switchover.
For the original link local address of the device to take effect, do not use this command when VSRP is disabled for IPv6 IPoE or DHCPv6 on the interface.
To enable VSRP to operate correctly, do not use this command on the same interface where a VRRP group is configured.
Examples
# Specify virtual IPv6 address fe80::10 for Ten-GigabitEthernet 3/1/1 that is associated with VSRP instance aaa.
<Sysname> system-view
[Sysname] interface ten-gigabitethernet 3/1/1
[Sysname-Ten-GigabitEthernet3/1/1] ipv6 virtual-address fe80::10 vsrp aaa
Protection tunnel commands
protect lsp-tunnel for-all-instance
Use protect lsp-tunnel for-all-instance to specify the destination address of LSP protection tunnels.
Use undo protect lsp-tunnel for-all-instance to delete the destination address of LSP protection tunnels.
Syntax
protect lsp-tunnel for-all-instance peer-ip ip-address [ tunnel-policy policy-name ]
undo protect lsp-tunnel for-all-instance peer-ip
Default
No LSP protection tunnel destination address is configured.
Views
VSRP peer view
Predefined user roles
network-admin
Parameters
peer-ip ip-address: Specifies a tunnel destination address.
tunnel-policy tunnel-policy-name: Specifies a tunnel policy name, a case-sensitive string of 1 to 126 characters. If you do not specify a tunnel policy, the default tunnel policy is applied to the LSP protection tunnels.
Usage guidelines
To ensure service continuity when the access-side link of the master fails, the master forwards the traffic sent from the external network to users towards the backup over an LSP protection tunnel. The backup then forwards the traffic to the destination.
The master and the backup set up LSP protection tunnels for the public instance and each VPN instance. The LSP protection tunnel for the public instance is set up after you finish LSP protection tunnel configuration, while the LSP protection tunnel for a VPN instance is set up on demand.
Examples
# Specify the destination address of LSP protection tunnels as 1.1.1.1 in VSRP peer view of VSRP group 1.
<Sysname> system-view
[Sysname] vsrp peer 1
[Sysname-vsrp-peer-1] protect lsp-tunnel for-all-instance peer-ip 1.1.1.1
protect srv6-tunnel for-all-instance
Use protect srv6-tunnel for-all-instance to specify a locator for SRv6 protection tunnels.
Use undo protect srv6-tunnel for-all-instance to restore the default.
Syntax
protect srv6-tunnel for-all-instance locator locator-name
undo protect srv6-tunnel for-all-instance locator
Default
No SRv6 protection tunnels exist.
Views
VSRP peer view
Predefined user roles
network-admin
Parameters
locator locator-name: Specifies a locator by its name, a case-sensitive string of 1 to 31 characters.
Usage guidelines
To ensure service continuity when the access-side link of the master fails, the master forwards the traffic sent from the external network to users towards the backup over an SRv6 protection tunnel. The backup then forwards the traffic to the destination.
The master and the backup set up SRv6 protection tunnels for the public instance and each VPN instance. The SRv6 protection tunnel for the public instance is set up after you finish SRv6 protection tunnel configuration, while the SRv6 protection tunnel for a VPN instance is set up on demand.
Examples
# Specify the locator for SRv6 protection tunnels as a in VSRP peer view of VSRP group 1.
<Sysname> system-view
[Sysname] vsrp peer 1
[Sysname-vsrp-peer-1] protect srv6-tunnel for-all-instance locator a
Related commands
locator (Segment Routing Command Reference)