SystemPrivileged EXEC

erase startup-config

Deletes the startup configuration file from NVRAM, causing the router to load with factory defaults on next reload.

Syntax·Privileged EXEC
erase startup-config

When to Use This Command

  • Resetting a router to factory defaults before redeploying in a different network
  • Clearing a misconfigured startup config that prevents the router from booting correctly
  • Preparing a router for secure disposal or return to vendor
  • Troubleshooting by eliminating persistent configuration issues

Command Examples

Basic erase of startup configuration

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

The command prompts for confirmation. Press Enter to confirm. '[OK]' indicates success. 'Erase of nvram: complete' confirms the operation finished.

Erase with forced confirmation (non-interactive)

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

Pressing Enter at the confirm prompt accepts the default (yes). The output confirms the erase operation completed successfully.

Understanding the Output

The output begins with a warning that all configuration files will be removed. The '[confirm]' prompt expects Enter to proceed. After confirmation, '[OK]' indicates the erase operation succeeded. 'Erase of nvram: complete' confirms the NVRAM filesystem is now empty. If the command fails (e.g., due to locked NVRAM), an error message like '%Error erasing nvram' appears. A successful erase means the router will boot with no startup configuration, prompting the initial configuration dialog on next reload.

CCNA Exam Tips

1.

CCNA exam tip: After 'erase startup-config', you must also 'reload' to apply the factory defaults; the running config remains until reload.

2.

CCNA exam tip: The command does not affect the running configuration; use 'write erase' as an alternative (same effect).

3.

CCNA exam tip: In the exam, you may be asked to reset a router to factory defaults; remember the two-step process: erase startup-config then reload.

4.

CCNA exam tip: The 'confirm' prompt expects Enter; typing 'no' cancels the operation.

Common Mistakes

Mistake 1: Forgetting to reload after erase; the router continues using the current running config until reboot.

Mistake 2: Confusing 'erase startup-config' with 'delete flash:config.text' — the latter deletes the file but may not clear NVRAM properly.

Mistake 3: Assuming the running config is also erased; it is not — you must explicitly 'reload' to clear it.

Related Commands

Practice for the CCNA 200-301

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

Practice CCNA Questions