Following is a quick method to reset Cisco switch to factory default settings. This method can also be used to recover password.
- Cisco Switch
- Console Cable
- PC/Laptop with Serial Port
Method#1 – Reset Everything – Factory Default
- Connect your console cable from the switch Console port to PC/Laptop serial Port.
Open the HyperTerminal application, and select settings as per your hardware. Following is one sample for my desktop. Different switches connect with different
Bits per Second setting. Try to lower it to 9600 for some models.
Power Off the switch / Now hold the MODE button on the switch and power ON the switch.
Once the switch initialize itself (may take 1-2 minutes), This will interrupt the boot process before the Flash file system can initialize, and after a short while (continue holding the “mode” button) you will see the following prompt:
Once you see the
The password-recovery mechanism is enabled.
you can release the Mode button.
Now issue following commands to initialize flash and delete files which contains the switch configuration
flash_init del flash:config.text del flash:vlan.dat
Once its done, you may continue booting the switch which will allow you to do any configuration of your choice.
This will boot the switch and all of old / previous settings will be cleared.
If it asks
Would you like to enter the initial configuration dialog? [yes/no]:
Type no and continue with below ..
To add ip use following
en config t interface vlan 1 ip address 22.214.171.124 255.0.0.0 ip default-gateway 126.96.36.199 exit exit wr
Connect ethernet cable to the switch port and see the ping result.
Now you will be able to connect with the switch using IP.
Cisco configuration assistant software is the best GUI tool to configure the switch with ease and it will save you from remembering all the commands. Although command is more powerful in most cases but still GUI is feasible for most beginners.
You can download
Cisco Network Assistant it from my google drive.
Add ENABLE section Password
en config t enable secret zaib1234 exit wr
Vlan1 is administratively down, line protocol is down
interface vlan 1
Enable TELNET access
line vty 0 15
transport input telnet
Enable SSH access
*** Set hostname and domain-name
ip domain-name zaib.com
*** Generate the RSA Keys
crypto key generate rsa
“How many bits in the modulus : 1024”
*** Set Up the Line VTY configurations
transport input ssh
*** Set the console line
line console 0
*** Create the username password
username zaib password zaib1234
enable secret zaib1234
Method#2 – Password Recovery Only:
(While Keeping existing running configuration intact)
- Connect Hyperterminal with the switch using console cable. [as mentioned in the beginning of this guide]
- Power ON the switch while pressing mode button, one you see the “The password-recovery mechanism is enabled.”
More example for switch models:
Now issue following commands one by one …
flash_init dir flash: rename flash:config.text flash:config.old (The config.text file contains the password)
Now continue the boot process by following command
Enter “n“ at the prompt to abort the initial configuration dialog.
Now rename the config.old file to config.text so that we can get our existing settings restored , and still let us change the password
rename flash:config.old flash:config.text Press enter when ask for destination file name
Now save the config in running-config so that switch must load all the settings on next boot
copy flash:config.text system:running-config Press enter when ask for destination file name
Changing Password …
*** Overwrite the existing secret/password
conf t enable secret zaib1234 enabled password zaib1234
*** Overwrite the existing vty password
line vty 0 15 password zaib1234
*** Overwrite the existing console password
line con 0 password zaib1234 exit exit wr mem