Clearing the Startup Configuration:
You want to clear an old configuration out of your router and return it to a factory default configuration.
You can delete the current startup configuration files and return the router to its factory default settings with the erase nvram: command:
Before you redeploy an old router that you have previously used for some other purpose, it is a good idea to completely erase the old configuration. This ensures that the router starts with a clean configuration. However, if you did this on a production router, it would wipe out the configuration and leave it with all of its interfaces down. Fortunately, completely deleting your configuration requires two steps: erasing the startup configuration file, followed by a reload.
After you erase your startup configuration file and reload the router, it will enter its configuration dialog mode. Most experienced Cisco engineers prefer to skip this mode:
You can now safely reconfigure the router for its new function. We note in passing that the factory defaults are slightly different, depending on the level of IOS you are running and the hardware installed in the router.
If you accidentally erase the startup configuration file, you can still recover if the router has not yet been reloaded. Simply copy the running configuration back to the startup configuration, and the router will be returned to normal:
But, if the router’s configuration is erased and the router is reloaded, it will either need to be reconfigured manually from memory, or preferably, from a backup copy.