01-Fundamentals Command Reference

HomeSupportRoutersH3C SR8800 Router SeriesReference GuidesCommand ReferencesH3C SR8800 Command Reference-Release3347-6W10301-Fundamentals Command Reference
05-Configuration File Management Commands
Title Size Download
05-Configuration File Management Commands 129.06 KB

Configuration file management commands

archive configuration

Syntax

archive configuration

View

User view

Default level

3: Manage level

Parameters

None

Description

Use the archive configuration command to manually save the running configuration.

With this command executed, the system saves the running configuration with the specified filename (filename prefix + serial number) to the specified path.

Before executing the archive configuration command, you must configure the filename prefix and path for saving configuration files by using the archive configuration location command.

With the archive configuration command executed, the running configuration is only saved to the active MPU, and the standby MPU does not perform the saving operation.

Examples

# Manually save the running configuration.

<Sysname> archive configuration

Warning: Save the running configuration to an archive file. Continue? [Y/N]: Y

Please wait...

Info: The archive configuration file myarchive_1.cfg is saved.

archive configuration interval

Syntax

archive configuration interval minutes

undo archive configuration interval

View

System view

Default level

3: Manage level

Parameters

minutes: Specifies the interval for automatically saving the running configuration, in minutes. The value ranges from 10 to 525,600 (365 days).

Description

Use the archive configuration interval command to enable the automatic saving of the running configuration and set the interval.

Use the undo archive configuration interval command to restore the default.

By default, the system does not automatically save the running configuration.

With this command executed, the system saves the running configuration with the specified filename to the specified path at a specified interval (the value of the minutes argument).

Configure an automatic saving interval according to the storage media performance and the frequency of configuration modification:

If the configuration of the router does not change frequently, you are recommended to save the running configuration manually as needed

If a low-speed storage media (such as a Flash) is used, you are recommended either to save the running configuration manually, or to configure automatic saving with an interval longer than 1,440 minutes (24 hours).

If a high-speed storage media (such as a CF card) is used and the configuration of the router changes frequently, you are recommended to set a shorter saving interval.

Before executing the archive configuration interval command, you must configure the filename prefix and path for saving configuration files by using the archive configuration location command.

With the archive configuration interval command executed, the running configuration is only saved to the active MPU, and the standby MPU cannot save the configuration. However, the command is also executed on the standby MPU to ensure the rollback of the configuration after an active/standby switchover.

Examples

# Configure the system to save the running configuration every 60 minutes.

<Sysname> system-view

[Sysname] archive configuration interval 60

Info: Archive files will be saved every 60 minutes.

archive configuration location

Syntax

archive configuration location directory filename-prefix filename-prefix

undo archive configuration location

View

System view

Default level

3: Manage level

Parameters

directory: The path of the folder for saving configuration files, a case-insensitive string of 1 to 63 characters, in the format of storage media name:/[folder name]/subfolder name. The folder must be created before the configuration.

filename-prefix: The filename prefix for saving configuration files, a case-insensitive string of 1 to 30 characters, which can include letters, numbers, _, and - only.

Description

Use the archive configuration location command to configure the path and filename prefix for saving configuration files.

Use the undo archive configuration location command to restore the default.

By default, the path and filename prefix for saving configuration files are not configured, and the system does not save the configuration file periodically.

Before the running configuration is saved either manually or automatically, the file path and filename prefix must be configured.

If the undo archive configuration location command is executed, the running configuration can neither be saved manually nor automatically, and the configuration by executing the archive configuration interval and archive configuration max commands restores to the default, meanwhile, the saved configuration files are cleared.

The saving and rollback operations are executed only on the active MPU. To make the configuration rollback take effect on the new active MPU after an active/standby switchover, execute the archive configuration location command to specify the path and filename prefix for saving configuration files on both the active MPU and standby MPU. Therefore, before the execution of this command, make sure that the specified path is available on both the active MPU and standby MPU, and the path cannot include any slot number.

Examples

# Configure the path and the filename prefix for saving configuration files as flash:/archive and my_archive respectively.

·           Create folder flash:/archive on the active MPU (the slot number of the active MPU is 0)

<Sysname> mkdir archive

.

%Created dir flash:/archive.

·           Create folder flash:/archive on the standby MPU (the slot number of the standby MPU is 1)

<Sysname> mkdir slot1#flash:/archive

%Created dir slot1#flash:/archive.

·           Configure the path and filename prefix for saving configuration files.

<Sysname> system-view

[Sysname] archive configuration location flash:/archive filename-prefix my_archive

archive configuration max

Syntax

archive configuration max file-number

undo archive configuration max

View

System view

Default level

3: Manage level

Parameters

