- Table of Contents
-
- H3C WX3000 Series Unified Switches Switching Engine Command Reference-6W103
- 00-Preface
- 01-CLI Command
- 02-Login Command
- 03-Configuration File Management Command
- 04-VLAN Command
- 05-Auto Detect Command
- 06-Voice VLAN Command
- 07-GVRP Command
- 08-Basic Port Configuration Command
- 09-Link Aggregation Command
- 10-Port Isolation Command
- 11-Port Security-Port Binding Command
- 12-DLDP Command
- 13-MAC Address Table Management Command
- 14-MSTP Command
- 15-802.1x and System Guard Command
- 16-AAA Command
- 17-MAC Address Authentication Command
- 18-IP Address and Performance Command
- 19-DHCP Command
- 20-ACL Command
- 21-QoS-QoS Profile Command
- 22-Mirroring Command
- 23-ARP Command
- 24-SNMP-RMON Command
- 25-Multicast Command
- 26-NTP Command
- 27-SSH Command
- 28-File System Management Command
- 29-FTP-SFTP-TFTP Command
- 30-Information Center Command
- 31-System Maintenance and Debugging Command
- 32-VLAN-VPN Command
- 33-HWPing Command
- 34-DNS Command
- 35-Smart Link-Monitor Link Command
- 36-PoE-PoE Profile Command
- 37-Routing Protocol Command
- 38-UDP Helper Command
- 39-Index
- Related Documents
-
Title | Size | Download |
---|---|---|
03-Configuration File Management Command | 66.99 KB |
Table of Contents
1 Configuration File Management Commands
File Attribute Configuration Commands
display current-configuration vlan
File path and file name can be represented in one of the following ways:
l In universal resource locator (URL) format and starting with “unit1>flash:/”. or “flash:/” This method is used to specify a file in the current Flash memory. For example, the URL of the file named text.txt in the root directory of the device is unit1>flash:/text.txt;
l Inputting the path name or file name directly. This method can be used to specify the path to go to or a file in the current work directory.
File Attribute Configuration Commands
display current-configuration
Syntax
display current-configuration [ configuration [ configuration-type ] | interface [ interface-type ] [ interface-number ] ] [ by-linenum ] [ | { begin | include | exclude } regular-expression ]
View
Any view
Parameters
configuration configuration-type: Specifies to display non-interface configuration. If configuration-type is not specified, all the non-interface configurations are displayed; if configuration-type is specified, the specified type of configuration is displayed. The configuration type you can specify is based on your current configuration. For example:
l acl-adv: Indicates the advanced access control list (ACL) configuration.
l acl-basic: Indicates the basic ACL configuration.
l acl-ethernetframe: Indicates the Layer 2 ACL configuration.
l hwping: Indicates the HWPing configuration.
l isp: Indicates the internet service provider configuration.
l radius-template: Indicates the radius template configuration.
l system: Indicates the system configuration.
l user-interface: Indicates the user interface configuration.
interface: Displays port/interface configuration.
interface-type: Port/interface type, which can be one of the following: Aux, GigabitEthernet, Loopback, NULL and VLAN-interface.
interface-number: Port/interface number.
by-linenum: Displays configuration information with line numbers.
|: Uses a regular expression to filter the configuration of the device to be displayed.
begin: Displays the configuration starting with the string specified by the regular-expression argument.
include: Displays the configuration including the string specified by the regular-expression argument.
exclude: Displays the configuration not including the string specified by the regular-expression argument.
regular-expression: A regular expression. Refer to Table 1-1 for details.
Table 1-1 Special characters in regular expression
Character |
Meaning |
Note |
^ |
Starting sign, the regular expression matches lines starting with the specified string. |
Regular expression “^user” matches a line begins with “user”, not “Auser”. |
$ |
Ending sign, the regular expression matches lines ending with the specified string. |
Regular expression "user$” matches a line ends with “user”, not “userA”. |
. |
Full stop, a wildcard used in place of any character, including blank |
None |
* |
Asterisk, the character to the left of the asterisk in the expression should match zero or more consecutive times. |
zo* can match “z” and “zoo”, and so on, but not “zo”. |
+ |
Plus sign, the character to the left of the plus sign in the expression should match one or more consecutive times. |
zo+ can match “zo” and “zoo”, and so on, but not “z”. |
- |
Hyphen. It connects two values (the smaller one before it and the bigger one after it) to indicate a range together with [ ]. |
For example, “1-9” means numbers from 1 to 9 (inclusive); “a-h” means from a to h (inclusive). |
[ ] |
Square brackets. Selects one character from the group. |
For example, [1-36A] can match only one character among 1, 2, 3, 6, and A. |
( ) |
Parenthesis. Specifies a group of characters. It is usually used with “+” or “*”. |
For example, (123A) means a string “123A”; “408(12)+” can match 40812 or 408121212. But it cannot match 408. That is, “12” can appear continuously and it must at least appear once. |
Description
Use the display current-configuration command to display the current configuration of the device.
After you finish a set of configurations, you can execute the display current-configuration command to display the parameters that take effect currently.
Note that:
l Parameters that are the same as the default are not displayed.
l The configured parameter whose corresponding function does not take effect is not displayed.
Related commands: save, reset saved-configuration, display saved-configuration.
Examples
# Display configuration information about the currently effective interfaces on the device.
<device> display current-configuration interface
#
interface Vlan-interface1
ip address 192.168.0.54 255.255.255.0
ntp-service broadcast-server
#
interface Aux1/0/0
#
interface GigabitEthernet1/0/1
line-rate inbound 128
#
interface GigabitEthernet1/0/2
#
interface GigabitEthernet1/0/3
#
interface GigabitEthernet1/0/4
line-rate inbound 8
#
interface GigabitEthernet1/0/5
#
interface GigabitEthernet1/0/6
#
interface GigabitEthernet1/0/7
#
interface GigabitEthernet1/0/8
#
interface GigabitEthernet1/0/9
#
interface GigabitEthernet1/0/10
#
interface GigabitEthernet1/0/11
#
interface GigabitEthernet1/0/12
#
interface GigabitEthernet1/0/13
#
interface GigabitEthernet1/0/14
#
interface GigabitEthernet1/0/15
#
interface GigabitEthernet1/0/16
#
interface GigabitEthernet1/0/17
#
interface GigabitEthernet1/0/18
#
interface GigabitEthernet1/0/19
#
interface GigabitEthernet1/0/20
#
interface GigabitEthernet1/0/21
#
interface GigabitEthernet1/0/22
#
interface GigabitEthernet1/0/23
#
interface GigabitEthernet1/0/24
#
interface GigabitEthernet1/0/25
shutdown
#
interface GigabitEthernet1/0/26
shutdown
#
interface GigabitEthernet1/0/27
shutdown
#
interface GigabitEthernet1/0/28
shutdown
#
interface GigabitEthernet1/0/29
stp disable
#
interface NULL0
#
interface LoopBack0
#
return
# Display the lines that include the strings matching “10*” in the configuration information. (The character “*” means that the character 0 in the string before it can appear multiple times or does not appear.)
<device> display current-configuration | include 10*
vlan 1
interface Vlan-interface1
ip address 192.168.0.54 255.255.255.0
ntp-service unicast-peer 192.168.0.65
ntp-service unicast-server 192.168.0.68
interface Aux1/0/0
interface GigabitEthernet1/0/1
line-rate inbound 128
interface GigabitEthernet1/0/2
interface GigabitEthernet1/0/3
interface GigabitEthernet1/0/4
interface GigabitEthernet1/0/5
interface GigabitEthernet1/0/6
interface GigabitEthernet1/0/7
interface GigabitEthernet1/0/8
interface GigabitEthernet1/0/9
interface GigabitEthernet1/0/10
interface GigabitEthernet1/0/11
interface GigabitEthernet1/0/12
interface GigabitEthernet1/0/13
interface GigabitEthernet1/0/14
interface GigabitEthernet1/0/15
interface GigabitEthernet1/0/16
interface GigabitEthernet1/0/17
interface GigabitEthernet1/0/18
interface GigabitEthernet1/0/19
interface GigabitEthernet1/0/20
interface GigabitEthernet1/0/21
interface GigabitEthernet1/0/22
interface GigabitEthernet1/0/23
interface GigabitEthernet1/0/24
interface GigabitEthernet1/0/25
interface GigabitEthernet1/0/26
interface GigabitEthernet1/0/27
interface GigabitEthernet1/0/28
interface GigabitEthernet1/0/29
# Display the configuration information starting with the string “user”.
<device> display current-configuration | include ^user
user-interface aux 0
user-interface vty 0 4
display current-configuration vlan
Syntax
display current-configuration vlan [ vlan-id ] [ by-linenum ]
View
Any view
Parameters
vlan vlan-id: VLAN ID, in the range 1 to 4094.
by-linenum: Displays configuration information with line numbers.
Description
Use the display current-configuration vlan command to display the current VLAN configuration of the device.
Without the vlan-id argument specified, this command displays configuration information about all the VLANs that exist on the device.
Note that if there are contiguous VLANs without any configuration, the system combines these VLANs together when displaying the VLAN configuration information.
Related commands: save, reset saved-configuration, display saved-configuration.
Examples
# Display the current VLAN configuration information of the device.
<device> display current-configuration vlan
#
vlan 1
#
vlan 100 to 200
#
return
display saved-configuration
Syntax
display saved-configuration [ unit unit-id ] [ by-linenum ]
View
Any view
Parameters
unit unit-id: Specifies the unit ID of the device.
by-linenum: Displays configuration information with line numbers.
Description
Use the display saved-configuration command to display the initial configuration file saved in the storage device.
If the device starts up without a configuration file, the system will display that no configuration file exists upon execution of the command. If you have saved configuration after the device starts up, the command displays the last saved configuration.
Related commands: save, reset saved-configuration, display current-configuration.
Examples
# Display the initial configuration file saved in the storage device.
<device> display saved-configuration
#
sysname device
#
radius scheme system
#
domain system
#
vlan 1
#
interface Vlan-interface1
ip address 192.168.0.54 255.255.255.0
#LOCCFG. MUST NOT DELETE
#
interface Aux1/0/0
#
interface GigabitEthernet1/0/1
#
interface GigabitEthernet1/0/2
#
interface GigabitEthernet1/0/3
#
interface GigabitEthernet1/0/4
#
interface GigabitEthernet1/0/5
#
interface GigabitEthernet1/0/6
#
interface GigabitEthernet1/0/7
#
interface GigabitEthernet1/0/8
#
interface GigabitEthernet1/0/9
#
interface GigabitEthernet1/0/10
#
interface GigabitEthernet1/0/11
#
interface GigabitEthernet1/0/12
#
interface GigabitEthernet1/0/13
#
interface GigabitEthernet1/0/14
#
interface GigabitEthernet1/0/15
#
interface GigabitEthernet1/0/16
#
interface GigabitEthernet1/0/17
#
interface GigabitEthernet1/0/18
#
interface GigabitEthernet1/0/19
#
interface GigabitEthernet1/0/20
#
interface GigabitEthernet1/0/21
#
interface GigabitEthernet1/0/22
#
interface GigabitEthernet1/0/23
#
interface GigabitEthernet1/0/24
#
interface GigabitEthernet1/0/25
shutdown
#
interface GigabitEthernet1/0/26
shutdown
#
interface GigabitEthernet1/0/27
shutdown
#
interface GigabitEthernet1/0/28
shutdown
#
interface GigabitEthernet1/0/29
stp disable
#TOPOLOGYCFG. MUST NOT DELETE
#GLBCFG. MUST NOT DELETE
#
interface NULL0
#
user-interface aux 0
user-interface vty 0 4
authentication-mode none
user privilege level 3
#
return
The configuration information output above in turn is the system configuration, logical interface configuration, physical port configuration, and user interface configuration.
display startup
Syntax
display startup [ unit unit-id ]
View
Any view
Parameters
unit unit-id: Specifies the unit ID of a device. It only can be 1.
Description
Use the display startup command to display the startup configuration of a device.
Related commands: startup saved-configuration.
Examples
# Display the startup configuration files of the device.
<device> display startup
UNIT1:
Current Startup saved-configuration file: flash:/startup.cfg
Next main startup saved-configuration file: flash:/startup.cfg
Next backup startup saved-configuration file: NULL
Table 1-2 display startup command output description
Field |
Description |
Current Startup saved-configuration file |
The configuration file used for the current startup |
Next main startup saved-configuration file |
The main configuration file used for the next startup |
Next backup startup saved-configuration file |
The backup configuration file used for the next startup |
display this
Syntax
display this [ by-linenum ]
View
Any view
Parameters
by-linenum: Displays configuration information with line numbers.
Description
Use the display this command to display the current configuration performed in the current view. To verify the configuration performed in a view, you can use this command to display the parameters that are valid in the current view.
Note that:
l Parameters that are the same as the default are not displayed.
l The configured parameter whose corresponding function does not take effect is not displayed.
l Execution of this command in any user interface view displays the valid configuration parameters in all user interfaces.
Related commands: save, reset saved-configuration, display saved-configuration, display current-configuration.
Examples
# Display the configuration parameters that take effect in all user interface views.
<device> system-view
System View: return to User View with Ctrl+Z.
[device] user-interface aux 0
[device-ui-aux0] display this
#
user-interface aux 0
user-interface vty 0 4
authentication-mode none
user privilege level 3
#
return
reset saved-configuration
Syntax
reset saved-configuration [ backup | main ]
View
User view
Parameters
backup: Erases the backup configuration file.
main: Erases the main configuration file.
Description
Use the reset saved-configuration command to erase the configuration file saved in the storage device.
The following two situations exist:
l While the reset saved-configuration [ main ] command erases the configuration file with main attribute, it only erases the main attribute of a configuration file having both main and backup attribute.
l While the reset saved-configuration backup command erases the configuration file with backup attribute, it only erases the backup attribute of a configuration file having both main and backup attribute.
You may need to erase the configuration file for one of these reasons:
l After you upgrade software, the old configuration file does not match the new software.
l The startup configuration file is corrupted or not the one you need.
l This command will permanently delete the configuration file from the device.
l An error occurs when you execute this command if the configuration file to be erased does not exist.
Related commands: save.
Examples
# Erase the main configuration file to be used in the next startup.
<device> reset saved-configuration main
The saved configuration will be erased.
Are you sure?[Y/N]y
Configuration in flash memory is being cleared.
Please wait ...
....
Unit1 reset saved-configuration successfully.
save
Syntax
save [ cfgfile | [ safely ] [ backup | main ] ]
View
Any view
Parameters
cfgfile: Path name or file name of a configuration file in the flash, a string of 5 to 56 characters.
safely: Saves the current configuration in the safe mode.
backup: Saves the configuration to the backup configuration file.
main: Saves the configuration to the main configuration file.
Description
Use the save command to save the current configuration to a configuration file in the flash.
When you use this command to save the configuration file,
l If the main and backup keywords are not specified, the current configuration will be saved to the main configuration file.
l If the cfgfile argument is specified, but the file specified by it does not exist, the system will create the file and then save the current configuration to it. The file attribute is neither main nor backup.
l If the cfgfile argument is specified and the file specified by it exists, the system will save the current configuration to the specified file. The file attribute is the original attribute of the file.
l If the cfgfile argument is not specified, the system will save the current configuration to the configuration file used for this startup. If the device starts up without loading the configuration file, the system will save the current configuration with the default name (config.cfg) in the root directory.
The system supports two modes for saving the current configuration file.
l Fast saving mode. This is the mode when you use the save command without the safely keyword. The mode saves the file quicker but is likely to lose the original configuration file if the device reboots or the power fails during the process.
l Safe mode. This is the mode when you use the save command with the safely keyword. The mode saves the file slower but can retain the original configuration file in the flash even if the device reboots or the power fails during the process.
The configuration file used for the next startup may be lost if the device reboots or the power fails during the configuration file saving process. In this case, the device reboots without loading any configuration file. After the device reboots, you need to specify a configuration file for the next startup. Refer to section startup saved-configuration for details.
l It is recommended to adopt the fast saving mode in the conditions of stable power and adopt the safe mode in the conditions of unstable power or remote maintenance.
l The extension name of the configuration file must be .cfg.
Examples
# Save the current configuration to 123.cfg as the main configuration file for the next startup.
<device> save main
The configuration will be written to the device.
Are you sure?[Y/N]y
Please input the file name(*.cfg)(To leave the existing filename
unchanged press the enter key):123.cfg
Now saving current configuration to the device.
Saving configuration. Please wait...
............
Unit1 save configuration flash:/123.cfg successfully
startup saved-configuration
Syntax
startup saved-configuration cfgfile [ backup | main ]
undo startup saved-configuration [ unit unit-id ]
View
User view
Parameters
cfgfile: Path name or file name of a configuration file in the Flash, a string of 5 to 56 characters.
backup: Specifies the configuration file to be the backup configuration file.
main: Specifies the configuration file to be the main configuration file.
unit unit-id: Specifies the unit ID of a device. It only can be 1.
Description
Use the startup saved-configuration command to specify a configuration file to be the main configuration file or the backup configuration file.
Use the undo startup saved-configuration command to specify the device to start without loading the configuration file.
If you execute the startup saved-configuration command with neither the backup nor the main keyword specified, the configuration file identified by the cfgfile argument is specified as the main configuration file.
The configuration file must use “.cfg” as its extension name and the startup configuration file must be saved at the root directory of the device.
Related commands: display startup.
Examples
# Configure the configuration file named config.cfg as the main configuration file of the device.
<device> startup saved-configuration config.cfg main
Please wait......Done!