How to Reset a Cisco Router or Switch to Factory Default

What if we forgot login credential of Cisco router or switch and we are not able to log into make change in configuration?  For reset the Cisco router/switch is one of quickest way to resolve issue. It will make a and blank startup configuration file, It will show you the setup wizard for quick configuration of router.

What if we want to retain existing configuration on router? Another solution is to perform password recovery on router. We will discuss on this how to restore routers and switches factory default and also how to implement password recovery.

 

Factory Reset on Cisco Router or Switch

The below is the steps when we are going to factory reset Cisco router.

1. In global configuration mode, create hostname first on router as we will use for verification if the router is already reset the factory settings.

Router(config)#hostname Router 1

 

2. Verify configuration by using below commands.

Router 1#sh running-config
Building configuration....
Current configuration: 526 bytes
!
version 16.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router 1
!
!

 

3. Save configuration using the below command.

Router 1#copy running-config startup-config
Router 1#write

 

4. Reset router to factory default erasing the NVRAM.

Router 1#write erase
Erasing the nvram file system will remove all configurations file!
Continue? [confirm]y[OK]
Erase of nvram: complete
%SYS-7-NV_BLOCK_INIT: Initialize the geometry of nvram.

 

5. Reload router to complete reset factory defaults, and startup wizard or initial system configuration dialog appear.

Router 1#reload

 

6. Verify if the Cisco router is resetted to factory default by checking if “hostname Router 1” is vanish and changed as default.

Router#sh running-config
Building configuration...
Current configuration: 584 bytes
!
version 15.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!

 

Password Recovery on Cisco router

Before proceed with password recovery, we will take look first at configuration register. We use the ‘show version’ command for checking the configuration of  register setting on device. Configuration Register has a special 16 bits value that can be configure in Cisco router. It is used to determine how router boot, to determine boot options, and to the set console speed. The below are the most commonly used configuration register settings:

  • config-register 0x2102 – boot normally (default configuration register)
  • config-register 0x2120 – boot ROM Monitor (ROMMON)
  • config-register 0x2142 – content of NVRAM (startup-configuration)

 

The below steps using when we are going to recover forgotten enable password or enable secret command configure in router or switch.

1. Power ON router.

2. Press break sequence (ctrl-Break) while router is initializing to break in ROMMON prompt.

3. Follow command, confreg 0x2142, to ignore startup-configurations and reset/reload the router.

rommon 1 > confreg 0x2142
rommon 2 > reset

 

4. After reboot, it will not ask you secret password and will proceed to setup wizard or start system configurations dialog, as it boot up with blank configuration.

5. The startup-configuration still there with full configuration, including the unknown enabled secret, but router doesn't use it when boots. Enter a new enable secret password in global configuration mode to overwrite old one. 

Router(config)#enable secret cisco12345

6. In global configuration mode, configure configuration register back to default by entering ‘config-register 0x2102’ router commands, so router will boot normally on next restart.

Router(config)#config-register 0x2102

7. Save configuration. This will mix new enable password into existing startup-configuration.

Router#copy running-config startup-config

8. Reboot router using ‘reload’ command and see that secret password is change to one we configured earlier.

Router#reload

Post a Comment

0 Comments