Reset a Cisco 2960 Switch To Factory Default Settings

By | May 28, 2013

Flattening a switch before re-deployment is one of those simple tasks that I always find myself having lookup on the web, so I thought I’d save myself some time in future and document it here.

Step 1.

Connect up your console cable and power on the switch, whilst holding down the “mode” button:







This interrupts 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:

Using driver version 1 for media type 1
Base ethernet MAC Address: 4c:30:2d:81:ef:80
Xmodem file system is available.
The password-recovery mechanism is enabled.
The system has been interrupted prior to initializing the
flash filesystem. The following commands will initialize
the flash filesystem, and finish loading the operating
system software:

Step 2.

Initialize the flash file system with the command: flash_init


switch: flash_init
Initializing Flash...
mifs[2]: 10 files, 1 directories
mifs[2]: Total bytes : 1806336
mifs[2]: Bytes used : 612352
mifs[2]: Bytes available : 1193984
mifs[2]: mifs fsck took 1 seconds.
mifs[3]: 0 files, 1 directories
mifs[3]: Total bytes : 3870720
mifs[3]: Bytes used : 1024
mifs[3]: Bytes available : 3869696
mifs[3]: mifs fsck took 0 seconds.
mifs[4]: 5 files, 1 directories
mifs[4]: Total bytes : 258048
mifs[4]: Bytes used : 9216
mifs[4]: Bytes available : 248832
mifs[4]: mifs fsck took 0 seconds.
mifs[5]: 5 files, 1 directories
mifs[5]: Total bytes : 258048
mifs[5]: Bytes used : 9216
mifs[5]: Bytes available : 248832
mifs[5]: mifs fsck took 1 seconds.
 -- MORE --
mifs[6]: 566 files, 19 directories
mifs[6]: Total bytes : 57931776
mifs[6]: Bytes used : 28429312
mifs[6]: Bytes available : 29502464
mifs[6]: mifs fsck took 21 seconds.
...done Initializing Flash.

Step 3.

Delete the config.text file from the flash directory:

switch: del flash:config.text
Are you sure you want to delete "flash:config.text" (y/n)?y
File "flash:config.text" deleted

Step 4.

Delete the vlan.dat file from the flash directory:

switch: del flash:vlan.dat
Are you sure you want to delete "vlan.dat" (y/n)?y
File "flash:vlan.dat" deleted

Step 5.

Reboot the switch and you’re done:

switch: boot
Loading "flash:c2960s-universalk9-mz.122-58.SE2.bin"...
--- System Configuration Dialog ---
Enable secret warning
In order to access the device manager, an enable secret is required
If you enter the initial configuration dialog, you will be prompted for the enable secret
If you choose not to enter the intial configuration dialog, or if you exit setup without setting the enable secret,
please set an enable secret using the following CLI in configuration mode-
enable secret 0 <cleartext password>
Would you like to enter the initial configuration dialog? [yes/no]:
% Please answer 'yes' or 'no'.


Thanks for reading.



Follow Rich on Twitter

Category: Cisco How to guides Tags: ,

About Rich Bibby

Rich is a UK based Network Engineer, working mainly with Cisco, Juniper and Check Point technologies. He is part Cisco CCNP certified having passed the SWITCH exam in 2012 and is currently studying for ROUTE. He also holds CCNA, Check Point CCSE (R65), and Juniper JNCIA-Junos certs. Follow Rich on Twitter

