You can reset a Cisco 2960 switch to its factory default settings using two primary methods: via the Command-Line Interface (CLI) if you have access, or by using the physical Mode button for password recovery.
Both processes erase the configuration, including all settings and VLAN data, and require a reboot to finalize the reset.
Method 1: Using the CLI (if you have login access)
This is the quickest and simplest method if you can still log into the switch. It involves deleting the configuration files and reloading the device.
Prerequisites
- A console, Telnet, or SSH connection to the switch.
Steps
- Enter privileged EXEC mode by typing
enableand providing the password. - Erase the startup configuration file stored in NVRAM using the command
erase startup-config. - Confirm the erase operation when prompted by typing
y. - For a complete factory reset, including all VLAN information, delete the
vlan.datfile from the flash memory by executingdelete flash:vlan.datand confirming. - Reload the switch to apply the changes by typing
reload. - When prompted to save the configuration, select "no" (
n) to discard the current running configuration. - After the reboot, the switch will start with its factory defaults and display the initial configuration dialog.
Method 2: Using the Mode button (for password recovery or locked switches)
This method is necessary if you do not have login credentials for the switch. It involves interrupting the normal boot process to gain access to the file system.
Prerequisites
- A physical connection to the switch via a console cable.
- A terminal emulation program on your computer (e.g., PuTTY, Tera Term).
- Physical access to the switch.
Steps
- Connect your computer to the switch's console port with a console cable.
- Unplug the power cord from the switch.
- Press and hold the Mode button on the front of the switch.
- While still holding the Mode button, plug the power cord back in.
- Continue to hold the Mode button. On the console, you will see output indicating that the system boot process has been interrupted.
- Release the Mode button when the SYST LED turns solid green.
- At the
switch:prompt, typeflash_initand press Enter to initialize the flash file system. - To perform a complete factory reset, delete the configuration and VLAN files:
del flash:config.textdel flash:vlan.dat
- Boot the switch with the
bootcommand. - The switch will reload with factory default settings and prompt you to enter the initial configuration dialog.
Analysis of the reset process
Configuration file location
When you reset a Cisco 2960 switch, it's crucial to understand where its configuration is stored.
- Startup configuration: This file (
config.textorstartup-config) is stored in NVRAM. It contains the configuration that the switch loads during a normal boot sequence. - VLAN database: This file (
vlan.dat) is stored in flash memory and contains all VLAN configuration information. Even after erasing the startup configuration, the switch can retain VLAN data unless this file is specifically deleted.
Mode button mechanics
The Mode button's behavior depends on how long it is pressed during boot.
- Short press (3 seconds): Holding the button for a shorter period enters ROM Monitor (ROMMON) mode, which is used for password recovery.
- Long press (10+ seconds): For some Cisco Catalyst 2960X models, holding the button for more than 10 seconds triggers an automatic factory reset without requiring console commands.
- Disabled Mode button: It is possible to disable the automatic factory reset feature in the configuration using the
no setup expresscommand. If this command is configured, the Mode button will not initiate a reset with a long press, and you must use the CLI methods.
Impact of a reset
A factory reset is a complete wipe of all user-defined settings. After a reset, the switch will:
- Have no passwords or enable secrets.
- Have no IP address or default gateway.
- Have no VLANs (except the default VLAN 1).
- Have no user accounts or custom configurations.
The reset process does not erase the operating system (Cisco IOS) itself. The switch will reload and boot into the standard IOS, which will then prompt you to begin a new configuration.