load configuration replace

Function

The load configuration replace command loads the configuration file on a local or remote server to replace the running configuration on the current device.

Format

load configuration file filename replace [ relative ]

load configuration server ip-address [ vpn-instance vpn-instance-name ] transport-type { ftp | sftp } username user-name password password file filename replace [ relative ]

load configuration server ipv6 ipv6-address [ vpn-instance vpn-instance-name ] transport-type { ftp | sftp } username user-name password password file filename replace [ relative ]

load configuration server http url url-address [ vpn-instance vpn-instance-name ] [ file filename ] replace [ relative ]

Parameters

Parameter Description Value
relative

Specifies that only configurations in the current view are replaced.

-

server ip-address

Specifies the IPv4 address of the remote server.

The value is in dotted decimal notation.

vpn-instance vpn-instance-name

Specifies a VPN instance name.

The value is a string of 1 to 31 case-sensitive characters, spaces not supported. In addition, the VPN instance name must not be _public_. When double quotation marks are used around the string, spaces are allowed in the string.

transport-type

Specifies a file transfer mode.

-

ftp

Transfers files through FTP.

-

sftp

Transfers files through SFTP.

-

username user-name

Specifies the user name of a remote server.

The value is a string of 1 to 64 case-sensitive characters, spaces and question marks not supported.

password password

Specifies the password of a remote server.

The value is a string of case-sensitive characters, including letters and digits. The string can contain spaces if it is enclosed in double quotation marks ("). A simple password is a string of 1 to 255 characters, while a ciphertext password is a string of 20 to 432 characters.

file filename

Specifies the name of the configuration file to be loaded.

The value (including the file name extension) is a string of 1 to 128 case-sensitive characters, including uppercase letters, lowercase letters, digits, and special characters but excluding spaces.

Special characters do not include ~ ? * / \ : " | < > [ ] In addition, the value must not start or end with a period (.).

The file name extension must be .cfg, .zip, .dat, .bat, .txt, or name of text file without suffix.FTP or SFTP also supports the file names with a server directory.The file name does not support the following special characters: ~ ? * : " | < > [ ]

ipv6 ipv6-address

Specifies the IPv6 address of a remote server.

The value is a 32-digit hexadecimal number, in the format of X:X:X:X:X:X:X:X.

http

Specifies access to the remote server by HTTP.

HTTP and HTTPS can be used.

url url-address

Specifies the URL path of the configuration file on the remote server.

The value is a string of 1 to 255 characters.

Views

All views except the user view

Default Level

3: Management level

Task Name and Operations

Task Name Operations
cli debug

Usage Guidelines

Usage Scenario

In the scenario where multiple devices share the same source, to ensure that the configuration data on all devices is consistent, you can use the command in different formats to load the source file to replace the local configuration based on the source location of the configuration file.

  • Run the load configuration file replace [ relative ] command to load the local configuration file and replace the current running configurations.
  • Run the load configuration { server | server ipv6 } transport-type { ftp | sftp } file replace [ relative ] command to load the configuration file on a remote server and replace the current running configurations.
  • Run the load configuration http url file replace [ relative ] command to load the configuration file on a remote server at the specified URL and replace the current running configurations.

The load configuration replace command replaces the entire configurations file or configurations in a specific view. This depends on the content in the loaded configuration file. If relative is specified, only configurations in the current view are replaced.

Follow-up Procedure

After the configuration file is loaded and replaced, the file enters the candidate configuration database. Run the commit command for relevant configurations to take effect.

Precautions

  1. The specified configuration file to be loaded must exist and meet the following conditions:
  • The configuration file can contain only configuration commands, view switching commands, and # symbols. If you load other types of commands, such as display commands used for query, reset/save/ping commands used for maintenance, quit, commit, return, and upgrade-compatible commands, and one-phase configuration validation commands, the device reports an error and continues to load follow-up commands.
  • The interactive commands in the configuration file support only Y/N automatic interaction.
  • The indentation of commands in the configuration file must be correct. In the configuration file, the commands in the system view and the level-1 view under the system view must be left-aligned, the commands in the level-1 view must be indented by one space, and each subsequent view must be indented by one more space.
  • If the pound sign (#) is left-aligned, the system view is displayed. If the pound sign (#) is indented, it is used only to isolate command blocks; in this case, the pound sign (#) must be aligned with the first command in the following command block. If the pound sign (#) is incorrectly used, configurations may be lost, or commands may be run in an unexpected view.
  • The configuration file name extension must be .zip, .cfg, .txt, .dat, .bat, or name of text file without suffix.FTP or SFTP also supports the file names with a server directory. It is recommended that the directory name contain a slash ("/").The file name does not support special characters "~" "?" "*" ":" """ "|" "<" ">" "[" "]".
    • Both .cfg and .txt files are text files whose content can be directly viewed. If a .cfg or .txt file is specified as the configuration file to be loaded, the system restores the commands in the file one by one during the replacement process.
    • A .zip file is obtained by compressing a .cfg file, occupying less space. If a .zip file is specified as the configuration file to be loaded, the system decompresses the file into a .cfg file, and then restores the commands in the file one by one. The .cfg file must have the same name as the .zip file. Otherwise, the configuration file fails to be loaded.
    • A .dat file is a compressed file, which can be in binary or text mode. Only a .dat file exported from a Huawei device is supported, and the file cannot be modified manually. Otherwise, the file fails to be loaded.
    • A .bat file is used for batch processing. It is a text file that can be modified manually.

2. After the configuration replacement command is executed, pay attention to the prompt. Ensure that the result is correct and meets the expectation before you run the commit command to commit the configuration. This prevents service functions from being affected if only some configurations are successfully replaced.

3. When loading the configuration file on the specified remote server using ftp/stfp, the remote file will be obtained under the root directory of the device first. Please ensure that there is enough space to store the file and there is no file with the same name.

4. You are not advised to manually create a configuration file. If the format of the constructed configuration file is incorrect, configuration restoration may fail or an error may occur during configuration restoration.

Example

# Load a local configuration file named to replace the running configuration.
<HUAWEI> system-view
[~HUAWEI] load configuration file config.cfg replace
# Load the file transferred from a remote server at 10.1.1.1 through SFTP to replace the running configuration on the current device.
<HUAWEI> system-view
[~HUAWEI] load configuration server 10.1.1.1 transport-type sftp username huawei123 password huawei_123 file config.cfg replace
# Load the configuration file named obtained from a remote server by HTTPS and replace configurations in the AAA view.
<HUAWEI> system-view
[~HUAWEI] ssl policy policy1
[*HUAWEI-ssl-policy-policy1] certificate load pem-cert client.crt key-pair rsa key-file client.key auth-code cipher huawei123
[*HUAWEI-ssl-policy-policy1] signature algorithm-list ecdsa-secp256r1-sha256 ecdsa-secp384r1-sha384 ecdsa-secp521r1-sha512 ed25519 ed448 rsa-pss-pss-sha256 rsa-pss-pss-sha384 rsa-pss-pss-sha512 rsa-pss-rsae-sha256 rsa-pss-rsae-sha384 rsa-pss-rsae-sha512 rsa-pkcs1-sha256 rsa-pkcs1-sha384 rsa-pkcs1-sha512 ecdsa-sha1 ecdsa-sha224 rsa-sha1 rsa-sha224 dsa-sha1 dsa-sha224 dsa-sha256 dsa-sha384 dsa-sha512
[*HUAWEI-ssl-policy-policy1] quit
[*HUAWEI] http
[*HUAWEI-http] client ssl-policy abc
[*HUAWEI-http] quit
[*HUAWEI] commit
[~HUAWEI] aaa
[*HUAWEI-aaa] load configuration server http url https://10.1.1.1/https/config.cfg replace relative
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >