< Home

Clearing the Configuration

Context

You can use the following methods to clear the configuration in different scenarios:
  • Clearing the configuration file: If the original configuration file does not match the system software after a system software upgrade, the configuration file is damaged, or an incorrect configuration file is loaded, you can clear the original configuration file and specify a new configuration file.
  • Clearing configurations on an interface at a time: To use a configured interface for another purpose, you need to delete configurations on the interface one by one. If a large number of configurations exist on the interface, deleting the configurations takes much time and increases maintenance workload. To reduce maintenance workload and simplify operation, you can clear all configurations on the interface at a time.
  • Clearing inactive configurations on a switch: If a card is removed, the original configurations on the card are saved on the switch. If the standby/slave switch leaves a stack, the configurations on the switch are saved on the master switch. These invalid configurations are called inactive or offline configurations. You can run a command to clear all the inactive configurations on the switch to increase available space.
Configurations cannot be restored after clearing. Therefore, exercise caution when deciding to run this command. You are advised to run this command under the guidance of technical support personnel.

Procedure

  • Clear the configuration file.

    Run the reset saved-configuration command to clear the next startup configuration file and cancel the configuration file used for next startup. The default device configurations are restored.

    • If the current startup configuration file is the same as the next startup configuration file when you run the reset saved-configuration command, the current startup configuration file is also cleared.
    • After you run this command and manually restart the device, the system displays a message asking you whether to save the configurations. Select N to clear the configurations.
    • If you do not use the startup saved-configuration command to specify a new configuration file or do not save the configuration file after the file is not used for next startup, the device uses default factory configurations for startup.
    • If the current configuration file is empty, and the configuration file for the next startup is not empty, running the reset saved-configuration command clears the settings for the configuration file for the next startup.

    • If the configuration file for next startup is empty, and the current configuration file is not empty, after the reset saved-configuration command is run, the system prompts an error and no settings are cleared.

  • Delete configurations on an interface at a time to restore the default configurations.

    For details, see Table 1.

    Table 1 Commands for deleting configurations on an interface at a time to restore the default configurations

    View

    Command

    Description

    Precautions

    System view

    clear configuration interface interface-type interface-number

    Deletes the configuration information on the specified interface or restores the default settings. Make sure that the command is run in the system view and the specified interface type and number are correct. Otherwise, the configuration information on other interfaces may be deleted and services are interrupted.

    Deleting configurations on an interface causes the interface to be shut down. Therefore, exercise caution when running the two commands.

    Interface view

    clear configuration this

    Deletes the configuration information on the current interface or restores the default settings. The command is directly run in the interface view, which simplifies the operation.
    NOTE:

    You cannot run this command in the tunnel or stack-port interface view.

  • Clear inactive configurations on the switch.

    1. Run system-view

      The system view is displayed.

    2. Run clear inactive-configuration all

      Inactive configurations on the switch are cleared.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >