Reset Configurations on a Cisco Switch

There are several instances where you may need to reset a Cisco switch back to a blank configuration.  Perhaps you purchased a switch for your home lab off of the internet and it didn’t get wiped before it got sent out to you; or perhaps your company acquired a new contract at an existing property where the old tenant left behind their network hardware but did not provide any of the access information.

The process below assumes that you, like me, want to keep the old configuration files.  You could theoretically delete these instead of renaming them instead.

Summary

  • Begin from an unpowered state with power cable unplugged from the switch
  • Plug in power cable while holding down MODE button to interrupt boot sequence
  • Enter “flash_init” to initialize flash memory
  • Enter “rename flash:config.text flash:config-old.text” to remove startup config
  • Enter “rename flash:private-config.text flash:private-old.text” to remove VLANs
  • Enter “boot” to initiate the device boot sequence
  • Enter “no” to the initial configuration dialog
  • Enter “copy running-config startup-config” to create a new blank startup config

CLI in Full

C2950 Boot Loader (C2950-HBOOT-M) Version 12.1(11r)EA1, RELEASE SOFTWARE (fc1)
Compiled Mon 22-Jul-02 17:18 by antonino
WS-C2950T-24 starting...
Base ethernet MAC Address: 00:0c:ce:22:a7:c0
Xmodem file system is available.

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:

    flash_init
    load_helper
    boot

switch: flash_init
Initializing Flash...
flashfs[0]: 329 files, 5 directories
flashfs[0]: 0 orphaned files, 0 orphaned directories
flashfs[0]: Total bytes: 7741440
flashfs[0]: Bytes used: 5651456
flashfs[0]: Bytes available: 2089984
flashfs[0]: flashfs fsck took 7 seconds.
...done initializing flash.
Boot Sector Filesystem (bs:) installed, fsid: 3
Parameter Block Filesystem (pb:) installed, fsid: 4

switch: dir flash:
Directory of flash:/

2    -rwx 112       <date>     info
3    -rwx 3722814   <date>     c2950-i6k2l2q4-mz.121-22.EA14.bin
4    drwx 4416      <date>     html
331  -rwx 112       <date>     info.ver
332  -rwx 316       <date>     env_vars
333  -rwx 1343      <date>     config.text
334  -rwx 24        <date>     private-config.text

2089984 bytes available (5651456 bytes used)

switch: rename flash:config.text flash:config-old.text
switch: dir flash:
Directory of flash:/

2    -rwx 112       <date>     info
3    -rwx 3722814   <date>     c2950-i6k2l2q4-mz.121-22.EA14.bin
4    drwx 4416      <date>     html
331  -rwx 112       <date>     info.ver
332  -rwx 316       <date>     env_vars
333  -rwx 1343      <date>     config-old.text
334  -rwx 24        <date>     private-config.text

2089984 bytes available (5651456 bytes used)

switch: rename flash:private-config.text flash:private-old.text
switch: dir flash:
Directory of flash:/

2    -rwx 112       <date>     info
3    -rwx 3722814   <date>     c2950-i6k2l2q4-mz.121-22.EA14.bin
4    drwx 4416      <date>     html
331  -rwx 112       <date>     info.ver
332  -rwx 316       <date>     env_vars
333  -rwx 1343      <date>     config-old.text
334  -rwx 24        <date>     private-old.text

2089984 bytes available (5651456 bytes used)

switch: boot
Loading "flash:c2950-i6k2l2q4-mz.121-22.EA14.bin"...

         --- System Configuration Dialog ---

Would you like to enter the initial configuration dialog? [yes/no]:no
00:00:16: %SPANTREE-5-EXTENDED_SYSID: Extended SysId enabled for type vlan
00:00:20: %SYS-5-RESTART: System restarted --
Cisco Internetwork Operating System Software
IOS (tm) C2950 Software (C2950-I6K2L2Q4-M), Version 12.1(22)EA14, RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2010 by cisco Systems, Inc.
Compiled Tue 26-Oct-10 10:35 by nburra
00:00:20: %SNMP-5-COLDSTART: SNMP agent on host Switch is undergoing a cold start


Press RETURN to get started!


Switch>
00:00:48: %LINK-5-CHANGED: Interface Vlan1, changed state to administratively down
Switch> enable
Switch# show startup-config
startup-config is not present
Switch# copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
Switch#

Tested and confirmed first-hand on the following switch models:   Cisco WS-C2950T-24, WS-C2960-24TC-L, WS-C3560-48PS-S