01-Fundamentals Configuration Guide

HomeSupportRoutersH3C SR8800 Router SeriesConfigure & DeployConfiguration GuidesH3C SR8800 Configuration Guide-Release3347-6W10301-Fundamentals Configuration Guide
05-Configuration File Management Configuration
Title Size Download
05-Configuration File Management Configuration 125.09 KB

Managing configuration files

The router provides the configuration file management function. You can manage configuration files at the command-line interface (CLI).

Configuration file overview

A configuration file saves the router configurations as a set of text commands. You can save the current configuration to the configuration file so that the configuration takes effect after you reboot the router. In addition, you can view the configuration information conveniently, or upload or download the configuration file to or from another router to configure routers in batches.

Types of configuration

The router maintains the following types of configurations: startup configuration and running configuration.

Startup configuration

Use startup configuration for initialization when the router boots. If this file does not exist, the system boots using the factory defaults.

You can view the startup configuration in either of the following ways:

·           Use the display startup command to view the currently using startup configuration file, and use the more command to view the content of the configuration file.

·           After the reboot of the device and before configuring the router, use the display current-configuration command to view the startup configuration.

Running configuration

The currently running configuration may include the startup configuration if the startup configuration is not modified during system operation. It also includes any new configurations performed by users during router operation.

The running configuration is stored in a temporary storage media of the router. You must save a setting you have made so it can survive a reboot.

You can use the display current-configuration command to view the current configuration.

Format and content of a configuration file

A configuration file is saved as a text file according to these rules:

·           A configuration file contains commands.

·           Only non-default configuration settings are saved.

·           The commands are listed in sections by views, usually in this order: system view, interface view, routing protocol view, and user interface view.

·           Sections are separated with one or more blank lines or comment lines that start with a pound sign #.

·           A configuration file ends with a return.

Startup with the configuration file

If a router supports only one startup configuration file, at startup:

1.      If the startup configuration file you specify exists, the router starts up with this configuration file.

2.      If the specified startup configuration file does not exist, the router boots using factory defaults.

Saving the running configuration

To make configuration changes take effect at the next startup of the router, you can save the running configuration to the startup configuration file to be used at the next startup before the router reboots.

Enabling configuration file auto-save

·           After enabling the configuration file auto-save function, when you save the current configuration by executing the save [ safely ] [ force ] command or executing the save filename all command and then pressing Enter, the active MPU and standby MPU automatically save the current configuration to the specified configuration file, and use this file for the next startup, thus keeping the consistency of the configuration files on the active MPU and standby MPU.

·           If the configuration file auto-save function is not enabled, when you save the current configuration by executing the save [ safely ] [ force ] command or executing the save filename all command and then pressing Enter, only the active MPU automatically saves the current configuration to the specified configuration file, and uses the file as the configuration file at the next startup. The standby MPU neither saves the configuration file nor configures the file as the startup configuration file for the next startup.

To configure the configuration file auto-save function:

 

Step

Command

Remarks

1.     Enter system view.

system-view

N/A

2.     Enable configuration file auto-save.

slave auto-update config

Optional.

Enabled by default.

 

 

NOTE:

If you execute the save filename command and press Enter, the system saves the current configuration to the specified path, but the standby MPU does not save the configuration.

 

Selecting the mode for saving the configuration file

You can modify the router configuration at the CLI. To use the modified configuration for subsequent startups, you must save it as a configuration file by using the save command. You can save the configuration file in two modes:

·           Fast saving—In this mode, you use the save command without the safely keyword. The file is saved more quickly but is likely to be lost if the router reboots or the power fails during the process.

·           Safe—In this mode, you use the save command with the safely keyword. The file is saved slowly, but the system retains the configuration file even if the router reboots or the power fails during the process.

The fast saving mode is suitable for environments where the power supply is stable. The safe mode, however, is preferred in environments where stable power supply is unavailable or remote maintenance is required.

 

CAUTION

CAUTION:

A router reboot or power failure while the configuration file is being saved may result in loss of the configuration file for next startup. In this case, the router should be started with factory defaults and after the router starts, you need to re-specify a configuration file to be used at the next startup.

 

To save the current configuration:

 

Task

Command

Remarks

Save the current configuration to the specified file. This configuration file will not be set as the configuration file for the next startup.

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

Use either command.

Available in any view.

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.

save [ safely ]

 

 

NOTE:

·       The configuration file must have the .cfg extension.

·       If you press Enter after entering the save command, you save the configuration file in an interactive way. In this way, you can use the default path or enter a filename to specify a new path, but the suffix of the filename must be .cfg and the path must be the path of the storage media on the active MPU.

·       If you use the save file-name command, even if the configuration file saving synchronization for the active MPU and standby MPU function is enabled, the standby MPU does not automatically save the current configuration to its own configuration file. If you do not specify the file-name argument, the standby MPU automatically saves the current configuration when the active MPU executes the save command.

·       In interactive mode, if you use the non-default path, which means you enter a new filename, the system automatically sets the file as the configuration file to be used at the next startup of the router.

 

