01-Fundamentals Configuration Guide

HomeSupportWirelessH3C WX5500E Series Access ControllersConfigure & DeployConfiguration GuidesH3C WX5540E Access Controller Switching Engine Configuration Guides(R2607P26)-6W10101-Fundamentals Configuration Guide
05-Configuration file management configuration
Title Size Download
05-Configuration file management configuration 103.49 KB

You can use the CLI or the Boot menu to manage configuration files. This chapter explains how to manage configuration files from the CLI.

Overview

A configuration file saves a set of commands for configuring software features on the device. You can save any configuration to a configuration file so they can survive a reboot. You can also back up configuration files to a host for future use.

Configuration types

The device has the following types of configurations: factory defaults, startup configuration, and running configuration.

Factory defaults

The device is shipped with some basic settings called "factory defaults." These default settings make sure the device can start up and run correctly when it has no configuration file or when the configuration file is corrupted.

Factory defaults vary with device models and might differ from the default settings of commands.

To view factory defaults, use the display default-configuration command.

Startup configuration

The device uses startup configuration to configure software features during startup. After the device starts up, you can specify a different configuration file for the next startup. This configuration file is called the "next-startup configuration file." The configuration file that has been loaded is called the "current startup configuration file."

If no next-startup configuration file exists, the device starts up with the factory defaults.

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

·          Execute the display startup command. To view detailed file contents, use the more command.

·          After the device reboots, execute the display current-configuration command before making any configuration changes.

Running configuration

The running configuration includes startup settings that have not been changed and new settings you made. The running configuration is stored in the memory and is cleared at a device reboot or power off. To use the running configuration after a power cycling or reboot, save it to a configuration file.

To view the running configuration, use the display current-configuration command.

Configuration file format and content

IMPORTANT

IMPORTANT:

A configuration file must meet the content and format requirements of the device. To ensure a successful configuration load at startup, use a configuration file created on the device. If you edit the configuration file, make sure all edits are compliant with the requirements.

 

A configuration file must meet the following requirements:

·          All commands are saved in their complete form.

·          Commands are sorted in sections by command view, typically in this order: system view, interface view, protocol views, and user interface view.

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

·          The configuration file ends with the word return.

You can execute the save command to save the running configuration to a configuration file. To make sure the configuration file can be loaded, H3C recommends not editing the content and format of the configuration file.

Next-startup configuration file redundancy

You can specify one main next-startup configuration file and one backup next-startup configuration file for redundancy. If a configuration file is not assigned the main or backup attribute, its file attribute is NULL.

At startup, the device tries to start up with the main configuration file. If the main configuration file is corrupted or unavailable, the device tries the backup configuration file. If the backup configuration file is corrupted or unavailable, the device starts up with the factory defaults.

You can specify a main or backup startup configuration file directly (see "Specifying a configuration file for the next startup") or when saving the running configuration (see "Saving the running configuration").

For high availability, do not specify a configuration file as both the main and backup startup configuration files.

Startup configuration file selection

The device selects the configuration file to load at startup, as follows:

1.        If the specified main startup configuration file exists, the device starts up with this configuration file.

2.        If the specified main startup configuration file does not exist but the backup startup configuration file exists, the device starts up with the backup startup configuration file.

3.        If neither the main nor the backup startup configuration file exists, the device starts up with the factory defaults.

Saving the running configuration

To make configuration changes take effect at the next startup, save the running configuration to the startup configuration file for the next startup before the device reboots. The extension of a configuration file must be .cfg.

When saving the running configuration to a configuration file, you can specify the file as the next-startup configuration file.

Use one of the following methods to save the configuration:

·          Fast mode—Use the save command without the safely keyword. In this mode, the device directly overwrites the target next-startup configuration file. If a reboot or power failure occurs during this process, the next-startup configuration file is lost. You must specify a new startup configuration file after the device reboots (see "Specifying a configuration file for the next startup").

·          Safe mode—Use the save command with the safely keyword. Safe mode is slower than fast mode, but more secure. In safe mode, the system saves configuration in a temporary file and starts overwriting the target next-startup configuration file after the save operation is complete. If a reboot or power failure occurs during the save operation, the next-startup configuration file is still retained.

Use the safe mode if the power source is not reliable or you are remotely configuring the device.

After a software upgrade, if you use the safe mode at the first time you save configuration to a configuration file that was created before the upgrade, the system verifies the compatibility of new settings with the settings in the configuration file.

