Ontario Tech Logo

How do I erase my switch configurations when I'm done with the switch?

How to erase switch configurations

This article assumes that you are already connected to the switch and have access to the EXEC mode CLI (i.e., the prompt ends with a # sign, similar to Switch#. If you can't get to this prompt because of an unknown password, check out this knowledgebase article.

To erase your switch configurations, follow these steps:

  1. From the privileged EXEC prompt, type the command delete vlan.dat to erase the file containing VLAN and VTP information.
  2. You will receive the following message:

    Delete filename [vlan.dat]?

    Press ENTER to confirm.
  3. You will then receive another prompt with the following message:

    Delete flash:vlan.dat? [confirm]

    Press ENTER to confirm.
  4. From the privileged EXEC prompt, type the command erase startup-config which will delete the startup configuration.
  5. When you receive the following message:

    Erasing the nvram filesystem will remove all configuration files! Continue? [confirm]

    Press ENTER to confirm.
  6. Now restart the router by entering the command reload.
  7. You may receive a message that says:

    System configuration has been modified. Save? [yes/no]:

    Type no and press enter to ensure you don't save anything before reloading.
  8. Finally, you will receive the following message:

    Proceed with reload? [confirm]

    Press ENTER to confirm.

When the switch restarts, it should prompt you to enter the initial configuration dialog, at which point you can disconnect from the switch.