erase startup-config
Deletes the startup configuration file from NVRAM, causing the router to load with factory defaults on next reload.
erase startup-configWhen 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-configErasing 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
CCNA exam tip: After 'erase startup-config', you must also 'reload' to apply the factory defaults; the running config remains until reload.
CCNA exam tip: The command does not affect the running configuration; use 'write erase' as an alternative (same effect).
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.
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
reload
The reload command reboots a Cisco IOS device, typically used to apply configuration changes or recover from a system issue.
show startup-config
Displays the saved configuration stored in NVRAM that loads on next device boot.
write erase
Erases the startup configuration from NVRAM, resetting the device to factory defaults on next reload.
Practice for the CCNA 200-301
Test your knowledge with hundreds of CCNA practice questions covering all exam domains.
Practice CCNA Questions