If any incompatibility is found, the system uses the running configuration to overwrite the configuration file after backing up the file to the Flash memory on the device for future rollback. The backup file is named in the _old-filename_bak.cfg format. For example, if the old configuration file is named config.cfg, the backup file is named _config_bak.cfg.

To load the backup configuration file after a software downgrade, specify the file as the next-startup configuration file before performing the downgrade.

To save the running configuration, perform either of the following tasks in any view:

 

Task

Command

Remarks

Save the running configuration to a configuration file without specifying the file as a next-startup configuration file.

save file-url

N/A

Save the running configuration to a configuration file and specify the file as a next-startup configuration file.

save [ safely ] [ backup | main ] [ force ]

If you execute the save [ safely ] command without specifying any other keyword, the command saves the configuration to the main startup configuration file.

If the force keyword is specified, the command saves the configuration to the next-startup configuration file that has been specified.

If the force keyword is not specified, you can respecify a next-startup configuration file as instructed by the system.

 

Configuring configuration rollback

To replace the running configuration with the configuration in a configuration file without rebooting the device, use the configuration rollback function. This function helps you revert to a previous configuration state or adapt the running configuration to different network environments.

The configuration rollback function compares the running configuration against the specified replacement configuration file and handles configuration differences as follows:

·          If a command in the running configuration is not in the replacement file, the rollback function executes the undo form of the command.

·          If a command in the replacement file is not in the running configuration, the rollback function adds the command to the running configuration.

·          If a command has different settings in the running configuration and the configuration file, the rollback function replaces the running command setting with the setting in the configuration file.

To facilitate configuration rollback, the configuration archive function was developed. This function enables the system to save the running configuration automatically at regular intervals.

Configuration task list

Task

Remarks

Configuring configuration archive parameters

Required.

·      Enabling automatic configuration archiving

·      Manually archiving running configuration

Required.

Use either method.

Rolling back configuration

Required.

 

Configuring configuration archive parameters

Before archiving the running configuration, either manually or automatically, you must configure a file directory and file name prefix for configuration archives.

Configuration archives are saved with the file name format prefix_serial number.cfg, for example, 20080620archive_1.cfg and 20080620archive_2.cfg. The serial number is automatically assigned from 1 to 1000, increasing by 1. After the serial number reaches 1000, it restarts from 1.

After you change the file directory or file name prefix, or reboot the device, the old configuration archives are regarded as common configuration files, the configuration archive counter resets, and the display archive configuration command does not display them. The serial number for new configuration archives starts from 1.

After the maximum number of configuration archives is reached, the system deletes the oldest archive for the new archive.

To configure configuration archive parameters:

 

Step

Command

Remarks

1.       Create the configuration archive directory.

See "Managing the file system."

N/A

2.       Enter system view.

system-view

N/A

3.       Configure the directory and file name prefix for archiving the running configuration.

archive configuration location directory filename-prefix filename-prefix

By default, no path or file name prefix is set for configuration archives, and the system does not regularly save configuration.

IMPORTANTIMPORTANT:

The undo form of this command disables both manual and automatic configuration archiving, restores the default settings for the archive configuration interval and archive configuration max commands, and deletes all saved configuration archives.

4.       Set the maximum number of configuration archives.

archive configuration max file-number

Optional.

The default number is 5.

Change the setting depending on the available amount of storage space.

 

Enabling automatic configuration archiving

To ensure system performance, follow these guidelines when you configure automatic configuration archiving:

·          If the device configuration does not change frequently, manually archive the running configuration as needed.

·          If the device configuration changes frequently, archive the running configuration manually, or configure automatic archiving with an interval longer than 1440 minutes (24 hours).

Make sure you have set an archive path and file name prefix before performing this task.

To enable automatic configuration archiving:

 

Step

Command

Remarks

1.       Enter system view.

system-view

N/A

2.       Enable automatic configuration archiving and set the archiving interval.

archive configuration interval minutes

By default, this function is disabled.

To view configuration archive names and their archiving time, use the display archive configuration command.

 

Manually archiving running configuration

To save system resources, disable automatic configuration archiving and manually archive configuration if the configuration will not be changed very often. You can also manually archive configuration before performing complicated configuration tasks so you can use the archive for configuration recovery after the configuration attempt fails.

Make sure you have set an archive path and file name prefix before performing this task.

Perform the following task in user view:

 

Task

Command

Manually archive the running configuration.

archive configuration

 

Rolling back configuration

To ensure a successful rollback, follow these guidelines:

