When configuring configuration file
management, go to these sections for information you are interested in:
l
Introduction
to Configuration File
l
Configuration
Task List
A configuration file records and stores
user configurations performed to a switch. It also enables users to check
switch configurations easily.
I. Types of configuration
The configuration of a switch falls into
two types:
l
Saved configuration, a configuration file used
for initialization. If this file does not exist, the switch starts up without
loading any configuration file.
l
Current configuration, which refers to the user’s
configuration during the operation of a switch. This configuration is stored in
Dynamic Random-Access Memory (DRAM). It is removed when rebooting.
II. Format of configuration file
Configuration files are saved as text files
for ease of reading. They:
l
Save configuration in the form of commands.
l
Save only non-default configuration settings.
l
The commands are grouped into sections by
command view. The commands that are of the same command view are grouped into
one section. Sections are separated by comment lines. (A line is a comment line
if it starts with the character #.)
l
The sections are listed in this order: system
configuration section, logical interface configuration section, physical port
configuration section, routing protocol configuration section, user interface configuration,
and so on.
l
End with a return.
The operating interface provided by the
configuration file management function is user-friendly. With it, you can
easily manage your configuration files.
III. Main/backup attribute of the
configuration file
Main and backup indicate the main and
backup attribute of the configuration file respectively. A main configuration
file and a backup configuration file can coexist on the switch. As such, when
the main configuration file is missing or damaged, the backup file can be used
instead. This increases the safety and reliability of the file system compared
with the switch that only support one configuration file. You can configure a
file to have both main and backup attribute, but only one file of either main
or backup attribute is allowed on a switch.
The following three situations are
concerned with the main/backup attributes:
l
When saving the current configuration, you can
specify the file to be a main or backup or normal configuration file.
l
When removing a configuration file from a switch,
you can specify to remove the main or backup configuration file. Or, if it is a
file having both main and backup attribute, you can specify to erase the main
or backup attribute of the file.
l
When setting the configuration file for next
startup, you can specify to use the main or backup configuration file.
IV. Startup with the configuration
file
When booting, the system chooses the
configuration files following the rules below:
1)
If the main configuration file exists, the switch
initializes with this configuration.
2)
If the main configuration file does not exist
but the backup configuration file exists, the switch initializes with the
backup configuration.
3)
If neither the main nor the backup configuration
file exists, but the default configuration file config.def exists, the switch
initializes with the default configuration file; if the default configuration
file does not exist, the switch starts up without loading the configuration
file.
At present, only a
PoE-supported switch is shipped with a default configuration file.
Complete these tasks
to configure configuration file management:
You can modify the configuration on your switch
at the command line interface (CLI). To use the modified configuration for your
subsequent startups, you must save it (using the save command) as a configuration
file.
Use the following command to save current
configuration:
|
To do…
|
Use the command…
|
Remarks
|
|
Save current configuration
|
save [ cfgfile
| [ safely ] [ backup | main ] ]
|
Required
Available in any view
|
I. Modes in saving the
configuration
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 switch 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.
II. Three attributes of the
configuration file
l
Main attribute. When you use the save [ [
safely ] [ main ] ] command to save the current configuration,
the configuration file you get has main attribute. If this configuration file
already exists and has backup attribute, the file will have both main and
backup attributes after execution of this command. If the filename you entered
is different from that existing in the system, this command will erase its main
attribute to allow only one main attribute configuration file in the switch.
l
Backup attribute. When you use the save [
safely ] backup command to save the current configuration, the
configuration file you get has backup attribute. If this configuration file
already exists and has main attribute, the file will have both main and backup
attributes after execution of this command. If the filename you entered is
different from that existing in the system, this command will erase its backup
attribute to allow only one backup attribute configuration file in the switch.
l
Normal attribute. When you use the save cfgfile
command to save the current configuration, the configuration file you get has
normal attribute if it is not an existing file. Otherwise, the attribute is
dependent on the original attribute of the file.
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.
You can clear the configuration files saved
on the switch through commands.
Use the following command to erase the configuration file:
|
To do…
|
Use the command…
|
Remarks
|
|
Erase the startup configuration file from
the storage switch
|
reset saved-configuration [ backup | main ]
|
Required
Available in user view
|
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 needed.
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.
Caution:
This command will
permanently delete the configuration file from the switch.
Use the following command to specify a
configuration file for next startup:
|
To do…
|
Use the command…
|
Remarks
|
|
Specify a configuration file for next
startup
|
startup saved-configuration
cfgfile [ backup | main ]
|
Required
Available in user view
|
You can specify a configuration file to be
used for the next startup and configure the main/backup attribute for the
configuration file.
I. Assigning main attribute to the
startup configuration file
l
If you save the current configuration to the
main configuration file, the system will automatically set the file as the main
startup configuration file.
l
You can also use the startup saved-configuration
cfgfile [ main ] command to set the file as main startup
configuration file.
II. Assigning backup attribute to
the startup configuration file
l
If you save the current configuration to the
backup configuration file, the system will automatically set the file as the
backup startup configuration file.
l
You can also use the startup saved-configuration
cfgfile backup command to set the file as backup startup
configuration file.
Caution:
The configuration
file must use .cfg as its extension name and the startup configuration file
must be saved at the root directory of the switch.
|
To do…
|
Use the command…
|
Remarks
|
|
Display the initial configuration file
saved in the Flash of a switch
|
display saved-configuration [ unit unit-id ] [ by-linenum
]
|
Available in any view.
|
|
Display the configuration file used for
this and next startup
|
display startup [ unit unit-id ]
|
|
Display the current VLAN configuration of
the switch
|
display current-configuration vlan [ vlan-id ] [ by-linenum ]
|
|
Display the validated configuration in
current view
|
display this
[ by-linenum ]
|
|
Display current configuration
|
display current-configuration [ configuration [ configuration-type ] | interface
[ interface-type ] [ interface-number ] ] [ by-linenum ]
[ | { begin | exclude | include } regular-expression
]
|