< Home

compare configuration

Function

The compare configuration command compares whether the current configurations are identical with the next startup configuration file.

Format

compare configuration [ configuration-file ] [ current-line-number save-line-number ]

Parameters

Parameter Description Value

configuration-file

Specifies the name of the configuration file to be compared with the current configurations.

The value is a string of 5 to 48 characters without spaces.

current-line-number

Specifies the start line number in the current configuration file for comparing.

The value is an integer ranging from 0 to 65535.

save-line-number

Specifies the start line number in the saved configuration file for comparing.

The value is an integer ranging from 0 to 65535.

Views

User view

Default Level

3: Management level

Usage Guidelines

Usage Scenario

After a series of operations are performed, you can run the compare configuration command to compare the current configurations (including offline configurations) and the next startup or specified configuration file, and check what configurations are inconsistent. Then, you can decide whether to save and set the current configurations as the next startup configuration file.

Configuration Impact

If you run the compare configuration command after you run the save command, the system may display a message to inform you of inconsistent configurations. This is a normal case, and no action is required.

Running the save command saves the configurations as the next startup configuration file and running the compare configuration command compares the current configurations (which can be obtained using the display current-configuration ) with the next startup or specified configuration file. Therefore, if other operations are performed after you save the configurations, the current configuration file and the next startup configuration file will be inconsistent.

Precautions

If neither current-line-number nor save-line-number is specified, the system compares the saved configurations with the current configurations from the first line. If the two parameters are specified, the system skips the difference before the compared lines and continues to find differences between the configuration files.

Finally, the system outputs the differences (namely, locating the differences) between the saved configurations and the current configurations. By default, the output difference information is restricted to 150 characters. If there are less than 150 characters, differences till the end of two files are displayed.

The filename extension of the configuration file must be .cfg or .zip.

If configuration-file is not specified, the system compares whether the current configurations are identical with the next startup configuration file.

If configuration-file is specified, the system compares whether the current configurations are identical with the specified startup configuration file.

When the system is comparing configuration files, other users are not allowed to perform.

The system stores passwords in ciphertext in the configuration file. To secure passwords, the system modifies the ciphertext dynamically in the configuration file. Therefore, it is normal if the ciphertext changes when the password is not changed. If you run the compare configuration command, the system warns you that the password has changed, ignore it.

Example

# Compare whether the current configurations are identical with the next startup configuration file.

<sysname> compare configuration
Warning: The current configuration is not the same as the next startup configuration file. There may be several differences, and the following are some configurations beginning from the first:
 ====== Current configuration line 2 ======
 sysname test
#
 FTP server enable
#
 info-center source FTPS channel 4 log level debugging trap state on debug state on 

 ====== Saved configuration line 2 ======
 sysname NFP_185
#
 FTP server enable
#
 info-center source FTPS channel 4 log level debugging trap state on debug state on
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >