Chapter 1 Configuration File Management Commands
The S5600 series Ethernet switches support Intelligent Resilient
Framework (IRF), and allow you to access a file on the switch in one of the
following ways:
l To access a file on the specified unit, you need to enter the file universal
resource locator (URL) starting with unit[No.]>flash:/, where [No.]
represents the unit ID of the switch. For example, if the unit ID of the switch
is 1, the URL of the file named text.txt in the root directory of the
switch is unit1>flash:/text.txt.
l To access a file on the current unit, you need to enter the file URL
starting with flash:/. For example, the URL of file text.txt in
the root directory of the Flash on the current unit is flash:/text.txt.
l To access a file on the current directory, enter the path name or
file name directly. For example, to access file text.txt in the current
directory, you can directly input the file name text.txt as the file
URL.
1.1.1 display
current-configuration
Syntax
display current-configuration [ configuration [ configuration-type ] | interface
[ interface-type ] [ interface-number ] ] [ by-linenum ] [
| { begin | exclude | include } 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
acl-user: Indicates
the user-defined 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, Cascade,
Ethernet, 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 switch to be displayed. By
specifying a regular expression, you can locate and query the needed
information quickly.
regular-expression: A regular expression, case sensitive. It supports the following
match rules:
l
begin: Displays
the line that matches the regular expression and all the subsequent lines.
l
exclude: Displays
the lines that do not match the regular expression.
l
include: Displays
only the lines that match the regular expression.
A regular expression also supports some
special characters. For match rules of the special characters, refer to Table 1-1
for details.
Table 1-1 Special characters in regular
expression
|
Character
|
Meaning
|
Remarks
|
|
^
|
Starting sign, the string to the right of
this character appears only at the beginning of a line.
|
For example, regular expression ^user
matches lines beginning with user, not Auser.
|
|
$
|
Ending sign, the string to the left of
this character appears only at the end of a line.
|
For example, regular expression user$
matches lines ending 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 should match zero or more consecutive times.
|
For example, zo* can match z
and zoo, and so on, but not zo.
|
|
+
|
Plus sign, the character to the left of
the plus sign should match one or more consecutive times.
|
For example, 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. Specifies a range of
characters, and matches any character in the specified range.
|
For example, [1-36A] can match a string containing any character among 1, 2, 3, 6,
and A.
|
|
( )
|
Parenthesis. Specifies a character group. It is usually used with + or *.
|
For example, (123A) means a character group 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 a switch.
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 all
the interfaces on the current switch.
<Sysname> display
current-configuration interface
#
interface Vlan-interface1
ip address 192.168.0.57
255.255.255.0
#
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
#
interface GigabitEthernet1/0/26
#
interface GigabitEthernet1/0/27
#
interface GigabitEthernet1/0/28
#
interface GigabitEthernet1/0/29
#
interface GigabitEthernet1/0/30
#
interface GigabitEthernet1/0/31
#
interface GigabitEthernet1/0/32
#
interface GigabitEthernet1/0/33
#
interface GigabitEthernet1/0/34
#
interface GigabitEthernet1/0/35
#
interface GigabitEthernet1/0/36
#
interface GigabitEthernet1/0/37
#
interface GigabitEthernet1/0/38
#
interface GigabitEthernet1/0/39
#
interface GigabitEthernet1/0/40
#
interface GigabitEthernet1/0/41
#
interface GigabitEthernet1/0/42
#
interface GigabitEthernet1/0/43
#
interface GigabitEthernet1/0/44
#
interface GigabitEthernet1/0/45
#
interface GigabitEthernet1/0/46
#
interface GigabitEthernet1/0/47
#
interface GigabitEthernet1/0/48
#
interface GigabitEthernet1/0/49
shutdown
#
interface GigabitEthernet1/0/50
shutdown
#
interface GigabitEthernet1/0/51
shutdown
#
interface GigabitEthernet1/0/52
shutdown
#
interface Cascade1/2/1
#
interface Cascade1/2/2
#
interface NULL0
#
interface LoopBack0
ip address 20.1.1.1 255.255.0.0
#
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.)
<Sysname> display
current-configuration | include 10*
rule 0 permit source 20.1.0.0
0.0.255.255
vlan 1
interface Vlan-interface1
ip address 192.168.0.57 255.255.255.0
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
interface GigabitEthernet1/0/26
interface GigabitEthernet1/0/27
interface GigabitEthernet1/0/28
interface GigabitEthernet1/0/29
interface GigabitEthernet1/0/30
interface GigabitEthernet1/0/31
interface GigabitEthernet1/0/32
interface GigabitEthernet1/0/33
interface GigabitEthernet1/0/34
interface GigabitEthernet1/0/35
interface GigabitEthernet1/0/36
interface GigabitEthernet1/0/37
interface GigabitEthernet1/0/38
interface GigabitEthernet1/0/39
interface GigabitEthernet1/0/40
interface GigabitEthernet1/0/41
interface GigabitEthernet1/0/42
interface GigabitEthernet1/0/43
interface GigabitEthernet1/0/44
interface GigabitEthernet1/0/45
interface GigabitEthernet1/0/46
interface GigabitEthernet1/0/47
interface GigabitEthernet1/0/48
interface GigabitEthernet1/0/49
interface GigabitEthernet1/0/50
interface GigabitEthernet1/0/51
interface GigabitEthernet1/0/52
interface Cascade1/2/1
interface Cascade1/2/2
undo fabric-port Cascade1/2/1 enable
undo fabric-port Cascade1/2/2 enable
ip address 20.1.1.1 255.255.0.0
bgp 1
network 10.1.0.0 255.255.0.0
network 20.1.0.0 255.255.0.0
peer aaa route-policy 1 export
peer 192.168.0.56 group aaa
route-policy 1 permit node 10
apply community 11:22
# Display the configuration information starting
with the string user.
<Sysname> display
current-configuration | include ^user
user-interface aux 0 7
user-interface vty 0 4
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 switch.
Without the vlan-id argument
specified, this command displays configuration information about all the VLANs
that exist on the switch.
If there are contiguous VLANs without any
configuration, the system combines these VLANs together in the format of vlan-id
to vlan-id when displaying the VLAN configuration information.
Related commands: save, reset
saved-configuration, display saved-configuration.
Examples
# Display the VLAN configuration
information of the current switch.
<Sysname> display
current-configuration vlan
#
vlan 1
#
vlan 5 to 69
#
vlan 70
description Vlan 70
#
vlan 71 to 100
#
return
Syntax
display saved-configuration
[ unit unit-id ] [ by-linenum ]
View
Any view
Parameters
unit unit-id:
Specifies the unit ID of a switch. With this keyword-argument combination
specified, this command can display the initial configuration file of the
specified unit.
by-linenum: Displays
configuration information with line numbers.
Description
Use the display saved-configuration
command to display the initial configuration file of a switch.
Note that:
l
If the switch starts up without a configuration
file, the system will display that no configuration file exists upon execution
of the command.
l
If you have saved configuration after the switch
starts up, the command displays the last saved configuration.
Related commands: save, reset
saved-configuration, display current-configuration.
Examples
# Display the initial configuration file of
the current switch.
<Sysname> display
saved-configuration
#
sysname Sysname
#
radius scheme system
#
domain system
#
stp mode rstp
#
vlan 1
#
interface Vlan-interface1
ip address 192.168.0.57
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
#
interface GigabitEthernet1/0/26
#
interface GigabitEthernet1/0/27
#
interface GigabitEthernet1/0/28
#
interface GigabitEthernet1/0/29
#
interface GigabitEthernet1/0/30
#
interface GigabitEthernet1/0/31
#
interface GigabitEthernet1/0/32
#
interface GigabitEthernet1/0/33
#
interface GigabitEthernet1/0/34
#
interface GigabitEthernet1/0/35
#
interface GigabitEthernet1/0/36
#
interface GigabitEthernet1/0/37
#
interface GigabitEthernet1/0/38
#
interface GigabitEthernet1/0/39
#
interface GigabitEthernet1/0/40
#
interface GigabitEthernet1/0/41
#
interface GigabitEthernet1/0/42
#
interface GigabitEthernet1/0/43
#
interface GigabitEthernet1/0/44
#
interface GigabitEthernet1/0/45
#
interface GigabitEthernet1/0/46
#
interface GigabitEthernet1/0/47
#
interface GigabitEthernet1/0/48
#
interface GigabitEthernet1/0/49
shutdown
#
interface GigabitEthernet1/0/50
shutdown
#
interface GigabitEthernet1/0/51
shutdown
#
interface GigabitEthernet1/0/52
shutdown
#
interface Cascade1/2/1
#
interface Cascade1/2/2
#TOPOLOGYCFG. MUST NOT DELETE
#GLBCFG. MUST NOT DELETE
#
interface NULL0
#
user-interface aux 0 7
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.
Syntax
display startup [ unit unit-id ]
View
Any view
Parameters
unit unit-id: Specifies the unit ID of a switch. With this keyword-argument
combination specified, this command can display the startup configuration file information
of the specified unit.
Description
Use the display startup command to
display the startup configuration of a switch.
Note that:
l
If the switch is not a unit of a fabric, this
command displays the startup configuration file information of the current
switch no matter whether you have specified the unit-id argument or not.
l
If the switch is a unit of a fabric, without unit-id
specified, this command displays the startup configuration file information
of all the units in the fabric; with unit-id specified, this command
displays the startup configuration file information of the specified unit.
Related commands: startup
saved-configuration.
Examples
# Display the startup configuration file
information of the current switch, which is not in any fabric.
<Sysname> display startup
UNIT1:
Current Startup saved-configuration
file: flash:/config.cfg
Next main startup
saved-configuration file: flash:/config.cfg
Next backup startup
saved-configuration file: flash:/backup.cfg
Bootrom-access enable
state: enabled
Table 1-2
Description on the fields of the display startup
command
|
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
|
|
Bootrom-access enable state
|
Whether you can use the user-defined password
to access the Boot ROM:
l enabled indicates you can access the Boot
ROM with the user-defined password.
l disabled indicates you cannot access the
Boot ROM with the user-defined password.
For related information, refer to the startup
bootrom-access enable command in the File System Management part
of the manual.
|
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
Effective 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
or VLAN view displays the valid configuration parameters in all user interfaces
or VLANs.
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.
<Sysname> system-view
System View: return to User View with
Ctrl+Z.
[Sysname] user-interface aux 0
[Sysname-ui-aux0] display this
#
user-interface aux 0 4
idle-timeout 0 0
user-interface aux 5 7
user-interface vty 0
authentication-mode none
user privilege level 3
set authentication password simple
123
idle-timeout 0 0
user-interface vty 1 4
authentication-mode none
user privilege level 3
set authentication password simple 1
idle-timeout 0 0
#
return
1.1.6 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 Flash of a switch.
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.
Caution:
l
This command will permanently delete the
configuration file from the switch.
l
An error occurs when you execute this command if
the configuration file to be deleted does not exist.
Related commands: save.
Examples
# Erase the main configuration file to be used in
the next startup.
<Sysname> 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.
1.1.7 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 switch 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 switch
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 switch
reboots or the power fails during the process.
When you use the save safely command
to save the configuration file, if the switch reboots or the power fails during
the saving process, the switch initializes itself in the following two
conditions when it starts up next time:
l
If a configuration file with the extension .cfg
exists in the Flash, the switch uses the configuration file to initialize
itself when it starts up next time.
l
If there is no .cfg configuration file in
the Flash, but there is a configuration file with the extension .cfgbak
(backup configuration file containing the original configuration information)
or/and a configuration file with the extension .cfgtmp (temporary
configuration file containing the current configuration information) in the
Flash, you can change the extension .cfgbak or .cfgtmp to .cfg
using the rename command. The switch will use the renamed configuration
file to initialize itself when it starts up next time.
For details of the rename command,
refer to the File System Management part of the manual.
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
If you use the save command after a
fabric is formed on the switch, the units in the fabric save their own startup
configuration files automatically.
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.
<Sysname> 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
# Save the current configuration to 234.cfg
in unit 1.
<Sysname> save
unit1>flash:/234.cfg
The current configuration will be
saved to unit1>flash:/234.cfg [Y/N]:y
Now saving current configuration to
the device.
Saving configuration. Please wait...
...........
Unit1 save configuration
unit1>flash:/234.cfg successfully
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 a switch by its unit
ID. You can configure a switch in the fabric to use null configuration when it
restarts by specifying the switch unit ID in unit unit-id.
Description
Use the startup saved-configuration
command to specify a configuration file to be the main configuration file or
the backup configuration file to be used for the next startup of the switch.
Use the undo startup saved-configuration
command to specify a switch to use null configuration when it restarts.
Note that:
l
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 to be used for the next startup of the switch.
l
If the switch has not joined any fabric, the startup
saved-configuration command specifies the configuration file to be used
for the next startup of the switch; if the switch has joined a fabric, this
command specifies the configuration file to be used for the next startup of all
the switches in the fabric.
l
If the switch has joined a fabric, without the unit
keyword, the undo startup saved-configuration command will
specify all the switches in the fabric to use null configuration when they
restart; with the unit keyword specified, this command will specify the
specified unit in the fabric to use null configuration when it restarts.
Caution:
The configuration
file must use .cfg as its extension name and the startup configuration
file must be saved at the root directory in the Flash of the switch.
Related commands: display startup.
Examples
# Configure
the configuration file named config.cfg as the main configuration file to
be used for the next startup of the current switch, which is not in any fabric.
<Sysname>
startup saved-configuration config.cfg main
Please
wait......Done!
# When a
fabric is formed, configure the configuration file named 123.cfg as the backup
configuration file to be used for the next startup of unit 1 in the fabric.
<Sysname> startup
saved-configuration unit1>flash:/123.cfg backup
Please wait......Done!