01-Fundamentals Configuration Guide

HomeSupportConfigure & DeployConfiguration GuidesH3C Access Points Anchor AC Mode Configuration Guides(E2442 R2442)-6W10001-Fundamentals Configuration Guide
06-Configuration file management configuration
Title Size Download
06-Configuration file management configuration 118.24 KB

Managing configuration files

About configuration file management

You can manage configuration files from the CLI or the BootWare menu. The following information explains how to manage configuration files from the CLI.

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 the configuration can survive a reboot. You can also back up configuration files to a host for future use.

Configuration types

Initial configuration

Initial configuration is the collection of initial default settings for the configuration commands in software.

The device starts up with the initial configuration if you access the BootWare menu and select the Skip Current System Configuration option. In this situation, the device might also be described as starting up with empty configuration.

No commands are available to display the initial configuration. To view the initial default settings for the configuration commands, see the Default sections in the command references.

Factory defaults

Factory defaults are custom basic settings that came with the device. Factory defaults vary by device models and might differ from the initial default settings for the commands.

The device starts up with the factory defaults if no next-startup configuration files are available.

To display the 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 the configuration file to be loaded at 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.

You can display the startup configuration by using one of the following methods:

·     To display the contents of the current startup configuration file, execute the display current-configuration command before changing the configuration after the device reboots.

·     To display the contents of the next-startup configuration file, use the display saved-configuration command.

·     Use the display startup command to display names of the current startup configuration file and next-startup configuration files. Then, you can use the more command to display the contents of the specified startup configuration file.

Running configuration

The running configuration includes unchanged startup settings and new settings. The running configuration is stored in 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 display the running configuration, use the display current-configuration command.

Configuration file types and file selection process at startup

When you save the configuration, the system saves the settings to a .cfg configuration file and to an .mdb file.

·     A .cfg configuration file is a human-readable text file and its contents can be displayed by using the more command. Configuration files you specify for saving the configuration must use the .cfg extension.

·     An .mdb file is a user-inaccessible binary file that has the same name as the .cfg file. The device loads an .mdb file faster than loading a .cfg file.

At startup, the device uses the following procedure to identify the configuration file to load:

1.     The device searches for a valid .cfg next-startup configuration file. For more information about the file selection rules, see "Next-startup configuration file redundancy."

2.     If a valid .cfg next-startup configuration file is found, the device searches for an .mdb file that has the same name and checksum as the .cfg file.

3.     If a matching .mdb file is found, the device starts up with the .mdb file. If none is found, the device starts up with the .cfg file.

If no .cfg next-startup configuration files are available, the device starts up with the factory defaults.

Unless otherwise stated, the term "configuration file" in this document refers to a .cfg 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.

At startup, the device tries to select the .cfg startup configuration in the following order:

1.     The main next-startup configuration file.

2.     The backup next-startup configuration file if the main next-startup configuration file does not exist or is corrupt.

If no next-startup configuration files are available, the device starts up with the factory defaults.

Configuration file content organization and format

IMPORTANT

IMPORTANT:

To run on the device, a configuration file must meet the content and format requirements. To ensure a successful configuration load, rollback, or restoration, 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 into sections by different command views, including system view, interface views, protocol views, and user line views.

