Chapter 1 Configuration
File Management Commands
S3100 series Ethernet switches allow you to input a file path and
file name 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 a file named text.txt in the root directory of the switch is unit1>flash:/text.txt
or flash:/text.txt.
l
Entering the path name or file name directly. This
method can be used to specify a path or a file in the current work directory.
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
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,
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.241
255.255.255.0
#
interface Aux1/0/0
#
interface Ethernet1/0/1
port link-aggregation group 1
#
interface Ethernet1/0/2
#
interface Ethernet1/0/3
#
interface Ethernet1/0/4
#
interface Ethernet1/0/5
#
interface Ethernet1/0/6
#
interface Ethernet1/0/7
#
interface Ethernet1/0/8
#
interface Ethernet1/0/9
#
interface Ethernet1/0/10
#
interface Ethernet1/0/11
#
interface Ethernet1/0/12
#
interface Ethernet1/0/13
#
interface Ethernet1/0/14
#
interface Ethernet1/0/15
#
interface Ethernet1/0/16
#
interface Ethernet1/0/17
#
interface Ethernet1/0/18
#
interface Ethernet1/0/19
#
interface Ethernet1/0/20
#
interface Ethernet1/0/21
#
interface Ethernet1/0/22
#
interface Ethernet1/0/23
#
interface Ethernet1/0/24
#
interface GigabitEthernet1/1/1
#
interface GigabitEthernet1/1/2
shutdown
#
interface GigabitEthernet1/2/1
#
interface GigabitEthernet1/2/2
shutdown
#
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.)
<Sysname> display
current-configuration | include 10*
vlan 1
interface Vlan-interface1
ip address 192.168.0.241
255.255.255.0
interface Aux1/0/0
interface Ethernet1/0/1
port link-aggregation group 1
interface Ethernet1/0/2
interface Ethernet1/0/3
interface Ethernet1/0/4
interface Ethernet1/0/5
interface Ethernet1/0/6
interface Ethernet1/0/7
interface Ethernet1/0/8
interface Ethernet1/0/9
interface Ethernet1/0/10
interface Ethernet1/0/11
interface Ethernet1/0/12
interface Ethernet1/0/13
interface Ethernet1/0/14
interface Ethernet1/0/15
interface Ethernet1/0/16
interface Ethernet1/0/17
interface Ethernet1/0/18
interface Ethernet1/0/19
interface Ethernet1/0/20
interface Ethernet1/0/21
interface Ethernet1/0/22
interface Ethernet1/0/23
interface Ethernet1/0/24
interface GigabitEthernet1/1/1
interface GigabitEthernet1/1/2
interface GigabitEthernet1/2/1
interface GigabitEthernet1/2/2
# Display the configuration information starting
with the string user.
<Sysname> display
current-configuration | include ^user
user-interface aux 0
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. It only can be 1.
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
#
vlan 1
#
interface Vlan-interface1
ip address 192.168.0.241
255.255.255.0
#LOCCFG. MUST NOT DELETE
#
interface Aux1/0/0
#
interface Ethernet1/0/1
#
interface Ethernet1/0/2
#
interface Ethernet1/0/3
#
interface Ethernet1/0/4
#
interface Ethernet1/0/5
#
interface Ethernet1/0/6
#
interface Ethernet1/0/7
#
interface Ethernet1/0/8
#
interface Ethernet1/0/9
#
interface Ethernet1/0/10
#
interface Ethernet1/0/11
#
interface Ethernet1/0/12
#
interface Ethernet1/0/13
#
interface Ethernet1/0/14
#
interface Ethernet1/0/15
#
interface Ethernet1/0/16
#
interface Ethernet1/0/17
#
interface Ethernet1/0/18
#
interface Ethernet1/0/19
#
interface Ethernet1/0/20
#
interface Ethernet1/0/21
#
interface Ethernet1/0/22
#
interface Ethernet1/0/23
#
interface Ethernet1/0/24
#
interface GigabitEthernet1/1/1
#
interface GigabitEthernet1/1/2
shutdown
#
interface GigabitEthernet1/2/1
#
interface GigabitEthernet1/2/2
shutdown
#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.
Syntax
display startup
[ unit unit-id ]
View
Any view
Parameters
unit unit-id: Specifies the unit ID of a switch. It only can be 1.
Description
Use the display startup command to
display the startup configuration of a switch.
Related commands: startup
saved-configuration.
Examples
# Display the startup configuration file
information of the current switch.
<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
user-interface vty 0 4
authentication-mode
none
user privilege level 3
#
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.
Caution:
S3100 series
Ethernet switches do not support the safe mode. When you are saving a
configuration file using the save safely command, if the device reboots
or the power fails during the saving process, the configuration file will be
lost.
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
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. 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 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: 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.
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.
<Sysname> startup
saved-configuration config.cfg main
Please wait......Done!