Search This Blog & Internet

Tuesday, November 22, 2011

Completely clear a Cisco switch configuration

When you issue the "wr erase" command in order to clear the configuration of a Cisco router, the config.text file will be erased from the flash. Then when you reboot the switch, there will be no configuration. But the Vlans will not be erased from flash because "wr erase" does not delete the vlan.dat file. So if you need to delete the Vlans as well, you need to delete the vlan.dat file manually!

There is an easier but "dangerous" way to get rid of both configuration and Vlans in a Cisco switch by holding the "mode" button for 10 seconds. The LEDs on switch will flash, the files config.text and vlan.dat will be renamed to config.text.renamed and vlan.dat.renamed and the switch will reboot with no configuration and no vlan!


This functionality is practical but dangerous in the same time specially in operational environments! You can disable this functionnality by issuing the command "no setup express" from configuration mode.
Switch(config)#no setup express

Now if you push the "mode" button, the state will change to duplex and stays there until next push!

2 comments:

  1. Hey thanks for this. I had the config and vlan.dat files name appended with "renamed" on a switch and I wasn't sure what happened. It appears that my suspicions that someone was intentionally messing with the switch are correct.

    ReplyDelete
  2. Glad to be helpful jdsilva and good luck with your CCIE exam :-)

    ReplyDelete