·          Make sure the replacement configuration file is created by using the configuration archive function or the save command on the current device.

·          If the configuration file is not created on the current device, make sure the configuration file content format is fully compatible with the current device.

·          The replacement configuration file is not encrypted.

To rolling back configuration:

 

Step

Command

1.       Enter system view.

system-view

2.       Roll the running configuration back to the configuration defined by a configuration file.

configuration replace file filename

 

The configuration rollback function might fail to reconfigure some commands in the running configuration for one of the following reasons:

·          A command cannot be undone, because prefixing the undo keyword to the command does not result in a valid undo command. For example, if the undo form designed for the A [B] C command is undo A C, the configuration rollback function cannot undo the A B C command, because the system does not recognize the undo A B C command.

·          A command (for example, a hardware-dependent command) cannot be deleted, overwritten, or undone due to system restrictions.

·          The commands in different views are dependent on each other.

·          Commands or command settings that the device does not support cannot be added to the running configuration.

Specifying a configuration file for the next startup

You can specify a .cfg configuration file as the main startup configuration file to be used at the next startup when you use the save command to save the running configuration to it.

Alternatively, perform the following task in user view to specify the next-startup configuration file:

 

Task

Command

Remarks

Specify the next-startup configuration file.

startup saved-configuration cfgfile [ backup | main ]

The configuration file must use the .cfg extension and be saved in the root directory of the storage medium.

 

Backing up the next-startup configuration file to a TFTP server

Before performing this task, make sure the following requirements are met:

·          The server is reachable and enabled with TFTP service.

·          You have read and write permissions.

This task backs up only the main next-startup configuration file.

To back up the next-startup configuration file to a TFTP server:

 

Step

Command

Remarks

1.       Verify that a next-startup configuration file has been specified in user view.

display startup

Optional.

If no next-startup configuration file has been specified, the backup operation will fail.

2.       Back up the next-startup configuration file to a TFTP server in user view.

backup startup-configuration to dest-addr [ dest-filename ]

N/A

 

Deleting the next-startup configuration file

CAUTION

CAUTION:

This task permanently deletes the next-startup configuration file from the device. Before performing this task, back up the file as needed.

 

You can delete the main, the backup, or both.

If the main and backup next-startup configuration files are the same file, the system sets the attribute of the configuration file to NULL instead of deleting the file. You can permanently delete the file after its attribute changes to NULL.

Delete the next-startup configuration file if one of the following occurs:

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

·          The file is corrupted or not fully compatible with the device.

After the file is deleted, the device uses factory defaults at the next startup.

Perform the following task in user view:

 

Task

Command

Remarks

Delete the next-startup configuration file.

reset saved-configuration [ backup | main ]

If neither backup nor main is specified, this command deletes the main next-startup configuration file.

 

Restoring the next-startup configuration file from a TFTP server

Perform the task in this section to download a configuration file from a TFTP server to the root directory of the storage medium, and specify the file as the next-startup configuration file.

This task restores only the main next-startup configuration file.

Before restoring the next-startup configuration file, make sure the following requirements are met:

·          The server is reachable and enabled with TFTP service.

·          You have read and write permissions.

To restore the next-startup configuration file from a TFTP server:

 

Step

Command

Remarks

1.       Restore the main next-startup configuration file from a TFTP server in user view.

restore startup-configuration from src-addr src-filename

N/A

2.       Verify that the specified configuration file has been set as the main next-startup configuration file.

display startup

Optional.

 

Displaying and maintaining configuration files

Task

Command

Remarks

Display information about configuration rollback.

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

Available in any view.

Display the running configuration.

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

Available in any view.

Display the factory defaults.

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

Available in any view.

Display the next-startup configuration file saved on the storage medium of the device.

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

Available in any view.

Display names of the configuration files used at this startup and the next startup.

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

Available in any view.

Display the valid configuration in the current view.

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

Available in any view.

 

  • Cloud & AI
  • InterConnect
  • Intelligent Computing
  • Intelligent Storage
  • Security
  • SMB Products
  • Intelligent Terminal Products
  • Product Support Services
  • Technical Service Solutions
All Services
  • Resource Center
  • Policy
  • Online Help
  • Technical Blogs
All Support
  • Become A Partner
  • Partner Policy & Program
  • Global Learning
  • Partner Sales Resources
  • Partner Business Management
  • Service Business
All Partners
  • Profile
  • News & Events
  • Online Exhibition Center
  • Contact Us
All About Us