15 thoughts on “Reset a Cisco 2960 Switch To Factory Default Settings

  1. Judy

    Stopped a reboot to factory settings at 100% and 99%. Ugh! It’s a Gateway NetBook. Any ideas how to get it going again or finish the reboot progress?

    1. Rich Bibby Post author

      Thanks for the comment and link ! you’ve got some great content on your blog there. reminds me I’ve not blogged for a few months now, so I need to get back into it!

  2. Pingback: How to Reset Cisco Catalyst 2960 Back to Factory Defaults |

  3. Mike

    I have three 2960x switches that used to be stacked. I did the above procedure on all three but they still have remnants of the old config (i.e. Stack 3 still shows up as ‘stack 3′ during boot up and the interfaces are all still labelled ‘GigabigEthernet 3/0/1-52′ and on stack 2 they are gigabitethernet 2/0/1, etc.).

    1. Mike

      To clarify, the switches are not connected to each other in any way… Here is what I see at the end of the initialization sequence on what used to be switch3:

      cisco WS-C2960X-48LPS-L (APM86XXX) processor (revision A0) with 524288K bytes of memory.
      Processor board ID FOC1744Y0P1
      Last reset from power-on
      1 Virtual Ethernet interface
      1 FastEthernet interface
      52 Gigabit Ethernet interfaces
      The password-recovery mechanism is enabled.

      512K bytes of flash-simulated non-volatile configuration memory.
      Base ethernet MAC Address : C0:7B:BC:4B:83:00
      Motherboard assembly number : 73-14191-03
      Power supply part number : 341-0528-01
      Motherboard serial number : FOC17430RHU
      Power supply serial number : DCB174171XR
      Model revision number : A0
      Motherboard revision number : A0
      Model number : WS-C2960X-48LPS-L
      Daughterboard assembly number : 73-14200-03
      Daughterboard serial number : FOC17426JNR
      System serial number : FOC1744Y0P1
      Top Assembly Part Number : 800-38006-01
      Top Assembly Revision Number : B0
      Version ID : V01
      CLEI Code Number : CMMLP00ARA
      Daughterboard revision number : A0
      Hardware Board Revision Number : 0×05

      Switch Ports Model SW Version SW Image
      —— —– —– ———- ———-
      * 3 52 WS-C2960X-48LPS-L 15.0(2)EX3 C2960X-UNIVERSALK9-M

      Press RETURN to get started!

      *Mar 1 00:00:26.067: Read env variable – LICENSE_BOOT_LEVEL =
      Mar 30 01:27:38.150: %IOS_LICENSE_IMAGE_APPLICATION-6-LICENSE_LEVEL: Module name = c2960x_lanbase Next reboot level = lanbase and License = lanbase
      Jan 11 23:40:18.275: in Switch 0. Cannot read pid from Flexstack module

      Jan 11 23:41:15.597: %STACKMGR-4-SWITCH_ADDED: Switch 3 has been ADDED to the stack
      Jan 11 23:41:17.160: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to down
      Jan 11 23:41:17.160: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0, changed state to down
      Jan 11 23:41:18.540: %SPANTREE-5-EXTENDED_SYSID: Extended SysId enabled for type vlan
      Jan 11 23:41:22.238: %SYS-5-CONFIG_I: Configured from memory by console
      Jan 11 23:41:22.333: %STACKMGR-5-SWITCH_READY: Switch 3 is READY
      Jan 11 23:41:22.333: %STACKMGR-4-STACK_LINK_CHANGE: Stack Port 1 Switch 3 has changed to state DOWN
      Jan 11 23:41:22.333: %STACKMGR-4-STACK_LINK_CHANGE: Stack Port 2 Switch 3 has changed to state DOWN
      Jan 11 23:41:22.728: %STACKMGR-5-MASTER_READY: Master Switch 3 is READY
      Jan 11 23:41:22.826: %SYS-5-RESTART: System restarted –
      Cisco IOS Software, C2960X Software (C2960X-UNIVERSALK9-M), Version 15.0(2)EX3, RELEASE SOFTWARE (fc1)
      Technical Support:
      Copyright (c) 1986-2013 by Cisco Systems, Inc.
      Compiled Wed 11-Sep-13 02:04 by prod_rel_team
      Jan 11 23:41:24.168: %LINK-5-CHANGED: Interface FastEthernet0, changed state to administratively down
      Jan 11 23:41:24.224: %LINK-5-CHANGED: Interface Vlan1, changed state to administratively down
      Jan 11 23:41:27.037: %USB_CONSOLE-6-MEDIA_RJ45: Console media-type is RJ45.% Generating 1024 bit RSA keys, keys will be non-exportable…
      [OK] (elapsed time was 1 seconds)
      Jan 11 23:41:39.729: %SSH-5-ENABLED: SSH 1.99 has been enabled
      Jan 11 23:41:39.816: %PKI-6-AUTOSAVE: Running configuration saved to NVRAM

  4. Keith

    Very nice, got rid of my vlans I created and all other commands from when I was doing my lab setup that were left there even after wr erase was done. Thank you for posting an easy to follow post.


Leave a Reply

Your email address will not be published. Required fields are marked *