Resetting a Cisco switch or router when you don’t have the password.

So this week I finally waved goodbye to my trusty IKEA Lack Rack which I started to assemble during the lockdown, mainly out of boredom and because my CCNA was on the horizon. Two guys came to pick it up, they were new to networking and were about to embark on their own Cisco journey. I feel happy knowing it’s going into the hands of somebody who will use it to get their own leg up into the Cisco world and, hopefully, a new career too! It’s a better thought than having it being used as a place to hold my printer for the rest of its life! Good luck to them both on the journey ahead!

Anyway, the fact it has found a new home means I needed to clear the configs, which is a simple enough task for somebody who actually remembers the passwords they set!? 🙃 luckily though, there’s a way, and I’m here on this website nobody reads to show you how!

First of all, you need physical access to the device by way of a console cable. This could be a deal-breaker for a lot of people but this would be hellish if you could do it remotely, so thankfully it’s not possible!

Method

Firstly you’ll need to connect your laptop with the aforementioned console cable and verify you can get a connection using your preferred choice of terminal emulator. Once you have verified you have a connection and can access the password prompt, we’re good to go!

  1. Turn the device off and back on again (no jokes please!)
  2. Hit the break button. This can differ depending on which emulator you’re using. I use Putty and generally, I just right click on the empty window and click “Special Command” then “Break” as shown here.
  3. When you hit the ‘break’ button it should take you into ‘ROMMON’ mode which stands for ‘ROM Monitor’, think of it like your PC’s BIOS before it loads the operating system.
  4. Here you can alter the device’s boot behaviour. To do this you need to change the ‘Config Register’ the config register tells your device where it can find the operating system it needs to begin working.
  5. The command you need (to cut to the chase) is: ‘config-register 0x2142‘ – this will tell the device to ignore the contents of the NVRAM (your configuration) and proceed into the OS as if it was from the factory.
  6. Reload the device (reload from the # menu); it will ask you if you want to save the config, choose ‘no
  7. When the device is back up and running it will ask you if you want to enter the initial config, select “no” again.
  8. Change the configuration register setting to 0x2102 by entering the “enable” menu and then into the “configure terminal” menu then entering ‘config-register 0x2102‘.
  9. Save your config by typing ‘WR’ or doing the slightly longer ‘copy run-start‘ or the even longer ‘copy startup-config running-config’ they all do the same thing.
  10. Reload the router again and it should throw you back into a nice fresh OS.

And that’s it! Remember your passwords next time! (Unlike me!)

Richard

30-something Sysadmin from the Midlands, UK.