Wipe Cisco Switch/Router via ROMMON

As sometimes you are unable to wipe data of a Switch or router because of various reasons here below we explain how to wipe the devices if you are unable to login to it


In a Cisco switch to get to ROMMON connect a console cable to it and make sure its working and you have a Console session open and working, than unplug the power and and plug it back in, now on the console hit crtl+c while booting until you see:

Switch> or ROMMON1

Now the following staps depends on what type of device you have. Check below here if you need confreg 0x2142 or set SWITCH_IGNORE_STARTUP_CFG=1

Primary DeviceRouters (e.g., ISR, ASR)
Catalyst Switches (9k, 3850, 3650)
FeatureĀ confreg 0x2142SWITCH_IGNORE_STARTUP_CFG=1

Use confreg 0x2142

When the device is booted in ROMMON, enter command:

confreg 0x2142

Than boot the device whit:

Reset

After the device had been booted, go to Privileged EXEC mode. better known as “enable mode”

Switch> enable

now move to the config terminal

Switch# conf t

now put the device back in normal boot mode

Switch(config)# config-register 0x2102
Switch(config)# end

Now wipe all the config using the following commands:

Switch# write erase
Switch# delete flash:vlan.dat

Now reload the device:

Switch# reload
Proceed with reload? [confirm] <Enter>

(If asked to save configuration, type ‘no’)


Use SWITCH_IGNORE_STARTUP_CFG=1

When the device is booted in ROMMON, enter command:

Switch: set SWITCH_IGNORE_STARTUP_CFG=1

Check if the command it set correctly

Switch: set
ABNORMAL_RESET_COUNT=1
AUTO_SWITCH_CONSOLE_DISABLE=0
BAUD=9600
BOOT=flash:packages.conf;
BSI=0
MAC_ADDR=A1:B2:C3:D4:E5:F6
MANUAL_BOOT=no
MCP_STARTUP_TRACEFLAGS=00000000:00000000
MODEL_NUM=C9200-24P
MOTHERBOARD_SERIAL_NUM=*********
RANDOM_NUM=1138304815
ROMMON_BOARDID=0x322
SWITCH_IGNORE_STARTUP_CFG=1
SWITCH_NUMBER=2
SYSTEM_SERIAL_NUM==*********
TEMPLATE=advanced

Than boot the device whit:

Switch: boot

After the device had been booted, go to Privileged EXEC mode. better known as “enable mode”

Switch> enable

now move to the config terminal

Switch# conf t

now put the device back in normal boot mode

Switch(config)# SWITCH_IGNORE_STARTUP_CFG=0
Switch(config)# end

Now wipe all the config using the following commands:

Switch# write erase
Switch# delete flash:vlan.dat

Now reload the device:

Switch# reload
Proceed with reload? [confirm] <Enter>

(If asked to save configuration, type ‘no’)

Now the device should boot and promt you whit

         --- System Configuration Dialog ---

Would you like to enter the initial configuration dialog? [yes/no]: 

Scroll to Top