- Table of Contents
- Related Documents
-
Title | Size | Download |
---|---|---|
03-VRRP Commands | 70.03 KB |
Table of Contents
Chapter 1 VRRP Configuration Commands
1.1 VRRP Configuration Commands
1.1.11 vrrp vrid authentication-mode
Chapter 1 VRRP Configuration Commands
1.1 VRRP Configuration Commands
1.1.1 debugging vrrp
Syntax
debugging vrrp { state | packet [ interface number ] | error }
undo debugging vrrp { state | packet | error }
View
User view
Parameters
state: Enables VRRP state debugging.
packet: Enables VRRP packet debugging.
error: Enables VRRP error debugging.
interface number: Specifies an interface by its number.
Description
Use the debugging vrrp command to enable specified VRRP debugging.
Use the undo debugging vrrp command to disable specified VRRP debugging.
By default, no VRRP debugging is enabled.
Examples
# Enable VRRP state debugging.
<H3C> debugging vrrp state
1.1.2 display vrrp
Syntax
display vrrp [ interface vlan-interface interface-number [ virtual-route-identifier ifm | ifm | vrid virtual-router-id ] ]
View
Any view
Parameters
vlan-interface: Displays the VRRP status information of a specified interface.
interface-number: Specifies an interface by its number.
virtual-route-identifier: VRRP virtual router ID.
ifm: Displays the configuration information of the IP forwarding module (IFM) device that runs VRRP.
vrid: Displays information about a specified virtual router.
virtual-router-id: VRRP virtual router ID.
Description
Use the display vrrp command to display the summary information of VRRP.
If neither interface-number nor virtual-router-id is specified, the system displays the status information of all virtual routers on the device. If only interface-number is specified, the system displays the status information of all virtual routers on this interface. If both interface-number and virtual-router-id are specified, the system displays the status information of the specified virtual router on the interface.
Examples
# Display the summary information of virtual routers on the Switch.
<H3C> display vrrp
Run Method : VIRTUAL-MAC
Virtual Ip Ping : Disable
The total number of the virtual routers: 64
VLANID VRID State Run Adver. Auth Virtual
Pri Time Type IP
--------------------------------------------------------------------------
2 2 Initialize 100 1 NONE 2.2.2.192
3 3 Initialize 100 1 NONE 3.3.3.192
4 4 Initialize 100 1 NONE 4.4.4.192
5 5 Initialize 100 1 NONE 5.5.5.192
6 6 Initialize 100 1 NONE 6.6.6.192
7 7 Initialize 100 1 NONE 7.7.7.192
8 8 Initialize 100 1 NONE 8.8.8.192
9 9 Initialize 100 1 NONE 9.9.9.192
10 10 Initialize 100 1 NONE 10.10.10.192
11 11 Initialize 100 1 NONE 11.11.11.192
12 12 Initialize 100 1 NONE 12.12.12.192
13 13 Initialize 100 1 NONE 13.13.13.192
14 14 Initialize 100 1 NONE 14.14.14.192
15 15 Initialize 100 1 NONE 15.15.15.192
16 16 Initialize 100 1 NONE 16.16.16.192
17 17 Initialize 100 1 NONE 17.17.17.192
Table 1-1 Description on the fields of the display vrrp command
Field |
Description |
Run Method |
Mapping mode (real/virtual MAC) |
Virtual IP ping |
Whether pinging the virtual IP address is enabled or not |
VRID |
ID of the virtual router |
State |
Running state of the virtual router |
Run Pri |
Running priority |
Adver.Timer |
Interval for sending VRRP packets |
Auth Type |
Type of authentication |
Virtual IP |
Virtual IP address list of the virtual router |
1.1.3 display vrrp ifm
display vrrp ifm
View
Any view
Parameters
None
Description
Use the display vrrp ifm command to display the VRRP IFM configuration information.
Examples
# Display the VRRP IFM configuration information.
<H3C> display vrrp ifm
Interface : Vlan-interface1000
VRID : 1
Track IFM increased value : 20
IFM Connecting Status :
CPU ID State
========== ================
1 Master
2 Backup
1.1.4 display vrrp statistics
Syntax
display vrrp statistics [ interface vlan-interface interface-number [ vrid virtual-router-id ] ]
View
Any view
Parameters
vlan-interface interface-number: Specifies the name of the VLAN interface to which the virtual router belongs.
virtual-router-id: VRRP virtual router ID, ranging from 1 to 255.
Description
Use the display vrrp statistics command to display the VRRP statistics.
If the interface name and virtual router ID are not specified, the statistics information about all the virtual routers on the switch will be displayed. If only the interface name is specified, the statistics information about all the virtual routers on the interface will be displayed. If the interface name and virtual router ID are specified, the statistics information about the specified virtual router on the interface will be displayed.
Examples
# Display the VRRP statistics information on VLAN-interface 2.
<H3C> display vrrp statistics interface vlan-interface 2
Interface : Vlan-interface2
VRID : 1
CheckSum Errors : 0 Version Errors : 0
VRID Errors : 0 Advertisement Interval Errors : 0
IP TTL Errors : 0 Auth Failures : 0
Invalid Auth Type : 0 Auth Type Mismatch : 0
Packet Length Errors : 0 Address List Errors : 0
Become Master : 0 Priority Zero Pkts Rcvd : 0
Advertise Rcvd : 0 Priority Zero Pkts Sent : 0
Advertise Sent : 0 Invalid Type Pkts Rcvd : 0
Table 1-2 Description on the fields of the display vrrp statistics command
Field |
Description |
Interface |
Interface to which the virtual router is attached |
VRID |
ID of the virtual router |
CheckSum Errors |
Number of checksum errors |
Version Errors |
Number of version errors |
VRID Errors |
Number of VRID errors |
Advertisement Interval Errors |
Number of ADVERTISEMENT interval errors |
IP TTL Errors |
Number of TTL errors |
Auth Failures |
Number of authentication failures |
Invalid Auth Type |
Number of invalid authentication types |
Auth Type Mismatch |
Number of times the authentication type is mismatched |
Packet Length Errors |
Number of VRRP packet length errors |
Address List Errors |
Number of virtual IP address list errors |
Become Master |
Number of times of becoming the master |
Priority Zero Pkts Rcvd |
Number of received ADVERTISEMENT packets with a priority of 0 |
Advertise Rcvd |
Number of received ADVERTISEMENT packets |
Priority Zero Pkts Sent |
Number of sent ADVERTISEMENT packets with a priority of 0 |
Invalid Type Pkts Rcvd |
Number of invalid packet types |
1.1.5 display vrrp verbose
Syntax
display vrrp verbose [ interface type number [ vrid virtual-router-id ] ]
View
Any view
Parameters
verbose: Displays detailed VRRP information.
interface: Displays the VRRP status information of the specified interface.
type: Interface type.
number: Interface number.
vrid: Displays the VRRP status information of the specified VRID.
virtual-router-id: Number of a VRRP virtual router, in the range of 1 to 255.
Description
Use the display vrrp verbose command to display detailed VRRP information.
If neither interface-number nor virtual-router-id is specified, the system displays the status information of all virtual routers on the switch. If only interface-number is specified, the system displays the status information of all virtual routers on this interface. If both interface-number and virtual-router-id are specified, the system displays the status information of the specified virtual router on the interface.
Examples
# Display the VRRP status information on VLAN-interface 1 of the switch.
[H3C-Vlan-interface1] display vrrp verbose interface vlan-interface 1
Run Method : VIRTUAL-MAC
Virtual Ip Ping : Disable
Interface : Vlan-interface1
VRID : 1 Adver. Timer : 1
Admin Status : UP State : Initialize
Config Pri : 100 Run Pri : 90
Preempt Mode : YES Delay Time : 0
Auth Type : NONE
Virtual IP : 1.1.1.1
Master IP : 0.0.0.0
Table 1-3 Description on the fields of the display vrrp verbose command
Field |
Description |
Run Method |
Mapping mode (real/virtual MAC) |
Virtual IP ping |
Whether pinging the virtual IP address is enabled |
Interface |
Interface where the virtual router is located |
VRID |
ID of the virtual router |
Adver.Timer |
Interval at which a VRRP packet is sent |
Admin Status |
Control status of the virtual router |
State |
Running status of the virtual router |
Config Pri |
Configured priority |
Run Pri |
Running priority |
Preempt Mode |
Preemption mode |
Delay Time |
Delay time |
Auth Type |
Type of authentication |
Virtual IP |
Virtual IP address list of the virtual router |
Master IP |
IP address of the master of the VRRP group |
1.1.6 reset vrrp statistics
Syntax
reset vrrp statistics [ interface vlan-interface interface-number [ vrid virtual-router-id ] ]
View
User view
Parameters
statistics: VRRP statistics.
vlan-interface interface-number: Specifies a VLAN interface.
virtual-router-id: ID of the VRRP virtual router, ranging from 1 to 255.
Description
Use the reset vrrp statistics command to clear VRRP statistics.
If neither interface-number nor virtual-router-id is specified, the system clears the statistics of all virtual routers on the Switch. If only interface-number is specified, the system clears the statistics of all virtual routers on this interface. If both interface-number and virtual-router-id are specified, the system clears the statistics of the specified virtual router on the interface.
Examples
# Clear the VRRP statistics of all virtual routers on all interfaces.
<H3C> reset vrrp statistics
1.1.7 vrrp log-state
vrrp log-state
undo vrrp log-state
View
System view
Parameters
None
Description
Use the vrrp log-state command to enable the logging of VRRP group state changes.
Use the undo vrrp log-state command to disable the logging.
Note that if you enable VRRP debugging after executing the vrrp log-state command, the system does not output the log information of the VRRP group state changes because the information is the same as the debugging information.
By default, the logging of VRRP group state changes is disabled.
Examples
# Enable the logging of VRRP group state changes.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] vrrp log-state
1.1.8 vrrp method
Syntax
vrrp method { real-mac | virtual-mac }
undo vrrp method
View
System view
Parameters
real-mac: Maps the real MAC address of the interface to the virtual IP address.
virtual-mac: Maps the virtual MAC address to the virtual IP address.
Description
Use vrrp method command to specify a mapping mode, either between the real MAC address and the virtual IP address, or between the virtual MAC address and the virtual IP address.
Use the undo vrrp method command to restore the default.
By default, the switch maps the virtual MAC address to the IP address of the virtual router.
Due to the chips installed, some switches support mapping one IP address to multiple MAC addresses. You can specify a mapping mode as needed.
Note that:
You should specify the mapping mode before configuring the virtual router. Otherwise, you cannot specify the mapping mode.
Examples
# Specify the mapping mode between the real MAC address of the interface and the virtual IP address of the virtual router.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] vrrp method real-mac
1.1.9 vrrp ping-enable
Syntax
vrrp ping-enable
undo vrrp ping-enable
View
System view
Parameters
None
Description
Use vrrp ping-enable command to enable the function to ping the virtual IP address of the virtual router.
Use the undo vrrp ping-enable command to disable the function.
With this function enabled, you can ping the virtual IP address of the virtual router or telnet to the virtual IP address of the virtual router.
By default, the ping function is enabled, that is, you can ping or telnet to the virtual IP address of the virtual router.
Note that:
You can only enable the function before configuring the virtual router. If a virtual router is already configured on the switch, it is not allowed to modify the configuration any more.
Examples
# Enable pinging the virtual IP address of the virtual router.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] vrrp ping-enable
1.1.10 vrrp un-check ttl
Syntax
vrrp un-check ttl
undo vrrp un-check ttl
View
VLAN interface view
Parameters
None
Description
Use the vrrp un-check ttl command to disable the check of the TTL value of VRRP packets. Use the undo vrrp un-check ttl command to enable the check of the TTL value of VRRP packets.
The TTL value of VRRP packets must be 225. If the TTL of a received VRRP packet is not 225, the packet will be discarded.
By default, the switch checks the TTL value of VRRP packets.
Examples
# Disable checking the TTL value of VRRP packets.
[H3C-vlan-interface2] vrrp un-check ttl
1.1.11 vrrp vrid authentication-mode
Syntax
vrrp vrid virtual-router-id authentication-mode { md5 | simple } key
undo vrrp vrid virtual-router-id authentication-mode
View
VLAN interface view
Parameters
virtual-router-id: VRRP virtual router ID, in the range 1 to 255.
simple: Simple authentication mode.
md5: MD5 authentication mode.
key: Authentication key. When the simple authentication mode is adopted, the key is a string of 1 to 8 plain-text characters. When the MD5 authentication mode is adopted, it is a plain-text key or MD5 ciphertext key; a plain-text key is a string of 1 to 8 characters, for example, 1234567; an MD5 ciphertext key is 24 characters in length and must be entered in ciphertext, for example, _(TT8F]Y\5SQ=^Q`MAF4<1!!.
Note that you can set different authentication modes and authentication keys for different VRRP groups on an interface. You need to set the same authentication mode and authentication key for the members of a VRRP group.
Description
Use the vrrp vird authentication-mode command to set an authentication mode and authentication key for a VRRP virtual router on an interface. Use the undo vrrp vrid authentication-mode command to remove the setting.
By default, no authentication is configured.
Note that an authentication key is case sensitive.
Examples
# Set authentication mode simple and authentication key H3C for VRRP virtual router 1 on VLAN-interface 2.
<H3C> system-view
[H3C] interface vlan-interface 2
[H3C-Vlan-interface2] vrrp vrid 1 authentication-mode simple H3C
1.1.12 vrrp vrid fast-switch
Sytax
vrrp vrid virtual-router-id fast-switch
undo vrrp vrid virtual-router-id fast-switch
View
VLAN interface view
Parameters
virtual-router-id: VRRP virtual router ID, in the range 1 to 255.
Description
Use the vrrp vrid fast-switch command to enable the fast switch function for a virtual router in backup state.
Use the undo vrrp vrid fast-switch command disable the function.
By default, the fast switch function for a virtual router in backup state is disabled.
& Note:
After the vrrp vrid fast-switch command is executed, the vrrp vrid virtual-router-id preempt-mode timer command does not take effect.
Examples
# Enable the fast switch function on VLAN-interface 30.
<H3C> system-view
[H3C] interface vlan-interface 30
[H3C-Vlan-interface30] vrrp vrid 1 fast-switch
1.1.13 vrrp vrid monitor
Syntax
vrrp vrid virtual-router-id monitor { interface interface-type interface-number | link-aggregation group group-id }
undo vrrp vrid virtual-router-id monitor
View
VLAN interface view
Parameters
virtual-router-id: VRRP virtual router ID, in the range 1 to 255.
interface interface-type interface-number: Specifies an interface.
group group-id: Specifies an aggregation group ID, in the range 1 to 31.
Description
Use the vrrp vrid monitor command to enable the virtual router to monitor the specified link.
Use the undo vrrp vrid monitor command to disable the function.
By default, the link monitoring function is disabled.
& Note:
After the vrrp vrid monitor command is executed, the vrrp vrid virtual-router-id preempt-mode timer command does not take effect.
Examples
# Enable monitoring interface GigabitEthernet1/1/1 of virtual router 1.
<H3C> system-view
[H3C] interface vlan-interface 30
[H3C-Vlan-interface30] vrrp vrid 1 monitor interface gigabitethernet 1/1/1
# Enable monitoring link aggregation group 2 of virtual router 1.
<H3C> system-view
[H3C] interface vlan-interface 30
[H3C-Vlan-interface30] vrrp vrid 1 monitor link-aggregation group 2
[H3C-Vlan-interface30] quit
[H3C] link-status hold 0
1.1.14 vrrp vrid preempt-mode
Syntax
vrrp vrid virtual-router-id preempt-mode [ timer delay delay-value ]
undo vrrp vrid virtual-router-id preempt-mode
View
VLAN interface view
Parameters
virtual-router-id: VRRP virtual router ID, ranging from 1 to 255.
delay-value: Delay in seconds, ranging from 0 to 255.
Description
Use the vrrp vrid preempt-mode command to enable the preemption mode and specify the preemption delay.
Use the undo vrrp vrid preempt-mode command to disable preemption.
By default, a virtual router is in preemption mode and the delay-value is 0 seconds.
If a higher-priority switch is required to preempt the master, you need to configure the preempt mode for it. You can also set a delay for the preemption. If you configure it not to preempt, the delay will be set to 0 automatically.
& Note:
After the vrrp vrid fast-switch command or/and vrrp vrid monitor command are executed, the vrrp vrid virtual-router-id preempt-mode timer command does not take effect.
Examples
# Configure the switch to preempt.
[H3C-vlan-interface2] vrrp vrid 1 preempt-mode
# Set a delay.
[H3C-vlan-interface2] vrrp vrid 1 preempt-mode timer delay 5
# Configure the switch not to preempt.
[H3C-vlan-interface2] undo vrrp vrid 1 preempt-mode
1.1.15 vrrp vrid priority
Syntax
vrrp vrid virtual-router-id priority priority
undo vrrp vrid virtual-router-id priority
View
VLAN interface view
Parameters
virtual-router-id: VRRP virtual router ID, ranging from 1 to 255.
priority: Priority value, ranging from 1 to 254; By default, the priority value is 100.
Description
Use the vrrp vrid priority command to configure a priority for the virtual router.
Use the undo vrrp vrid priority command to remove the priority.
The priority determines the status of a switch in the VRRP group. A higher-priority switch is more likely to be the master. Priority 0 is reserved for some special purpose. 255 is reserved for the IP address owner. The priority of the IP address owner is always 255 and cannot be modified.
Examples
# Set a priority of 120 for virtual router 1 on VLAN-interface 2.
[H3C-vlan-interface2] vrrp vrid 1 priority 120
1.1.16 vrrp vrid timer
Syntax
vrrp vrid virtual-router-id timer advertise adver-interval
undo vrrp vrid virtual-router-id timer advertise
View
VLAN interface view
Parameters
virtual-router-id: VRRP virtual router ID, ranging from 1 to 255.
adver-interval: Interval for sending VRRP packets on the master in seconds, ranging from 1 to 255; By default, the value is 1.
Description
Use the vrrp vrid timer command to set an interval for sending VRRP packets on the master.
Use the undo vrrp vrid timer advertise command to restore the default value.
The same interval must be set for members in a VRRP group.
Examples
# Configure the master to transmit VRRP packets every 15 seconds.
[H3C-vlan-interface2] vrrp vrid 1 timer advertise 15
1.1.17 vrrp vrid track
Syntax
vrrp vrid virtual-router-id track { ifm [ increased value-increased ] | interface vlan-interface vlan-id [ reduced value-reduced ] }
undo vrrp vrid virtual-router-id track { ifm | interface vlan-interface vlan-id }
View
VLAN interface view
Parameters
virtual-router-id: VRRP virtual router ID, ranging from 1 to 255.
ifm: Tracks the IFM device.
increased: Increases the priority of the virtual router.
value-increased: Increased priority, ranging from 1 to 254. The default value is 2.
vlan-interface vlan-id: Interface to be tracked.
reduced: Reduces the priority of the virtual router.
value-reduced: Reduced priority, ranging from 1 to 255. The default value is 10.
Description
Use the vrrp vrid track command to configure the switch to track an interface.
Use the undo vrrp vrid track command to stop tracking the specified interface.
The VRRP interface tracking function extends the backup function by implementing backup not only when the switch fails, but also when a network interface is down. You can use this command to track or stop tracking an interface or all interfaces. After the command is configured, the priority of the switch will be reduced if the state of the tracked interface goes down. Accordingly, another switch in the virtual router will have the comparatively highest priority and become the new master. Each virtual router can track up to eight interfaces.
& Note:
l If the switch is an IP address owner, you cannot configure the interface tracking function for it.
l When the state of a tracked interface is changed from down to up, the corresponding priority of the switch will be automatically restored.
l On the switch, both VLAN interfaces and Layer 3 Ethernet interfaces can be tracked.
Examples
# Configure VLAN-interface 2 to track VLAN-interface 1. When VLAN-interface 1 is down, the priority of virtual router 1 on VLAN-interface 2 will be reduced by 50.
<H3C> system-view
[H3C] interface vlan-interface 2
[H3C-Vlan-interface2] vrrp vrid 1 track interface vlan-interface 1 reduced 50
1.1.18 vrrp vrid virtual-ip
Syntax
vrrp vrid virtual-router-id virtual-ip ip-address
undo vrrp vrid virtual-router-id [ virtual-ip virtual-address ]
View
VLAN interface view
Parameters
virtual-router-id: VRRP virtual router ID, ranging from 1 to 255.
ip-address: Virtual IP address.
Description
Use the vrrp vrid virtual-ip command to create a virtual router or add a virtual IP address for an existing virtual router.
Use the undo vrrp vrid virtual-ip command to remove an existing virtual router or an address from the virtual router.
You can configure up to 16 virtual IP addresses for a virtual router.
If all of the addresses of a virtual router are deleted, the system will delete the virtual router automatically.
Examples
# Create a virtual router.
[H3C-vlan-interface2] vrrp vrid 1 virtual-ip 10.10.10.10
# Add a virtual IP address for the virtual router.
[H3C-vlan-interface2] vrrp vrid 1 virtual-ip 10.10.10.11
# Delete a virtual IP address.
[H3C-vlan-interface2] undo vrrp vrid 1 virtual-ip 10.10.10.10
# Delete a virtual router.
[H3C-vlan-interface2] undo vrrp vrid 1