If the unfortunate situation happens that the password on Cisco router is forgotten or, like in my case, the newly purchased Lab equipment already have, for us unknown password, we still have an option to reset it. For understanding the procedure we have to see the way how the router is booting up.
When we turn on the router, it will like the PC, start for looking for a default booting device and the configuration on it, which in case of router is the flash memory card.
Like in the picture, the device has found the program and selected the entry point to run the loading of the IOS and the configurations on it.
Before the loading of files happens we have to break the loading and go into the ROMMON MODE, which is mode in which we can do early configurations on the router.
To break the process and avoid loading we have to hit the “BREAK” key on the keyboard (it’s next to f12 usually), after powering it on and before he starts to load the configuration. In my case, I had a problem with that procedure because of the loading time was so fast, that it was impossible for me to find the perfect timing to break in. To avoid the timing problem, you can take out the flash before powering the router and in that way, you will have a comfortable amount of time to break the operation and go to ROMMON mode.
If the previous command succeeds, we will see the following screen:
Here we can push back the flash, cuz he is already ignored by the router.
The next commands have to be done precisely one by one:
The first command is rommon> confreg 0x2142 ;
- Ignores break
- Boots into ROM if initial boot fails
- 9600 console baud rate
- Ignores the contents of Non-Volatile RAM (NVRAM) (ignores configuration)
The second command is reset ;
The router will boot up by default with ignored RAM configurations. He will prompt to enter the configuration dialog, where we have to answer with NO.
After this step, we can easily go to enable mode and configure the new password or in my case, because it will be lab I left it without a password. After we make sure that the running configuration ( show running-config ) is clean and without a password, we can copy the running configuration to startup configuration ( copy running-config startup-config ).
To make sure that the router boots up with a new empty startup configuration, we have to go to global config mode ( conf t ) and write the command config-register 0x2102, exit, and if you want to overwrite the old config (which is the case) issue command write memory.
After those steps, you have a clean configuration like on the brand new router from the box.