Networks Training

  • About
  • My Books
  • IP Tools
  • HOME
  • Cisco Networking
    • Cisco General
    • Cisco IOS
    • Cisco VPN
    • Cisco Wireless
  • Cisco ASA
    • Cisco ASA General
    • Cisco ASA Firewall Configuration
  • Certifications Training
    • CCNA Training
    • Cisco Certifications
    • I.T Training
  • General
    • Tech News
    • General Networking
    • IP Telephony
    • Network Security
    • Product Reviews
    • Software
  • Cisco Routers
  • Cisco Switches
You are here: Home / Cisco General / How to Reset Cisco Router or Switch to Factory Settings

How to Reset Cisco Router or Switch to Factory Settings

Edited By Lazaros Agapidis

If you have had any experience with Cisco switches or routers, you know there are situations where a factory reset of the device is needed.

Whether you want to reconfigure a device from scratch to get a clean configuration or repurpose a device to play a different role in the network, it’s always a good idea to first restore the router or switch to its factory default settings.

reset cisco device configuration settings

In this article, we’ll describe why this is important, and how this can be done.

Table of Contents

Toggle
  • Why perform a factory reset?
    • Repurposing Equipment
    • Removing bloated configurations
    • Security
  • The factory reset involves the “startup-config”
  • Startup configuration
  • Performing a factory reset
  • The Cisco “write erase” command
  • “erase startup-config” command
  • “erase nvram:” command
  • Take Precautions
  • Conclusion
    • Related Posts

Why perform a factory reset?

There are several reasons why it is important to perform a factory reset.

Repurposing Equipment

It is useful when you are taking devices from one part of the network and repurposing them for other uses.

Older distribution switches may be repurposed as access switches when newer higher-performance switches are procured to replace them.

Edge routers for your HQ may be moved to a branch office to make way for newer routers to substitute them.

Or you may have inherited several devices from a corporate merger or takeover, or an amalgamation of networks, thus requiring the reshuffling of equipment from place to place.

And keeping in mind that Cisco devices are known for their robustness and longevity, repurposing devices is an excellent way to maximize your ROI.

Removing bloated configurations

While performing their roles, administrators will add and modify configurations of devices, often disregarding, or simply not being aware of what previous or other admins may have configured.

Over time this can result in bloated configurations, with unnecessary commands often affecting network performance.

Resetting to factory defaults before configuration the device anew will ensure that all of these commands are removed, resulting in a fresh configuration that delivers better performance.

Security

Configurations will contain security information such as local usernames and passwords as well as network information including IP addressing, VPN configurations, and access lists, to name a few.

If you were to give an “unresetted” device to the admin of another department, anyone who can read the configuration will be able to glean information about your network, resulting in a possible security breach.

Factory resets should be performed whenever such devices change hands to purge any sensitive information from them, especially if they are moved across departments or other hierarchical entities.

MORE READING:  Cisco VRF Lite Configuration Tutorial with Step-by-Step Example

The factory reset involves the “startup-config”

Performing a factory reset on a Cisco IOS router and a Cisco IOS switch are similar processes.

Consumer-grade network equipment, such as an Internet modem or an economical access point, usually has an external reset button which, if depressed for several seconds, will return the device to its factory default settings.

Cisco IOS devices are considered commercial-grade equipment, and most do not have such a button, primarily for security purposes.

So how are Cisco devices reset? Returning them to the factory default settings involves erasing the startup-config file and reloading the device.

Startup configuration

The startup-config file is a file that is contained within the Non-Volatile Random Access Memory (NVRAM) of the device.

While booting up, this file is copied into the RAM as the running-configuration file, and is used for all of its operations and functions.

If a device does not have a startup-config file in the NVRAM during bootup, the device will prompt the user with a setup utility or setup dialog.

This is an optional interactive configuration mode where the device asks a series of questions to guide the user through a basic configuration.

Based on the responses of the user, (or even the dismissal of the prompt), the device will generate a basic startup-config file. This file is then used for subsequent reboots.

Performing a factory reset

To perform a factory reset, simply delete the startup-config file, and reload the device, ensuring that the running-config is not saved in the process.

There are several ways to erase the startup-config file on both Cisco IOS switches and routers, and these methods are described below. The following configuration examples are the same for both IOS routers and switches.

The Cisco “write erase” command

The write erase command will erase the startup-config file from the NVRAM. The following shows the use of this command and the resulting prompts:

R1#write erase