·     Two adjacent sections are separated by a pound sign (#).

·     The configuration file ends with the word return.

The following is a sample configuration file excerpt:

#

local-user root class manage

 password hash $h$6$Twd73mLrN8O2vvD5$Cz1vgdpR4KoTiRQNE9pg33gU14Br2p1VguczLSVyJLO2huV5Syx/LfDIf8ROLtVErJ/C31oq2rFtmNuyZf4STw==

 service-type ssh telnet terminal

 authorization-attribute user-role network-admin

 authorization-attribute user-role network-operator

#

interface Vlan-interface1

 ip address 192.168.1.84 255.255.255.0

#

Configuration rollback

Configuration rollback allows you to replace the running configuration with the configuration in a configuration file without rebooting the device. You can use this feature for the following purposes:

·     Reverting to a previous configuration state.

·     Adapting the running configuration to different network environments.

Enabling configuration encryption

About this task

Configuration encryption enables the device to encrypt a startup configuration file automatically when it saves the running configuration. All devices running Comware 7 software use the same private key or public key to encrypt configuration files.

Restrictions and guidelines

Any devices running Comware 7 software can decrypt the encrypted configuration files. To prevent an encrypted file from being decoded by unauthorized users, make sure the file is accessible only to authorized users.

You cannot use the more command to view the contents of an encrypted configuration file.

You cannot compare an encrypted configuration file with any configuration for their differences.

Procedure

1.     Enter system view.

system-view

2.     Enable configuration encryption.

configuration encrypt { private-key | public-key }

By default, configuration encryption is disabled.

Saving the running configuration

About this task

When you save the running configuration to a .cfg configuration file, you can specify the file as a next-startup configuration file or not.

If you are specifying the file as a .cfg 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 next-startup configuration file").

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

Restrictions and guidelines

To prevent the loss of next-startup configuration, make sure no one reboots or power cycles the device while the device is saving the running configuration.

Procedure

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

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

save file-url

·     Save the running configuration to a configuration file in the root directory of the storage medium, and specify the file as a next-startup configuration file.

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

As a best practice, specify the safely keyword for reliable configuration saving.

Comparing configurations for their differences

About this task

You can compare configuration files or compare a configuration file with the running configuration for their differences.

If you specify the next-startup configuration for a comparison, the system selects the next-startup configuration file to be compared with in the following order:

1.     The main next-startup configuration file.

2.     The backup next-startup configuration file if the main next-startup configuration file is unavailable.

If both configuration files are unavailable, the system displays a message indicating that no next-startup configuration files exist.

Restrictions and guidelines

If you specify a configuration file for a comparison, the configuration file must be a .cfg configuration file.

Procedure

To compare configurations for their differences, perform one of the following tasks in any view:

·     Display the differences that a configuration file, the running configuration, or the next-startup configuration has as compared with the specified source configuration file.

display diff configfile file-name-s { configfile file-name-d | current-configuration | startup-configuration }

·     Display the differences that a configuration file or next-startup configuration has as compared with the running configuration.

display diff current-configuration { configfile file-name-d | startup-configuration }

·     Display the differences that a configuration file has as compared with the next-startup configuration.

display diff startup-configuration configfile file-name-d

·     Display the differences that the running configuration has as compared with the next-startup configuration.

¡     Method 1:

display diff startup-configuration current-configuration

¡     Method 2:

display current-configuration diff

Configuring configuration rollback

Configuration rollback tasks at a glance

To configure configuration rollback, perform the following tasks:

1.     Setting configuration archive parameters

2.     Archiving the running configuration

¡     Enabling automatic configuration archiving

¡     Manually archiving the running configuration

3.     Rolling back configuration

Setting configuration archive parameters

About this task

Before archiving the running configuration, you must set a file directory and file name prefix for configuration archives.

Configuration archives are named in the format of prefix_serial number.cfg, for example, archive_1.cfg and archive_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.

If you change the file directory or file name prefix, the following events occur:

·     The old configuration archives change to common configuration files.

·     The configuration archive counter is reset. The serial number for new configuration archives starts at 1.

·     The display archive configuration command no longer displays the old configuration archives.

The configuration archive counter does not restart when you delete configuration archives from the archive directory. However, if the device reboots after all configuration archives have been deleted, the configuration archive counter restarts. The serial number for new configuration archives starts at 1.

Restrictions and guidelines

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

The undo archive configuration location command removes the local configuration archive directory and file name prefix settings, but it does not delete the configuration archives on the device. The command also performs the following operations:

·     Disables both the manual and automatic configuration archiving features.

·     Restores the default settings for the archive configuration interval and archive configuration max commands.

·     Clears the configuration archive information displayed by using the display archive configuration command.

Procedure

1.     Enter system view.

system-view

2.     Set 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 on the device, and the system does not regularly save configuration.

The configuration archive directory must already exist on the device.

3.     (Optional.) Set the maximum number of configuration archives.

archive configuration max file-number

The default number is 5.

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

Archiving the running configuration

About this task

The following are methods for archiving the running configuration:

·     Automatic configuration archiving—The system automatically archives the running configuration at intervals as configured.

·     Manual configuration archivingYou can disable automatic configuration archiving and manually archive the running configuration if the configuration will not be changed very often. You can also use this method before performing complicated configuration tasks. If the configuration attempt fails, you can use the archive for configuration recovery.

Restrictions and guidelines for archiving the running configuration

If an archiving has started based on the existing archive parameters when an archive parameter is changed, the archive will still be retained in the old directory. However, the display archive configuration command does not display the record about this archiving.

Enabling automatic configuration archiving

1.     Enter system view.

system-view

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

archive configuration interval interval

By default, automatic configuration archiving is disabled.

Manually archiving the running configuration

Manually archive the running configuration in user view.

archive configuration

Rolling back configuration

About this task

The configuration rollback feature 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 feature executes the undo form of the command.

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

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

Restrictions and guidelines

If configuration rollback fails for some command lines, the system outputs a rollback failure message. To identify those command lines, use the display diff current-configuration configfile file-name-d command, with the replacement file specified for the file-name-d argument. The command lines that have failed to roll back are displayed as configuration differences between the running configuration and the replacement configuration file.

The configuration rollback feature 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 feature cannot undo the A B C command. This is 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.

Make sure the replacement configuration file is created by using the configuration archive feature or the save command on the local device. If the configuration file is not created on the local device, make sure the command lines in the configuration file are fully compatible with the local device.

Procedure

1.     Enter system view.

system-view

2.     Roll the running configuration back to the configuration in a configuration file.

configuration replace file filename

Make sure the specified configuration file is a valid, unencrypted .cfg file that is saved on the local system.

Specifying a next-startup configuration file

Restrictions and guidelines

As a best practice, specify different files as the main and backup next-startup configuration files.

The undo startup saved-configuration command changes the attribute of the main or backup next-startup configuration file to NULL instead of deleting the file.

Prerequisites

Make sure the specified configuration file is valid and has been saved to the root directory of the storage medium on the device.

Procedure

1.     Specify a next-startup configuration file. Choose one of the following methods:

¡     Execute the following command in user view to specify a next-startup configuration file:

startup saved-configuration cfgfile [ backup | main ]

By default, no next-startup configuration files are specified.

¡     Execute the following command in any view to save the running configuration to a file and specify the file as a next-startup configuration file:

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

For more information about this command, see "Saving the running configuration."

If you do not specify the backup or main keyword, this command specifies the configuration file as the main next-startup configuration file.

2.     (Optional.) Verify the configuration. Use one of the following commands in any view:

¡     Display the names of the configuration files for this startup and the next startup.

display startup

¡     Display the contents of the configuration file for the next system startup.

display saved-configuration

Backing up and restoring the main next-startup configuration file

About backing up and restoring the main next-startup configuration file

You can back up the main next-startup configuration file to a TFTP server or restore the main next-startup configuration file from a TFTP server.

Prerequisites for configuration backup and restoration

Before you back up or restore the main next-startup configuration file, perform the following tasks:

·     Make sure the following requirements are met:

¡     The server is reachable.

¡     The server is enabled with TFTP service.

¡     You have read and write permissions to the server.

·     For configuration backup, use the display startup command to verify that the main next-startup configuration file has been specified in user view. If no next-startup configuration file has been specified or the specified configuration file does not exist, the backup operation will fail.

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

To back up the main next-startup configuration file to a TFTP server, execute the following command in user view:

backup startup-configuration to { ipv4-server | ipv6 ipv6-server } [ dest-filename ]

Restoring the main next-startup configuration file from a TFTP server

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

restore startup-configuration from { ipv4-server | ipv6 ipv6-server } src-filename

2.     (Optional.) Verify that the specified configuration file has been set as the main next-startup configuration file. Use one of the following commands in any view:

¡     Display the names of the configuration files for this startup and the next startup.

display startup

¡     Display the contents of the configuration file for the next system startup.

display saved-configuration

Deleting a next-startup configuration file

About this task

You can perform this task to delete a next-startup configuration file.

If both the main and backup next-startup configuration files are deleted, the device uses the factory defaults at the next startup.

To delete a file that is set as both main and backup next-startup configuration files, you must execute both the reset saved-configuration backup command and the reset saved-configuration main command. Using only one of the commands removes the specified file attribute instead of deleting the file.

For example, if the reset saved-configuration backup command is executed, the backup next-startup configuration file setting is set to NULL. However, the file is still used as the main file. To delete the file, you must also execute the reset saved-configuration main command.

Restrictions and guidelines

CAUTION

CAUTION:

This task permanently deletes a next-startup configuration file from the device. As a best practice, make sure you have a configuration backup before you perform this task.

If you do not specify the backup or main keyword when you perform this task, the main next-startup configuration is deleted.

Procedure

To delete a next-startup configuration file, execute the following command in user view:

reset saved-configuration [ backup | main ]

Display and maintenance commands for configuration files

Execute display commands in any view and reset commands in user view.

 

Task

Command

Display configuration archive information.

display archive configuration

Display the running configuration.

display current-configuration [ configuration [ module-name ] | interface [ interface-type [ interface-number ] ] ]

Display the differences that the running configuration has as compared with the next-startup configuration.

display current-configuration diff

Display the factory defaults.

display default-configuration

Display the differences between configurations.

·     display diff configfile file-name-s { configfile file-name-d | current-configuration | startup-configuration }

·     display diff current-configuration { configfile file-name-d | startup-configuration }

·     display diff startup-configuration { configfile file-name-d | current-configuration }

Display the contents of the configuration file for the next system startup.

display saved-configuration

Display the names of the configuration files for this startup and the next startup.

display startup

Display the valid configuration in the current view.

display this

Delete next-startup configuration files.

reset saved-configuration [ backup | main ]

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