Huawei S7700/S9700: reset saved-configuration Commands - 夜莺博客

Huawei S7700/S9700: reset saved-configuration Commands

Huawei S7700 and S9700 chassis switches accumulate configuration over years of service, and eventually every engineer faces the question of how to clear it cleanly — whether the configuration file no longer matches the system software after an upgrade, the file is damaged, or the switch is being redeployed. Huawei's basic configuration guide separates two very different operations: clearing the startup configuration file and clearing the configuration of one interface at a time. Mixing them up is a common source of production incidents, so this article explains both with the official commands.

This guide covers the VRP CLI on S7700 and S9700 series chassis switches: what the confirmation prompts actually mean, how to back up the running configuration before it disappears, how reset saved-configuration differs from reset factory-configuration, and how to verify the result once the switch has rebooted.

Two Operations That Are Easy to Confuse

Every confusion around "clearing the configuration" on a Huawei switch comes from the fact that the device holds configuration in more than one place, and different commands touch different copies:

  • The running (current) configuration — what the switch is executing right now, held in memory and displayed by display current-configuration.
  • The saved (next-startup) configuration — the vrpcfg.zip file in the flash storage of the main control board, loaded at the next boot and displayed by display saved-configuration. This is the file save writes.
  • Per-interface configuration — a slice of the running configuration that belongs to one physical or logical port.

reset saved-configuration removes the startup file so the switch boots with defaults on the next reload; it does not touch the running configuration until you reboot. clear configuration interface edits the running configuration for a single port, and takes effect immediately. Choosing the wrong one is how a maintenance window turns into an outage: clearing the startup file on a switch you did not intend to reload is recoverable (nothing changes until reboot), while clearing the wrong interface drops traffic the moment you press Enter.

Read the Start-up State Before You Change Anything

Before clearing, find out which file the switch is using now and which one it will use next:

<HUAWEI> display startup
MainBoard:
  Configured startup system software:        flash:/s7700.cc
  Startup system software:                   flash:/s7700.cc
  Next startup system software:              flash:/s7700.cc
  Startup saved-configuration file:          flash:/vrpcfg.zip
  Next startup saved-configuration file:     flash:/vrpcfg.zip
  Startup paf file:                          default
  Next startup paf file:                     default
  Startup license file:                      default
  Next startup license file:                 default
  Startup patch package:                     NULL
  Next startup patch package:                NULL

The two lines that matter are Startup saved-configuration file (what was loaded at this boot) and Next startup saved-configuration file (what will load at the next one). The behaviour of reset saved-configuration depends entirely on whether these two entries point at the same file — that is the logic behind the behaviour list further down this article. Saving a copy of this output into the change record costs nothing and settles arguments afterwards about what state the box was in.

Clearing the Startup Configuration File

When the original configuration file does not match the system software after an upgrade, is damaged, or an incorrect configuration file was loaded, clear it with reset saved-configuration in the user view. This removes the next-startup configuration file and cancels the configuration file used for next startup, restoring default device configurations:

<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

Behavioral details that matter in production:

  • If the current startup file equals the next-startup file, the current file is cleared too.
  • If the current configuration is empty but the next-startup file is not, the next-startup setting is cleared.
  • If the next-startup file is empty but the current configuration is not, the command reports an error and nothing is cleared.

After clearing, reboot manually so the switch starts empty, and answer "no" if it asks to save the running configuration during reboot. The difference between this command and the full reset factory-configuration is explained in our Huawei S5700 factory reset guide.

On a dual-MPU chassis the command runs on the active main control board and the file that is removed lives in that board's flash. In an iStack or CSS setup, the clearing applies to the member whose user view you are in — check the prompt, because a stacked switch shows <HUAWEI-1> for member 1 and running the command on the active member does not wipe the standby member's configuration file.

Back Up the Running Configuration First

The saved configuration file is the only thing the switch will load after a reload, and once it is gone the running configuration exists only in memory. If you may need the old design for reference — VLAN plans, ACLs, VRRP groups, interface descriptions — capture it before you clear:

<HUAWEI> save
The current configuration will be written to the device.
Are you sure to continue? (y/n)[n]:y
<HUAWEI> display current-configuration | include ^interface
<HUAWEI> display vlan
<HUAWEI> display vrrp brief

For a proper off-box copy, push the configuration to a TFTP, FTP or SFTP server. Both the running and the saved configuration can be uploaded, and the saved file can be restored the same way:

<HUAWEI> display current-configuration
<HUAWEI> tftp 10.10.10.10 put vrpcfg.zip backup-s7700-vrpcfg.zip
<HUAWEI> ftp 10.10.10.10
<HUAWEI> copy flash:/vrpcfg.zip flash:/vrpcfg-backup.zip
<HUAWEI> display saved-configuration

Keeping a local flash:/vrpcfg-backup.zip copy is the cheapest insurance available: startup saved-configuration flash:/vrpcfg-backup.zip points the next boot at the copy, and reset saved-configuration can be undone by restoring the file and naming it as the next-startup configuration. Never rely on the terminal scrollback as your backup — the session buffer is gone the moment you close the window.

Rebooting After Clearing

The clear takes effect only at the next boot. reboot asks twice, and both answers matter:

<HUAWEI> reboot
Warning: The current configuration will be cleared. Continue to reboot? [Y/N]:y
Warning: All the configuration will be saved to the configuration file for the next startup. Continue? [Y/N]:n
<HUAWEI> reboot fast

Answering "yes" to the second prompt re-saves the running configuration and effectively cancels the clear — the switch reloads with everything back in place. Answer "no" so the device boots from defaults. On a dual-MPU chassis the reboot happens on the active board, then the standby board restarts; allow a few minutes before expecting the console to accept input. If the switch boots without a startup file, it comes up in the initial configuration dialog with default VLAN 1 and no management address beyond the defaults, so have console access ready.

Clearing Configuration on a Single Interface

To repurpose one interface, delete its configuration without touching the rest of the device. Run this in system view — double-check the interface type and number, because a mistake clears the wrong port and interrupts services:

[HUAWEI] clear configuration interface GigabitEthernet1/0/1
[HUAWEI] clear configuration interface range GigabitEthernet1/0/1 to GigabitEthernet1/0/24

The first form deletes the configuration information on the specified interface or restores its default settings; the range form applies the same operation to a batch of ports, which is useful when an access block is being reset for a new VLAN plan.

Useful variants of the same idea:

[HUAWEI] clear configuration interface range GigabitEthernet1/0/1 to GigabitEthernet1/0/24
[HUAWEI] clear configuration interface range GigabitEthernet1/0/1 to GigabitEthernet1/0/24 verbose
[HUAWEI] display current-configuration interface GigabitEthernet1/0/1

Clearing an interface removes the access VLAN, trunk allowed-VLAN list, port security and sticky MAC entries, QoS trust settings, and any nested configuration such as Eth-Trunk membership. If the port is a member of an Eth-Trunk or a stack port, clear the logical interface instead, or the physical port keeps its membership. Ports that are part of a fabric or in the shutdown state should be brought back with undo shutdown after clearing if you want them to pass traffic again.

reset saved-configuration vs reset factory-configuration

Huawei documents more than one way to "reset" a switch, and picking the wrong one is the difference between a clean redeployment and a lost licence file:

  • reset saved-configuration — deletes the next-startup configuration file. The system software, licence files, patch packages and log files are untouched. This is the correct choice when only the configuration is wrong.
  • reset factory-configuration — restores factory defaults on the next reboot, which also removes the user-created startup system software selection and factory-related files. Use it when the switch is leaving your inventory entirely.
  • PNP key or one-key reset (hardware button) — a physical factory reset that wipes configuration and returns the device to its initial state without CLI access.

Our comparison of saved-configuration and factory-configuration walks through the three methods side by side, and the Chinese-language note on 启动文件与配置管理 covers save, reset and startup saved-configuration from the same angle. If the switch is unreachable or the console password is unknown, the BootROM recovery path in our Huawei BootROM recovery article applies to S7700/S9700 with model-specific menus.

Verification After Clearing

Confirm the result before putting the switch back into service:

<HUAWEI> display startup
<HUAWEI> display saved-configuration
<HUAWEI> display current-configuration

display startup shows the current and next-startup configuration files; display saved-configuration shows what will actually load at next boot; display current-configuration verifies the running state. If the running configuration is still needed for reference, capture it before clearing — the screen output is the only copy you will have. For password-locked S7700/S9700 scenarios, the BootROM-based recovery path in our Huawei BootROM recovery article applies with model-specific menus.

When the next-startup file field reads NULL after clearing, the command has done its job. A file name still showing there means the reset did not complete — most often because the next-startup file was already empty and VRP returned an error instead of clearing anything.

Common Mistakes and Troubleshooting

  • Rebooting with "yes" on the save prompt. The reload writes the running configuration back to flash and the clear is silently undone. Read both warnings.
  • Clearing an interface in the wrong view. clear configuration interface runs in system view; pasting it into user view returns an error, and pasting it against the wrong slot wipes a live uplink.
  • No console access after the reboot. A switch with no startup file has no management IP. Plan a console or out-of-band path before the window.
  • Assuming the standby MPU is clean. On dual-MPU chassis, verify display startup on both boards after the reload with display startup from the [HUAWEI] view or by switching to the standby slot.
  • Clearing without saving the licence or patch info. Licences and patch files are separate from the configuration file, but the running configuration records which ones are active — losing that record makes post-rebuild re-activation harder than it needs to be.

Frequently Asked Questions

Does reset saved-configuration interrupt traffic immediately? No. The running configuration continues to forward traffic until the switch reloads. The command only decides what the next boot will load.

Can the clear be undone? Only if you kept a copy of the configuration file. Restore it to flash and point the next boot at it with startup saved-configuration flash:/yourfile.zip, then save and reload.

Why did the command report an error? Because the next-startup file was already empty while the running configuration was not — there is nothing to clear. Save the current configuration first if the intent is to remove it.

Is a password reset the same as clearing the configuration? No. Console or BootROM password recovery typically bypasses or replaces the authentication configuration; a factory reset wipes everything. Pick the method that matches the problem, and check the verification commands afterwards.

原文链接:https://support.huawei.com/enterprise/en/doc/EDOC1000178308/436885dc/clearing-the-configuration