- Table of Contents
- Related Documents
-
Title | Size | Download |
---|---|---|
05-Configuration File Management Commands | 101.99 KB |
The term "switch" or "device" in this chapter refers to the switching engine on a WX3000E wireless switch.
The WX3000E series comprises WX3024E and WX3010E wireless switches.
The port numbers in this chapter are for illustration only.
backup startup-configuration
Syntax
backup startup-configuration to dest-addr [ dest-filename ]
View
User view
Default level
2: System level
Parameters
dest-addr: IP address or name of a TFTP server. The address cannot be an IPv6 address.
dest-filename: Target filename used to save the startup configuration file for the next system startup on the server.
Description
Use the backup startup-configuration command to back up the startup configuration file (used at the next system startup) to a specified TFTP server. If you do not specify this filename, the original filename is used.
This command only backs up the main startup configuration file.
Currently, the device uses TFTP to back up configuration files.
Examples
# Back up the startup configuration file of the device to the TFTP server with IP address 2.2.2.2, using filename 192-168-1-26.cfg.
<Sysname> display startup
Current startup saved-configuration file: flash:/config.cfg
Next startup saved-configuration file: flash:/test.cfg
<Sysname> backup startup-configuration to 2.2.2.2 192-168-1-26.cfg
Backup next startup-configuration file to 2.2.2.2, please wait…finished!
<Sysname>
After the above operation, the device backs up file test.cfg to TFTP server 2.2.2.2, where the file is saved as 192-168-1-26.cfg.
display current-configuration
Syntax
display current-configuration [ configuration [ configuration ] | interface [ interface-type [ interface-number ] ] ] [ by-linenum ] [ | { begin | exclude | include } regular-expression ]
View
Any view
Default level
2: System level
Parameters
configuration [ configuration ]: Displays non-interface configuration. If the argument is not provided, all the non-interface configuration is displayed; if parameters are used, display the specified information. For example:
· isp: Displays the ISP configuration.
· post-system: Displays the post-system configuration.
· system: Displays the system configuration.
· user-interface: Displays the user interface configuration.
interface [ interface-type [ interface-number ] ]: Displays the interface configuration, where interface-type represents the interface type and interface-number represents the interface number.
by-linenum: Displays the number of each line.
|: Filters command output by specifying a regular expression. For more information about regular expressions, see the Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, which is a case sensitive string of 1 to 256 characters.
Description
Use the display current-configuration command to display the current configuration of the device.
A parameter is not displayed if it adopts the default setting. If the validated parameter is changed, although you have configured it, the validated parameter is displayed. For example, IP address 11.11.11.11 24 has been configured on a Loopback interface. If you execute the display current-configuration command, IP address 11.11.11.11 255.255.255.255 is displayed, meaning the validated subnet mask is 32 bits.
Related commands: display saved-configuration, reset saved-configuration, and save.
Examples
# Display the configuration from the line containing “user-interface” to the last line in the current configuration.
<Sysname> display current-configuration | begin user-interface
user-interface aux 0
user-interface vty 0 15
authentication-mode none
user privilege level 3
#
return
# Display the current SNMP configuration on the device.
<Sysname> display current-configuration | include snmp
snmp-agent
snmp-agent local-engineid 800063A203000FE240A1A6
snmp-agent community read public
snmp-agent community write private
snmp-agent sys-info version all
undo snmp-agent trap enable ospf 100
display default-configuration
Syntax
display default-configuration [ | { begin | exclude | include } regular-expression ]
View
Any view
Default level
2: System level
Parameters
|: Filters command output by specifying a regular expression. For more information about regular expressions, see the Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, which is a case sensitive string of 1 to 256 characters.
Description
Use the display default-configuration command to display the factory defaults of the device. The command displays all commands to be executed when the device boots with the factory defaults.
Related commands: display current-configuration and display saved-configuration.
Examples
# Display the factory defaults of the device.
<Sysname> display default-configuration
#
telnet server enable
#
return
display saved-configuration
Syntax
display saved-configuration [ by-linenum ] [ | { begin | exclude | include } regular-expression ]
View
Any view
Default level
2: System level
Parameters
by-linenum: Identifies each line of displayed information with a line number.
|: Filters command output by specifying a regular expression. For more information about regular expressions, see the Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, which is a case sensitive string of 1 to 256 characters.
Description
Use the display saved-configuration command to display the contents of the configuration file saved for the next startup of the device.
During device management and maintenance, you can use this command to check whether important configurations are saved to the configuration file to be used at the next startup of the device.
This command displays the main configuration file to be used at the next system startup.
If the system is not specified with a configuration file to the used at the next startup or the specified configuration file does not exist, the display saved-configuration command displays the default configuration file of the device. If the default configuration file does not exist, the system prompts “The config file does not exist!”.
Related commands: display current-configuration, reset saved-configuration, and save.
Examples
# Display the configuration file saved for the next startup of the device.
<Sysname> display saved-configuration
#
version 5.20, Test 5310
#
sysname Sysname
#
domain default enable system
#
telnet server enable
#
multicast routing-enable
#
vlan 1
#
vlan 999
#
domain system
access-limit disable
state active
idle-cut disable
self-service-url disable
#
interface NULL0
#
---- More ----
The configurations are displayed in the order of global, port, and user interface. The More prompt indicates that there are more line that the screen can display. Pressing Enter displays the next line; pressing Space displays the next screen; pressing Ctrl+C or any other key exits the display.
display startup
Syntax
display startup [ | { begin | exclude | include } regular-expression ]
View
Any view
Default level
1: Monitor level
Parameters
|: Filters command output by specifying a regular expression. For more information about regular expressions, see the Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, which is a case sensitive string of 1 to 256 characters.
Description
Use the display startup command to display the configuration files for the system startup and the configuration file(s) for the next system startup.
Related commands: startup saved-configuration.
Examples
# Display the startup configuration file used at the current system startup and the one to be used at the next system startup.
<Sysname> display startup
MainBoard:
Current startup saved-configuration file: NULL
Next main startup saved-configuration file: flash:/startup.cfg
Next backup startup saved-configuration file: flash:/startup2.cfg
Table 1 Output description
Field |
Description |
MainBoard: |
Name of the configuration file used at the current and next startup |
Current Startup saved-configuration file |
The configuration file used at the current startup |
Next main startup saved-configuration file |
Main configuration file to be used at the next startup |
Next backup startup saved-configuration file |
Backup configuration file to be used at the next startup |
(This file does not exist.) |
Indicates that the configuration file does not exist. If the user deletes the configuration file for the next startup after configuring it, this output information will be displayed after the filename. |
display this
Syntax
display this [ by-linenum ] [ | { begin | exclude | include } regular-expression ]
Any view
Default level
1: Monitor level
Parameters
by-linenum: Displays the number of each line.
|: Filters command output by specifying a regular expression. For more information about regular expressions, see the Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, which is a case sensitive string of 1 to 256 characters.
Use the display this command to display the valid configuration information under the current view.
To check whether your configuration takes effect, use the display this command.
The valid configuration that is the same as the default is not displayed.
The invalid configuration is not displayed.
Execution of this command in any user interface view displays the valid configuration in all the user interfaces.
Execution of this command in any VLAN view displays the configurations of all the created VLANs.
Examples
# Display the valid configuration information on interface GigabitEthernet 1/0/1.
<Sysname> system-view
[Sysname] interface gigabitethernet 1/0/1
[Sysname-GigabitEthernet1/0/1] display this
#
interface GigabitEthernet1/0/1
port link-mode bridge
port link-type hybrid
undo port hybrid vlan 1
port hybrid vlan 2 to 4 untagged
port hybrid pvid vlan 2
#
return
# Display the valid configuration information of all user interfaces.
<Sysname> system-view
[Sysname] user-interface vty 0
[Sysname-ui-vty0] display this
#
user-interface aux 0
user-interface vty 0
history-command max-size 256
user-interface vty 1 15
#
return
reset saved-configuration
Syntax
reset saved-configuration [ backup | main ]
View
User view
Default level
3: Manage level
Parameters
backup: Deletes the backup startup configuration file.
main: Deletes the main startup configuration file.
Description
Use the reset saved-configuration command to delete the startup configuration file(s) saved on the storage media of the device.
· This command permanently deletes the startup configuration file from the device. Use it with caution.
· If the main and backup startup configuration files are the same, when you perform the delete operation for once, the system does not delete the configuration file but only sets the corresponding startup configuration file (main or backup, according to which one you specified in the command) to NULL.
· Both the reset saved-configuration command and the reset saved-configuration main command delete the main startup configuration file.
Related commands: display saved-configuration and save.
Examples
# Delete the startup configuration file to be used at the next startup from the storage media of the device.
<Sysname> reset saved-configuration
The saved configuration file will be erased. Are you sure? [Y/N]:y
Configuration file in flash is being cleared.
Please wait ...........
Configuration file is cleared.
restore startup-configuration
Syntax
restore startup-configuration from src-addr src-filename
View
User view
Default level
3: Manage level
Parameters
src-addr: IP address or name of a TFTP server. The address cannot be an IPv6 address.
src-filename: Filename of the configuration file to be downloaded from the specified server.
Description
Use the restore startup-configuration command to download a configuration file from the specified TFTP server to the device and specify it as the startup configuration file for the next system startup.
The file downloaded is set as the main startup configuration file to be used at the next system startup.
Examples
# Download configuration file test.cfg from the TFTP server whose IP address is 2.2.2.2, and the configuration file is to be used at the next startup of the device.
<Sysname> restore startup-configuration from 2.2.2.2 test.cfg
Restore next startup-configuration file from 2.2.2.2. Please wait..............
finished!
save
Syntax
save file-url
save [ safely ] [ backup | main ] [ force ]
View
Any view
Default level
2: System level
Parameters
file-url: File path, where the extension of the file name must be .cfg.
safely: Sets the configuration saving mode to safe. If this argument is not specified, the configuration file is saved in fast mode.
backup: Saves the current configuration to the startup configuration file specified in the interactive mode, and specifies the file as the backup startup configuration file to be used at the next startup of the device.
main: Saves the current configuration to the main startup configuration file specified in the interactive mode, and specifies the file as the main startup configuration file to be used at the next startup of the device.
force: Saves the current configuration to the configuration file for the next startup of the device, and the system does not output any interaction information. By default, when you execute the save command, the system asks you to input Y or N to confirm your operation. If you do no confirm your operation within 30 seconds, the system automatically quits the operation. If you provide the force keyword when executing the save command, the system directly saves the current configuration, not requiring any confirmation.
Description
Use the save file-url command to save the current configuration to the specified configuration file, but the system does not specify the file as the startup configuration file to be used at the next system startup. If the file specified by file-url does not exist, the system creates the file and then saves the configuration to the file.
Use the save [ safely ] [ backup | main ] [ force ] command to save the current configuration to the root directory of the storage media, and specify the file as the startup configuration file to be used at the next system startup. If you specify neither the backup nor the main keyword, main is used by default.
Related commands: display current-configuration, display saved-configuration, and reset saved-configuration.
Examples
# Save the current configuration file to the root directory of the storage media, and specify the configuration file as the startup configuration file to be used at the next startup.
<Sysname> display startup
MainBoard:
Current startup saved-configuration file: flash:/hmr.cfg
Next main startup saved-configuration file: flash:/aa.cfg
Next backup startup saved-configuration file: NULL
// The output shows that the main startup configuration file to be used at the next system startup is aa.cfg.
<Sysname> save
The current configuration will be written to the device. Are you sure? [Y/N]:y
Please input the file name(*.cfg)[flash:/aa.cfg]
(To leave the existing filename unchanged, press the enter key):startup.cfg
Validating file. Please wait............
Saved the current configuration to mainboard device successfully.
<Sysname> display startup
Current startup saved-configuration file: flash:/hmr.cfg
Next main startup saved-configuration file: flash:/startup.cfg
Next backup startup saved-configuration file: NULL
// The output shows that the main startup configuration file to be used at the next system startup is changed to startup.cfg.
startup saved-configuration
Syntax
startup saved-configuration cfgfile [ backup | main ]
undo startup saved-configuration
View
User view
Default level
3: Manage level
Parameters
cfgfile: Configuration file name. The file must be a file with an extension .cfg stored in the root directory of the storage media.
backup: Sets the configuration file as the backup startup configuration file to be used at the next startup of the device.
main: Sets the configuration file as the main startup configuration file to be used at the next startup of the device.
Description
Use the startup saved-configuration command to specify a startup configuration file to be used at the next system startup.
Use the undo startup saved-configuration command to configure the system to start up with the null configuration, that is, the factory configuration.
· The startup saved-configuration and startup saved-configuration main commands have the same effect: Both of them are used to specify the main startup configuration file.
· The main and backup startup configuration files can be specified as the same file. However, it is recommended you use different files, or, save the same configuration as two files using different file names, one specified as the main startup configuration file, and the other specified as the backup.
· If you execute the undo startup saved-configuration command, the system sets the main and backup startup configuration file as NULL, but does not delete the two configuration files.
Related commands: display startup.
Examples
# Specify a startup configuration file to be used at the next system startup.
<Sysname> startup saved-configuration testcfg.cfg
Please wait ....
Setting the master board ..........
... Done!