Erasing the startup configuration file

When the configuration file is erased, the router starts up with the default configuration next time it is powered on.

You may need to erase the configuration file for either of the following reasons:

·           After you upgrade software, the original configuration file does not match the new software.

·           The startup configuration file is corrupted or not the one you need.

To erase the configuration file:

 

Task

Command

Remarks

Erase the startup configuration file from the storage media.

reset saved-configuration

Available in user view

 

CAUTION

CAUTION:

The reset saved-configuration command permanently deletes the configuration file from the router. Use it with caution.

 

Setting configuration rollback

Configuration rollback

Configuration rollback allows you to revert to a previous configuration state based on a specified configuration file. The specified configuration file must be a valid .cfg file generated by using either the backup function (manually or automatically) or the save command. If the configuration file is generated by another router, the file must comply with the format of the configuration file on the current router. H3C recommends that you use the configuration file generated by using the backup function (manually or automatically). You can apply configuration rollback in these situations:

·           Running configuration error. Rolling back the running configuration to a correct one is needed.

·           The application environment has changed and the router has to run in a configuration state based on a previous configuration file without being rebooted.

Before setting configuration rollback:

1.      Specify the filename prefix and path for saving the running configuration.

2.      Save the running configuration with the specified filename (filename prefix + serial number) to the specified path. You can save the running configuration automatically or manually.

When you execute the configuration replace file command, the system compares the running configuration and the specified replacement configuration file. The configuration replace file command:

·           Preserves all commands present in both the replacement configuration file and the running configuration.

·           Removes commands from the running configuration that are not present in the replacement configuration file.

·           Applies the commands from the replacement configuration file that are not present in the running configuration.

·           Applies the commands from the replacement configuration file that have different configurations in the running configuration.

 

 

NOTE:

The running configuration is only saved to the active MPU. Only the configuration on the active MPU can be rolled back. However, the related configuration is synchronized to the standby MPU to ensure the rollback of the configuration after an active/standby switchover.

 

Configuration task list

Complete these tasks to configure the configuration rollback:

 

Task

Remarks

Configuring parameters for saving the running configuration

Required.

Enabling automatic saving of the running configuration

Required.

Use either approach.

Manually saving the running configuration

Setting configuration rollback

Required.

 

Configuring parameters for saving the running configuration

Before you save the running configuration either manually or automatically, you must configure the file path and filename prefix.

After that, the system saves the running configuration with the specified filename (filename prefix_serial number.cfg) to the specified path. The filename of a saved configuration file is like 20080620archive_1.cfg, or 20080620archive_2.cfg. The saved configuration files are numbered automatically, from 1 to 1,000 (with an increment of 1). If the serial number reaches 1,000, it restarts from 1.

·           If you change the file path or filename prefix, or reboot the router, the saved file serial number restarts from 1, and the system recounts the saved configuration files.

·           If you change the path of the saved configuration files, the files in the original path become common configuration files. These files are no longer processed as saved configuration files or displayed when you view the saved configuration files.

The number of saved configuration files has an upper limit. If the maximum number of files is saved, the system deletes the oldest files when the next configuration file is saved.

To configure parameters for saving the running configuration:

 

Step

Command

Remarks

1.     Enter system view.

system-view

N/A

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

archive configuration location directory filename-prefix filename-prefix

By default, the path and filename for saving configuration files are not configured, and the system does not save the configuration file at a specified interval.

2.     Set the maximum number of configuration files that can be saved.

archive configuration max file-number

Optional.

The default number is 5.

 

 

NOTE:

·       You can perform the save and rollback operations 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 of the saved configuration file 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 that the path cannot include any slot number.

·       If you execute the undo archive configuration location command, the running configuration cannot be saved either manually or automatically. The configuration performed by executing the archive configuration interval and archive configuration max commands is restored to the default, and the saved configuration files are cleared.

·       The value of the file-number argument is determined by memory space. H3C recommends that you set a comparatively small value for the file-number argument if the available memory space is small.

 

Enabling automatic saving of the running configuration

You can configure the system to save the running configuration at a specified interval. Then, you can use the display archive configuration command to view the filenames and save time of the saved configuration files. This enables you to easily roll back the current configuration to a previous configuration state.

Configure an automatic save interval based on the storage media’s performance and the frequency of configuration modification:

·           If the router configuration does not change frequently, manually save the running configuration as needed.

·           If a low-speed storage media (such as a Flash) is used, save the running configuration manually, or 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 router configuration changes frequently, set a shorter saving interval.

To enable automatic saving of the running configuration:

 

Step

Command

Remarks

1.     Enter system view.

system-view

N/A

2.     Enable the automatic saving of the running configuration, and set the interval.

archive configuration interval minutes

Optional.

Disabled by default.

 

 

NOTE:

You must specify the path and filename prefix for saving configuration files before configuring the automatic saving period.

 

Manually saving the running configuration