Erasing the nvram filesystem will remove all configuration files! Continue? [confirm]
[OK]
Erase of nvram: complete
*Dec 20 11:27:21.995: %SYS-7-NV_BLOCK_INIT: Initialized the geometry of nvram
R1#

Once this is done, you can then reload the switch like so:

R1#reload

System configuration has been modified. Save? [yes/no]: no
Proceed with reload? [confirm]

Make sure you answer “no” to the question shown, otherwise the running-config, which is still intact, will be copied to the startup-config, thus negating your factory reset.

MORE READING:  How to Configure IPv6 Address on Cisco Routers with Example

The goal is to reset the device without its startup-config, and by taking these steps, this is exactly what we have done.

Once the reload is performed, the device will boot up, detect that it has no startup-config, and will go into the initial configuration dialog to configure the fundamental parameters of the device. You would see a prompt like this:

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

The device has now been reset to its factory defaults and ready to be configured anew.

“erase startup-config” command

The erase startup-config command does exactly the same thing as the write erase command. Even so, it is a more explicit command, and more descriptive as it does exactly what the command says. The result, however, is exactly the same.

“erase nvram:” command

Now most modern IOS platforms do support both the erase startup-config and the write erase commands, however, these are considered deprecated.

They may or may not be phased out over the coming years as new devices are manufactured and programmed. The command that is newer, and generally preferred is the erase nvram: command.

The following example shows how this command can be executed:

R1#erase nvram:

Erasing the nvram filesystem will remove all configuration files! Continue? [confirm]
[OK]
Erase of nvram: complete

As before, once this is done, you can then reload the router like so:

R1#reload

System configuration has been modified. Save? [yes/no]: no
Proceed with reload? [confirm]

Take Precautions

Whenever dealing with configuration files, deleting them, and modifying them, it is important to ensure that you are not destroying vital information and configurations.

Even if you are resetting a device to its factory defaults, it is best practice to always back up the startup-config that you will be deleting.

There may be information contained in the configuration file that may be useful to you in the future, such as passwords, security settings, or IP addressing schemes. There has been more than one occasion when I wished I had done that!

Conclusion

Resetting a Cisco IOS switch or router to its factory default settings is a crucial step in various scenarios, such as repurposing a device, removing bloated configurations, or improving security.

The simplicity of the process, coupled with the commands provided, ensures that even those with limited networking experience can perform these resets confidently.

This reset procedure not only helps in maintaining the optimal performance of your Cisco devices but also contributes to a more secure and manageable network infrastructure.

Spread the love

Related Posts

  • Failure-Mode Engineering: Turning Network Adversity Into an Advantage
  • What is Cisco Virtual Port Channel (vPC) – Explained and Discussed
  • What is a Wildcard Mask – All About Wildcard Masks Used in Networking
  • Configuration Drift? Not on our Watch in Networks
  • What is Cisco Identity Services Engine (ISE)? Use Cases, How it is Used etc

Filed Under: Cisco General

Download Free Cisco Commands Cheat Sheets

Enter your Email below to Download our Free Cisco Commands Cheat Sheets for Routers, Switches and ASA Firewalls.

By subscribing to our email list you will be receiving technical tutorials and industry news from time-to-time. You can unsubscribe at any time.

About Lazaros Agapidis

Lazaros Agapidis is a Telecommunications and Networking Specialist with over twenty years of experience.
He works primarily with IP networks, VoIP, Wi-Fi, and 5G, has extensive experience in training professionals for Cisco certifications, and his expertise extends into telecommunications services and infrastructure from both an enterprise and a service provider perspective.
In addition to his numerous vendor certifications, Lazaros has a solid online presence as an expert in his field, having worked in both public and private sectors within North America and in Europe.
He has enjoyed sharing his practical experiences in writing as well as through engaging online training.
LinkedIn: Lazaros Agapides

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search this site

About Networks Training

We Provide Technical Tutorials and Configuration Examples about TCP/IP Networks with focus on Cisco Products and Technologies. This blog entails my own thoughts and ideas, which may not represent the thoughts of Cisco Systems Inc. This blog is NOT affiliated or endorsed by Cisco Systems Inc. All product names, logos and artwork are copyrights/trademarks of their respective owners.

Amazon Disclosure

As an Amazon Associate I earn from qualifying purchases.
Amazon and the Amazon logo are trademarks of Amazon.com, Inc. or its affiliates.

Search

BLOGROLL

Tech21Century
Firewall.cx

Copyright © 2026 | Privacy Policy | Terms and Conditions | Contact | Amazon Disclaimer | Delivery Policy