华为交换机恢复出厂设置的三种方法(PNP键/CLI命令/清空配置) - 夜莺博客

华为交换机恢复出厂设置的三种方法(PNP键/CLI命令/清空配置)

交换机利旧使用时,通常需要先恢复出厂设置再升级到最新版本。华为官方渠道总结了三种恢复出厂配置的方法:长按 PNP 键、一键式 reset factory-configuration、以及通过 reset saved-configuration 清空配置文件。本文结合实操讲解三种方法的适用场景、命令步骤和恢复出厂后的必要配置。

准备工作

利旧交换机若已使用过,建议先保存当前配置用于后续恢复:

<HUAWEI> display current-configuration

把输出复制保存为本地 txt 文件。由于恢复出厂后交换机无法远程登录,请使用 Console 口进行操作。常见缺省用户名为 admin,缺省密码为 admin@huawei.com;如提示错误,请参考对应型号和版本的官方文档。

方法一:长按 PNP 键恢复出厂配置

对于支持 PNP 键的设备,长按(6 秒以上)PNP 键,设备即恢复出厂配置并自动重新启动。该方法无需登录设备,操作最简单,适合现场快速处理。

方法二:一键式恢复出厂配置

在用户视图下执行 reset factory-configuration 命令:

<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

该命令删除除系统软件包、补丁、模块和许可文件外的所有配置与文件,并自动重启。

方法三:通过清空配置文件恢复出厂配置

<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

重启时系统询问是否保存当前配置,必须选择 N,否则配置会重新写入启动文件。此方法只清除当前配置与配置文件,其他数据文件保留。

恢复出厂配置后的必要配置

设备恢复出厂后,通过 Console 口登录进行基本配置:

<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

根据网络规划配置管理网口 IP 和默认路由,再开启 CLI 登录(如 STelnet)。若希望恢复原配置,可通过已备份的配置文件进行恢复。

相关文章:Huawei S5700 恢复出厂与密码恢复(BootROM)H3C 交换机恢复出厂设置(CLI 与 BootWare)华为静态路由配置详解

原文链接:http://www.ict18.com/812.html