Automatic saving the running configuration consumes system resources. Frequent save operations can hamper system performance. Therefore, if the system configuration does not change frequently, H3C recommends that you disable the automatic saving of the running configuration and save the configuration manually.

While automatic saving of the running configuration is performed periodically, manual saving can immediately save the running configuration. Therefore, before performing any complicated configuration, manually save the running configuration so that the router can revert to the previous state if the configuration fails.

To manually save the running configuration:

 

Task

Command

Remarks

Manually save the running configuration.

archive configuration

Available in user view

 

 

NOTE:

Specify the path and filename prefix of a save configuration file before you manually save the running configuration; otherwise, the operation fails.

 

Setting configuration rollback

To set configuration rollback:

 

Step

Command

1.     Enter system view.

system-view

2.     Set configuration rollback.

configuration replace file filename

 

CAUTION

CAUTION:

If a command cannot be rolled back, the system skips it and processes the next one.

Configuration rollback may fail if:

·       A card is unplugged or plugged during configuration rollback, that is, when the system is executing the configuration replace file command.

·       The complete undo form of a command is not supported, namely, you cannot get the actual undo form of the command by simply putting the keyword undo in front of the command, so the complete undo form of the command cannot be recognized by the router.

·       The configuration cannot be removed, such as hardware-related commands.

·       Commands in different views are dependent on each other.

·       The replacement configuration file is not a complete file generated by using the save or archive configuration command, or the file is copied from a different type of router. Make sure that the replacement configuration file is correct, complete, and compatible with the current router.

·       The configuration file specified is not in simple text. 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.

 

Specifying a configuration file for the next startup

To specify a startup configuration to be used at the next system startup, you can:

·           Use the save command. If you save the running configuration to the specified configuration file in the interactive mode, the system automatically sets the file as the startup configuration file to be used at the next system startup. For a router supporting main/backup startup configuration file, the system sets the file as the main startup configuration file to be used at the next system startup.

·           Use the command dedicated to specify a startup configuration file, which is described in the following table:

To specify a configuration file as the startup configuration file to be used at the next system startup:

 

Task

Command

Remarks

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

startup saved-configuration cfgfile

Available in user view

 

CAUTION

CAUTION:

·       A configuration file must use .cfg as its extension name. The startup configuration file must be saved in the root directory of the first partition.

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

 

Backing up/restoring the configuration file to be used at the next startup

Backup/restore function overview

The backup/restore function allows you to backup or restore a configuration file to be used at the next startup through operations at the CLI.

TFTP is used for intercommunication between the router and the server. The backup function enables you to backup a configuration file to the TFTP server, while the restore function enables you to download the configuration file from the TFTP server for the next startup of the system.

When you execute the restore command on your active MPU, you restore the startup configuration file for both the active MPU and the standby MPU. However, when you execute the backup command on your active MPU, your operation does not take effect on the standby MPU.

 

 

NOTE:

The backup/restore operation applies to the configuration file to be used at the next startup.

 

Backing up the configuration file to be used at the next startup

 

Task

Command

Remarks

Back up the configuration file to be used at the next startup.

backup startup-configuration to dest-addr [ filename ]

Available in user view

 

 

NOTE:

Before the backup operation:

·       Make sure that the router and the server can reach each other, the server is enabled with TFTP service, and the client has the read and write permission.

·       Use the display startup command (in user view) to see if you have set the startup configuration file, and use the dir command to verify if this file exists. If the file is set as NULL or does not exist, the backup operation fails.

 

Restoring the startup configuration file to be used at the next startup

The restore function allows you to copy a configuration file from a TFTP server to the root directory of the storage media of both the active MPU and standby MPU and specify the file as the startup configuration file to be used at the next startup.

To restore a startup configuration file to be used at the next startup:

 

Task

Command

Remarks

Restore the startup configuration file to be used at the next startup.

restore startup-configuration from src-addr filename

Available in user view

 

 

NOTE:

·       Before restoring a configuration file, make sure that the router and the server can reach each other, the server is enabled with TFTP service, and the client has read and write permission.

·       When the command is successfully executed, you can use the display startup command (in user view) to verify if the filename of the startup configuration file is the same as the filename argument, and use the dir command to verify if the restored file exists.

 

Displaying and maintaining a configuration file

 

Task

Command

Remarks

Display the currently used configuration file saved in the storage media.

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

Available in any view

Display configuration rollback information.

display archive configuration [ | { begin | exclude | include } regular-expression ]

Available in any view

Display the configuration file used at this and next startup.

display startup [ | { begin | exclude | include } regular-expression ]

Available in any view

Display the validated configuration in the current view.

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

Available in any view

Display the current configuration.

display current-configuration [ [ configuration [ configuration ] | interface [ interface-type ] [ interface-number ] ] [ by-linenum ] [ | { begin | exclude | include } text ] ] [ | { begin | exclude | include } regular-expression ]

Available in any view

 

 

NOTE:

For more information about the display this and display current-configuration commands, see Fundamentals Command Reference.

 

  • 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
新华三官网