How to reset a cisco switch
Page 1 of 1

Author:  donglee [ Thu Jan 02, 2014 11:51 am ]
Post subject:  How to reset a cisco switch

Hi everyone!
What is the best way for restore devices to their default configurations? I got two units of cisco WS-C2960S-24TS-L, but they have configure files and vlan configure, so I want to reset them.I want to simulate this situation on gns3. May I get it?
I know these:
- use the erase startup-config command
- use the config-register 0x2102 command in global configuration mode

Author:  pguerreiro [ Fri Jan 03, 2014 11:36 am ]
Post subject:  Re: How to reset a cisco switch


You have to:

erase startup-config
delete flash:vlan.dat


Author:  rednectar [ Sat Jan 04, 2014 12:09 am ]
Post subject:  Re: How to reset a cisco switch

- use the config-register 0x2102 command in global configuration mode
has nothing to do with switches - it is a router command.

However, in GNS3, RAM and FLASH work a bit differently to "real" equipment.

Firstly, you will ALWAYS loose your vlans on a GNS3 simulated switch (the NM-ESW16 module) unless you check the [x] Save nvrams including EtherSwitch VLANs and crypto keys option when you start a new project. This will actually cause a copy of the FLASH to be kept within your project, and any changes to flash (such as delete flash:vlan.dat will be immediate and persistent across reloads.

However, NVRAM (where the startup-configuration is kept) is not persistent. And of course GNS3 does not support the reload command, so when you reload a router in GNS3, you need to either Stop then Start the router, or reload it using the GNS3 Device | Reload menu (also accessible from the right-click menu).

What actually happens when you reload in GNS3, is that dynamips re-reads the startup configuration from your project's configs directory, or if there is no config for that router, loads the baseconfig.txt file (or whatever file you have nominated for that image). The implication of this is twofold:
  1. The erase startup-config command has no effect - it does NOT delete the startup file from your project's configs directory, and
  2. After you have made changes to your configs and issued a save startup-config command, the startup configuration is not yet saved in your project's configs directory - you must also issue a File | Save Project command to ensure your startup file is saved.

You can find out more about how GNS3 directories and files work in my book GNS3 Network Simulation Guide - here is a sample (without formatting - I loose the formatting when I cut and paste)
Conceptualizing a project
The project you just created and saved was saved as a collection of files and folders. In this section, you will explore those files and where they live.
Use a file browser to browse to the location of your GNS3 Projects directory (typically on Windows this is %HOMEPATH%\GNS3\Projects; on OS X and Linux this is ~/GNS3/Projects).You should find, a directory there with the same name as the project you just created. Open that directory and you will see your topology. net file, a topology.png file, and four directories called captures, configs, qemu- flash-drives, and working. If you had not checked the Save nvrams including EtherSwitch VLANs and crypto keys option when you created your project, you would not see the working directory.
Some operating systems like to confuse users by hiding the ".net" and ".png" part of the filename, so you may see the and the topology.png files both listed simply as "topology".
The captures directory will hold the Wireshark packet captures. Wireshark is discussed under the heading Capturing Packets with Wireshark later in the chapter. The qemu-flash-drives directory will be discussed in Chapter 4, Unleashing Other Emulators.

Disclaimer: I am the author of the GNS3 Network Simulation Guide

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group