S1720, S2700, S5700, and S6720 V200R011C10 Configuration Guide - Basic Configuration

This document describes methods to use command line interface and to log in to the device, file operations, and system startup configurations.

Backing Up the Configuration File

Backing Up the Configuration File

Context

If the device is damaged unexpectedly, the configuration file cannot be recovered. You can back up the configuration file in advance using one of the following methods:
  • Copy the content displayed on the screen.
  • Back up the configuration file to the storage device.
  • Back up the configuration file using FTP, TFTP, FTPS, SFTP, or SCP.
  • Run a command to back up the configuration file.
  • Run a command to back up the current running configuration in real time.

Procedure

  • Copy the content displayed on the screen.

    Run the display current-configuration command and copy all command outputs to a .txt file. The configuration file is backed up in the hard disk of the maintenance terminal.

    If a configuration is too long, it may be displayed in two lines on the terminal screen, depending on the terminal software. When copying a two-line configuration from the screen to a .txt file, ensure that the configuration is displayed in only one line. Otherwise, configuration restoration will fail when the .txt file is used.

  • Back up the configuration file to the storage device.

    The current configuration file can be backed up immediately to the flash memory of the device. After the device starts, run the following commands to back up the configuration file to the flash memory of the device:

    <HUAWEI> save config.cfg
    <HUAWEI> copy config.cfg backup.cfg

  • Back up the configuration file using FTP, TFTP, FTPS, SFTP, or SCP.

    The device supports configuration file backup using FTP, TFTP, FTPS, SFTP, or SCP. Configuration file backup using FTP or TFTP is simple, but there are security risks. In scenarios with high security requirements, configuration file backup using FTPS, SFTP, or SCP is recommended. The following describes the configuration file backup process using FTP as an example. For details about TFTP, FTPS, SFTP, and SCP, see File Management.

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

      Enable the FTP server function on the device. Create an FTP user with the name huawei and password Helloworld@6789. The user is authorized to access the flash memory 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 memory:
      [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 get command to load the configuration file to the specified path and save the file as backup.cfg.

      ftp> get flash:/config.cfg backup.cfg

    5. Check whether the config.cfg and backup.cfg files have the same size. If they have the same size, you have successfully backed up the configuration file.
  • Run a command to back up the configuration file.

    Run configuration copy startup to file file-name

    The startup configuration file is backed up to a specified file.

    The file name extension of the specified destination file must be .cfg or .zip. The extensions of the destination and backup files must be the same.

    If a file with the same name already exists, the system asks whether to replace the previous file. Press Y to replace the file or N not to do so.

  • Run a command to back up the current running configuration in real time.

    In the system view, run undo configuration backup local disable.

    The function of backing up the current running configuration is enabled.

    If the configuration changes, the device will automatically back up the current running configuration to the device after two hours.

    By default, the function of backing up the current running configuration to the device is enabled. To disable this function, run the configuration backup local disable command.