Huawei S5700 Factory Reset: Three Official Methods - 夜莺博客

Huawei S5700 Factory Reset: Three Official Methods

Huawei's official documentation describes three ways to restore S Series campus switches to factory settings: press and hold the PNP button, run the one-click reset factory-configuration command, or clear the saved configuration file and reboot. Each method clears different data, so choosing the right one matters. This guide covers all three with the exact CLI output, what gets deleted, and the configuration you need after the reset.

Before You Start

Log in through the console port whenever possible - Telnet or STelnet sessions are lost when the switch is restored to factory settings. Back up the configuration first:

<HUAWEI> display current-configuration   ! copy output to a local .txt file
<HUAWEI> save
<HUAWEI> system-view
[HUAWEI] ssh client first-time enable
[HUAWEI] sftp 10.1.1.1
sftp-client> put vrpcfg.zip          ! upload config to the backup server

Method 1: PNP Button

On devices with a PNP button, press and hold it for more than 6 seconds. The device restores factory settings and automatically restarts. No login is required - this is the easiest method for unboxing or repurposing hardware.

Method 2: One-Click Reset

<HUAWEI> reset factory-configuration
Warning: The command will delete all the configurations and files (except the
startup, patch, module, and license files) from the device. Continue? [Y/N]:y
Warning: The system will reboot after configurations and files are deleted. Continue? [Y/N]:y

This deletes all directories and files except the system software package, patch file, plug-in and license file, then reboots automatically.

Method 3: Clear the Configuration File

<HUAWEI> reset saved-configuration
Warning: The action will delete the saved configuration in the device.
The configuration will be erased to reconfigure. Continue? [Y/N]:y
Info: Succeeded in clearing the configuration in the device.

<HUAWEI> reboot
Warning: The configuration has been modified, and it will be saved to the next
startup saved-configuration file flash:/vrpcfg.zip. Continue? [Y/N]:n
System will reboot! Continue?[Y/N]:y

Answer n when asked to save the configuration, otherwise the startup file is rewritten. This method clears only the current configuration and configuration file - data files are kept.

What Gets Cleared: Methods Compared

Method Login required Cleared Reboot
PNP button No All files except startup, patch, module, license Automatic
reset factory-configuration Yes All files except startup, patch, module, license Automatic
reset saved-configuration + reboot Yes Current configuration and config file only Manual

Check what is stored with display startup, display saved-configuration and display current-configuration before choosing a method.

After the Factory Settings Are Restored

<HUAWEI> system-view
[HUAWEI] interface MEth 0/0/1
[HUAWEI-MEth0/0/1] ip address 10.1.1.2 24
[HUAWEI-MEth0/0/1] quit
[HUAWEI] ip route-static 0.0.0.0 0 10.10.10.10

! enable STelnet management
[HUAWEI] user-interface vty 0 4
[HUAWEI-ui-vty0-4] authentication-mode aaa
[HUAWEI-ui-vty0-4] protocol inbound ssh
[HUAWEI] stelnet server enable
[HUAWEI] ssh user client002 service-type stelnet
[HUAWEI] aaa
[HUAWEI-aaa] local-user client002 password irreversible-cipher Abcd@1234
[HUAWEI-aaa] local-user client002 service-type ssh

Related articles: Huawei S5700 factory reset and password recovery (BootROM), 华为交换机恢复出厂设置的三种方法, and H3C switch factory reset via CLI and BootWare.

原文链接:https://support.huawei.com/enterprise/en/doc/EDOC1100088109