< Home

Restoring the Configuration File

Context

When incorrect configurations are performed and functions are abnormal, you can use one of the following methods to restore a backed up configuration file:

  • Restore a configuration file backed up to the storage device.
  • Restore a configuration file using FTP, TFTP, FTPS, SFTP, or SCP.

After restoring the configuration file, you must restart the device to make the configuration take effect. Run the startup saved-configuration command to specify the next startup configuration file unless the configuration file name has not changed. Then run the reboot command to restart the device.

Procedure

  • Restore the configuration file backed up in the flash memory.

    This step restores the backup configuration file stored in the flash memory of the device to the current system configuration file. When the device is working properly, run the following command:

    <HUAWEI> copy flash:/backup.cfg flash:/config.cfg

  • Restore a configuration file using FTP, TFTP, FTPS, SFTP, or SCP.

    The device supports configuration file restoration using FTP, TFTP, FTPS, SFTP, or SCP. Configuration file restoration using FTP or TFTP is simple, but there are security risks. In scenarios with high security requirements, configuration file restoration using FTPS, SFTP, or SCP is recommended. The following describes how to restore the configuration file backed up on a PC using FTP. For details about TFTP, FTPS, SFTP, and SCP, see File Management.

    1. Start the FTP service when the device works as an FTP server.

      Enable the FTP server function on the device. Create an FTP user with the name huawei and password Helloworld@6789. This authorizes the user to access the flash directory.

      <HUAWEI> system-view
      [HUAWEI] ftp server enable
      Warning: FTP is not a secure protocol, and it is recommended to use SFTP.
      Info: Succeeded in starting the FTP server.
      [HUAWEI] aaa
      [HUAWEI-aaa] local-user huawei password irreversible-cipher Helloworld@6789
      [HUAWEI-aaa] local-user huawei ftp-directory flash:
      [HUAWEI-aaa] local-user huawei service-type ftp
      [HUAWEI-aaa] local-user huawei privilege level 15

    2. On the maintenance terminal, initiate an FTP connection to the device.

      On the PC, run the following command to set up an FTP connection to the device using the FTP client. In this example, the device IP address is 10.110.24.254.

      C:\Documents and Setting\Administrator> ftp 10.110.24.254
      Connected to 10.110.24.254.
      220 FTP service ready.
      User (10.110.24.254:(none)): huawei
      331 Password required for huawei.
      Password:
      230 User logged in.

    3. Configure transfer parameters.

      If the FTP user is authenticated, the FTP client displays the prompt character of ftp>. Enter binary following the prompt character, and specify the path where the uploaded file is to be saved on the FTP client.

      ftp> binary
      200 Type set to I.
      ftp> lcd c:\temp
      Local directory now C:\temp.

    4. Transfer the configuration file.

      On the PC, run the put command to upload the configuration file to the specified path and save the file as backup.cfg.

      ftp> put config.cfg backup.cfg

    5. Check whether the backup.cfg file is successfully uploaded. If the backup.cfg file exists on the device and has the correct size, you have successfully restored the configuration file.
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >