SystemPrivileged EXEC

write erase

Erases the startup configuration from NVRAM, resetting the device to factory defaults on next reload.

Syntax·Privileged EXEC
write erase

When to Use This Command

  • Preparing a router for redeployment in a different network environment.
  • Clearing a misconfigured device before applying a new configuration.
  • Returning a device to a known clean state for troubleshooting.
  • Removing all configuration before returning leased equipment.

Command Examples

Basic write erase

write erase
Erasing the nvram filesystem will remove all configuration files! Continue? [confirm]
[OK]
Erase of nvram: complete

The command prompts for confirmation; pressing Enter confirms. The output confirms the NVRAM filesystem has been erased successfully.

Alternative command with reload

write erase reload
Erasing the nvram filesystem will remove all configuration files! Continue? [confirm]
[OK]
Erase of nvram: complete

Proceed with reload? [confirm]

%SYS-5-RELOAD: Reload requested

After erasing, the reload command reboots the device. The device will load the default factory configuration.

Understanding the Output

The output begins with a warning that all configuration files will be removed and prompts for confirmation. Typing 'yes' or pressing Enter proceeds. '[OK]' indicates the erase operation succeeded. 'Erase of nvram: complete' confirms the NVRAM filesystem is now empty. After this, the device still runs the current running configuration until reloaded. A subsequent 'reload' command will reboot the device, which then boots with no startup configuration, prompting the initial configuration dialog or entering setup mode.

CCNA Exam Tips

1.

CCNA exam tip: 'write erase' is equivalent to 'erase startup-config' — both remove the startup configuration from NVRAM.

2.

CCNA exam tip: The command does not affect the running configuration; a reload is required to clear the running config.

3.

CCNA exam tip: You must be in privileged EXEC mode (enable) to use this command.

4.

CCNA exam tip: After 'write erase', the device will prompt for initial configuration on next reload; this is a common scenario for password recovery.

Common Mistakes

Mistake 1: Forgetting to reload after 'write erase' — the running configuration remains active until reboot.

Mistake 2: Confusing 'write erase' with 'write memory' — 'write memory' saves the running config to startup, while 'write erase' deletes it.

Mistake 3: Not confirming the prompt — the command requires confirmation; simply pressing Enter is sufficient.

Related Commands

Practice for the CCNA 200-301

Test your knowledge with hundreds of CCNA practice questions covering all exam domains.

Practice CCNA Questions