file-number: The maximum number of configuration files that can be saved, which ranges from 1 to 10. The value of the file-number argument is determined by the memory space. You are recommended to set a comparatively small value for this argument if the available memory space is small.

Description

Use the archive configuration max command to set the maximum number of configuration files that can be saved.

Use the undo archive configuration max command to restore the default.

By default, a maximum of 5 configuration files can be saved.

Because excessive configuration files occupy large memory space, you can use this command to control the number of the files. After the maximum number of configuration files is saved, the system deletes the oldest files when the next file is saved (either automatically or manually). When you change the maximum number of configuration files that can be saved, the exceeded files are not deleted. If the number of the existing configuration files is larger than or equal to the newly configured upper limit, the system deletes the oldest n files when the next file is saved, where n = the current number - the newly configured number + 1, for example: if the number of configuration files that have been saved is 7, and the newly configured upper limit is 4, when there is a new configuration file to be saved, the system deletes 4 oldest files, where 4 = 7-4+1.

Before executing this command, configure the path and filename prefix of a saved configuration file by using the archive configuration location command; otherwise, the execution of this command fails.

When the undo archive configuration location command is executed, the maximum number of configuration files that can be saved also restores to the default.

Examples

# Set the maximum number of configuration files that can be saved to 10.

<Sysname> system-view

[Sysname] archive configuration max 10

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.

For a router that has main and backup startup configuration files, this command only backs up the main startup configuration file.

Currently, the router uses TFTP to back up configuration files.

Examples

# Back up the startup configuration file of the router to the TFTP server with IP address 2.2.2.2, using filename192-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-26config.cfg

Backup next startup-configuration file to 2.2.2.2, please wait…

finished!

<Sysname>

After the above operation, the router backs up file test.cfg to the TFTP server 2.2.2.2, where the file is saved as 192-168-1-26.cfg.

configuration replace file

Syntax

configuration replace file filename

View

System view

Default level

3: Manage level

Parameters

filename: Specifies the name of the replacement configuration file for configuration rollback.

Description

Use the configuration replace file command to set configuration rollback.

With this command executed, the running configuration rolls back to the configuration state based on the specified configuration file (filename).

The configuration file specified with the configuration replace file filename command can only be a configuration file in simple text. Otherwise, errors may occur in configuration rollback.

Examples

# Roll back from the running configuration to a previous configuration state based on a saved configuration file my_archive_1.cfg.

<Sysname> system-view

[Sysname] configuration replace file my_archive_1.cfg

Current configuration will be lost, save current configuration? [Y/N]:n

Info: Now replacing the current configuration. Please wait...

Info: Succeeded in replacing current configuration with the file my_archive_1.cfg.

display archive configuration

Syntax

display archive configuration [ | { 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 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, a case-sensitive string of 1 to 256 characters.

Description

Use the display archive configuration command to display information about configuration rollback.

Examples

# Display information about configuration rollback.

<Sysname> display archive configuration

Location: flash:/archive

Filename prefix: my_archive

Archive interval in minutes: 120

Maximum number of archive files: 10

Saved archive files:

  No. TimeStamp              FileName

  1   Aug 05 2007 20:24:54   my_archive_1.cfg

  2   Aug 05 2007 20:34:54   my_archive_2.cfg

# 3   Aug 05 2007 20:44:54   my_archive_3.cfg

‘#’ indicates the most recent archive file.

Next archive file to be saved: my_archive_4.cfg

Table 1 Output description

Field

Description

Location

Absolute path of the saved configuration files.

Filename prefix

Filename prefix of the saved configuration files.

Archive interval in minutes

Configuration file saving interval, in minutes.

If the automatic saving is disabled, this field is not displayed.

Filename

Filename of the saved configuration files, with path excluded.

 

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 no argument is used, all the non-interface configuration is displayed; if parameters are used, display the specified information. For example:

·           isis: Displays the ISIS configuration.

·           isp: Displays the ISP configuration.

·           post-system: Displays the post-system configuration.

·           radius-template: Displays the RADIUS scheme 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 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, a case-sensitive string of 1 to 256 characters.

Description

Use the display current-configuration command to display the current configuration of the router.

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: save, reset saved-configuration, and display saved-configuration.

Examples

# Display the configuration starting with “user”.

<Sysname> display current-configuration | begin user

user-interface aux 0

user-interface vty 0 4

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 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, 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 router.

During router 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 router.

For a router supporting main and backup configuration files, 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 router. If the default configuration file does not exist, the system prompts “The config file does not exist!”.

Related commands: save, reset saved-configuration, and display current-configuration.

Examples

# Display the configuration file saved for the next startup of the router.

<Sysname> display saved-configuration

#

 Version 5.20, Beta 1105

#

 sysname Sysname

#

 local-user abc password simple abc

#

 tcp window 8

#

interface Aux3/1/0

 link-protocol ppp

#

interface GigabitEthernet 3/1/1

#

interface GigabitEthernet 3/1/2

#

interface GigabitEthernet 3/1/3

 ip address 10.110.101.17 255.255.255.0

#

interface NULL0

#

ospf 1

#

 ip route-static 10.12.0.0 255.255.0.0 GigabitEthernet 3/1/1

#

user-interface con 0

user-interface aux 0

user-interface vty 0 4

 authentication-mode none

#

return

The configurations are displayed in the order of global, port, and user interface.

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 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, a case-sensitive string of 1 to 256 characters.

Description

Use the display startup command to display the configuration files for system startup and the configuration file(s) for the next system startup, and also the enabled/disabled status of the Boot ROM access control function if the function is supported on the router.

The standby MPU starts and runs based on the current configurations of the active MPU. The startup configuration files displayed on the active MPU and standby MPU are always the same.

After switchover between the active MPU and standby MPU, the new active MPU does not run using the configuration file but run with the current configuration. Therefore, when you execute the display startup command, the startup configuration file to start the new active MPU is displayed as NULL. That of the new standby MPU will also be displayed as NULL to be consistent with the new active MPU.

Related commands: startup saved-configuration.

Examples

# Display the startup configuration file for system startup and the one for the next system startup .

<Sysname> display startup

MainBoard:

 Current startup saved-configuration file: flash:/startup.cfg

 Next startup saved-configuration file: flash:/startup.cfg

Slot 1:

 Current startup saved-configuration file: flash:/startup.cfg

 Next startup saved-configuration file: flash:/startup.cfg

display this

Syntax

display this [ by-linenum ] [ | { begin | exclude | include } regular-expression ]

View

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 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, a case-sensitive string of 1 to 256 characters.

Description

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 in the current view (the output information depends on the current configuration of the router).

<Sysname> system-view

[Sysname] user-interface vty 0

[Sysname-ui-vty0] display this

#

user-interface con 0

user-interface vty 0

 history-command max-size 256

user-interface vty 1 4

#

return

reset saved-configuration

Syntax

reset saved-configuration

View

User view

Default level

3: Manage level

Parameters

None

Description

Use the reset saved-configuration command to delete the startup configuration file.

Delete the startup configuration file if it does not match the software version or has been corrupted.

Use this command with caution. This command permanently deletes the startup configuration file from the active MPU and standby MPU.

If the main and backup startup configuration files are the same, if you perform the delete operation for once, the system will not delete the configuration file but only set the corresponding startup configuration file (main or backup, according to which one you specified in the command) to NULL.

Related commands: display saved-configuration and save.

Examples

# Delete the startup configuration file from the storage media of the router.

<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 ...

..

MainBoard:

 Configuration file is cleared.

Slot 1:

 Erase next configuration file successfully

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 router and specify it as the startup configuration file for the next system startup.

This command downloads the configuration file to the root directory of the storage media of each MPU and specifies the file as the startup configuration file to be used at the next startup of each MPU.

If the file to be downloaded has the same filename as an existing file on the active MPU or standby MPU, you are prompted whether you want to overwrite the existing file or not. In addition, both the active MPU and the standby MPU are assumed to use the storage media of the same type when the router is checking the filename or backing up the configuration file to the standby MPU. When backing up the configuration file to the standby MPU, the router saves the file to the same directory on the standby MPU as on the active MPU, that is, the root directory. (For a router whose storage media has been partitioned, the directory is the first partition of the storage media.) If the active MPU and standby MPU are of different types, for example, a Flash and a CF card respectively, the backup operation will fail.

Examples

# Download file config.cfg from the TFTP server whose IP address is 2.2.2.2, and the file is to be used as the main startup configuration file at the next startup of the router.

<Sysname>restore startup-configuration from 2.2.2.2 config.cfg

Restore next startup-configuration file from 2.2.2.2. Please wait...finished!

Now restore next startup-configuration file from main to slave board. Please wait...finished!

save

Syntax

save file-url [ all | slot slot-number ]

save [ safely ] [ force ]

View

Any view

Default level

2: System level

Parameters

file-url: File path, where the extension of the file name must be .cfg. When used with the keyword all or slot, this argument cannot include a slot number. If the file path includes a folder name, you must first create the folder on the specified MPU; otherwise, the operation will fail.

all: Saves the current configuration in the specified filename to all the MPUs.

slot slot-number: Saves the current configuration in the specified filename to the standby MPU. slot-number represents the slot number of a card.

safely: Sets the configuration saving mode to safe. If this argument is not specified, the configuration file is saved in fast mode.

force: Saves the current configuration to the configuration file for the next startup of the router, 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 not 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 [ all | slot slot-number ] 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; if the all or slot keyword is not specified, the configuration is saved to the active MPU.

Use the save [ safely ] command to save the current configuration to the root directory of the storage media on both the active MPU and the standby MPU, and specify the file as the startup configuration file to be used at the next system startup.

Whether the save [ safely ] command or the save file-url all command+Enter takes effect on both the active MPU and standby MPU or on the active MPU only depends on whether the configuration file auto-save function is enabled.

Related commands: display current-configuration, display saved-configuration, reset saved-configuration, and slave auto-update config.

Examples

# Save the current configuration to the root directories of the storage media on both the active MPU and the standby MPU, specify the configuration file as the startup configuration file to be used at the next system startup.

<Sysname> display startup

MainBoard:

 Current startup saved-configuration file: flash:/startup.cfg

 Next startup saved-configuration file: flash:/bb.cfg

Slot 1:

 Current startup saved-configuration file: flash:/startup.cfg

 Next startup saved-configuration file: flash:/bb.cfg

// The above information indicates that the configuration file to be used at the next startup for both the active MPU and standby MPU is bb.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:/bb.cfg]

(To leave the existing filename unchanged, press the enter key):vrpcfg.cfg

 Validating file. Please wait.....................

 The current configuration is saved to the active main board successfully.

Slot 1:

 The current configuration file is saved successfully.

 Configuration is saved to device successfully.

<Sysname> display startup

MainBoard:

 Current startup saved-configuration file: flash:/startup.cfg

 Next startup saved-configuration file: flash:/vrpcfg.cfg

Slot 1:

 Current startup saved-configuration file: flash:/startup.cfg

 Next startup saved-configuration file: flash:/vrpcfg.cfg

// The above information indicates that the configuration file to be used at the next startup for both the active MPU and standby MPU is changed to vrpcfg.cfg.

# Save the current configuration in the name of test.cfg to standby MPU 1 (approach 1)

<Sysname> save test.cfg slot 1

The current configuration will be saved to slot1#flash:/test.cfg. Continue? [Y/N]:y

Now saving current configuration to the device.

Saving configuration slot1#flash:/test.cfg. Please wait...

........

Configuration is saved to slot1#flash successfully.

Or use this command (approach 2):

<Sysname> save slot1#flash:/test.cfg

# Save the current configuration to the main configuration file to be used at the next startup of the router, without any confirmation required.

<Sysname> save force

 Validating file. Please wait.....................

 The current configuration is saved to the active main board successfully.

Slot 1:

 The current configuration file is saved successfully.

 Configuration is saved to device successfully.

slave auto-update config

Syntax

slave auto-update config

undo slave auto-update config

View

System view

Default level

2: System level

Parameters

None

Description

Use the slave auto-update config command to enable the configuration file auto-save function.

Use the undo slave auto-update config command to disable the function.

By default, the configuration file auto-save function is enabled.

Examples

# Enable the configuration file auto-save function.

<Sysname> system-view

[Sysname] slave auto-update config

startup saved-configuration

Syntax

startup saved-configuration cfgfile

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.

Description

Use the startup saved-configuration command to specify a startup configuration file to be used at the next system startup for the active MPU and standby MPU.

Use the undo startup saved-configuration command to configure the active MPU and standby MPU to start up with the null configuration, that is, the factory configuration.

The startup configuration file to be used at the next startup of the active MPU and standby MPU must be the same. Therefore, before using the command, make sure that the specified configuration file has been saved to the root directory of the storage media of both the active MPU and standby MPU; otherwise, the command will fail.

 The configuration file must be a file with extension .cfg stored in the root directory of the storage media (For a router that has been partitioned, the file must be saved in the first partition).

Related commands: display startup.

 

CAUTION

CAUTION:

During the router boot process, the router cannot read data from the USB disk. Therefore, do not save the boot file on the USB disk.

 

Examples

# Specify a startup configuration file to be used at the next system startup.

<Sysname> startup saved-configuration testcfg.cfg

Please wait ....... Done!

  • Cloud & AI
  • InterConnect
  • Intelligent Computing
  • Security
  • SMB Products
  • Intelligent Terminal Products
  • Product Support Services
  • Technical Service Solutions
All Services
  • Resource Center
  • Policy
  • Online Help
All Support
  • Become a Partner
  • Partner Resources
  • Partner Business Management
All Partners
  • Profile
  • News & Events
  • Online Exhibition Center
  • Contact Us
All About Us
新华三官网