How To Factory Reset Cisco Switch

In this tutorial, you will learn how to factory reset a Cisco Switch.

In fact, these steps will work on most Cisco switches and routers models. In this example, I’ll be resetting a Cisco 2960-cx Switch. I’ve used these same all various Cisco models.

Factory reset is easy and is often needed for various reasons including:

  • Forgot the password and cannot login
  • Purchased a used switch with existing configuration
  • Re-deploying switch and need to wipe existing config
  • Remove or throw away the device

I’ve seen some online guides suggest running the write erase command to reset a switch. This does not wipe all the data. To truly do a factory reset follow these steps.

Video Tutorial

If you don’t like video tutorials or want more details, then continue reading the instructions below.

Step 1: Console to Switch via Console Cable

Use a terminal emulator program to get console access to the switch. I’ll be using Putty in this example.

factory reset cisco 2960

Below is a screenshot of my Putty settings for console access to the switch.

putty config for console access

Step 2: Power off the Switch

Most Cisco devices have no power-off switch so you will need to just pull the power cord from the Switch. If your device has a power-off switch then use it.

Step 3: Power On & Hold Down Mode Button

The mode button should be on the left front of the switch, this is standard on all Cisco switches.

hold the mode button on the switch

Power on the switch then hold down the mode button. Hold it down until you see the words “password-recovery mechanism is enabled” then release the mode button. The time on this is different for each model. On the 2960cx I had to hold the mode button for about 1 minute.

release hold button

This will interrupt the boot process so you can access the command line. Now we are ready to move on to the last step.

Step 4: Use These Commands to Reset

Run the below commands:

1. Type flash_init and hit enter

It could take a minute for it to complete but should say done initializing flash.

run flash_init command

2. Type dir flash: and hit enter

Your output may look different than mine but you are looking for the config.text and vlan.dat files. These are the files you need to delete.

config files to delete

3. Type del flash:config.text and hit enter

Type y to confirm

4. Type del flash:vlan.dat and hit enter

Type y to confirm

del config file

5. Now type boot and hit enter

The switch will reboot the switch and load the default configuration.

reboot the switch

When it’s done rebooting you should see the system configuration dialog.

default system dialog


In this tutorial, I demonstrated how to factory reset a Cisco switch. These steps should work on all Cisco switch and router models. The output and timing will be different depending on the model but the process should be the same. Make sure you factory reset your gear before throwing it away.

Recommended Tool: SolarWinds Network Performance Monitor (NPM)

SolarWinds NPM is a powerful and easy-to-use software that can help you monitor, troubleshoot, and optimize your network performance.

Reduce network downtime, monitor network performance and availability, discover and map your network devices, analyze network capacity and hardware health, and much more.

You can start a free trial of NPM today and see for yourself how it can help you monitor your network more effectively. Just click on the link below to download NPM and get started.

Download Free Trial