0% found this document useful (0 votes)
66 views

Cisco Commands

There are two main methods to clear the configuration of a Cisco router. The first involves setting the configuration register to 0x2142 to ignore the startup configuration and reload the router without saving changes. The second method involves using the write erase command to delete the startup configuration if the enable password is known, followed by a reload. For Cisco switches, clearing the configuration involves using commands like write erase, clear config all, delete vlan.dat, and reloading without saving changes to remove all configuration files and reset the device.

Uploaded by

Nilesh Doiphode
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views

Cisco Commands

There are two main methods to clear the configuration of a Cisco router. The first involves setting the configuration register to 0x2142 to ignore the startup configuration and reload the router without saving changes. The second method involves using the write erase command to delete the startup configuration if the enable password is known, followed by a reload. For Cisco switches, clearing the configuration involves using commands like write erase, clear config all, delete vlan.dat, and reloading without saving changes to remove all configuration files and reset the device.

Uploaded by

Nilesh Doiphode
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Clear the configuration of your router

When it comes to clearing your Cisco router, you have two acceptable options. While most network administrators are familiar with both methods, they typically use them for different tasks. The first method involves setting the configuration register to 0x2142. Most admins use this method to recover a password, but you can recover a password and wipe the configuration at the same time. Follow these steps: 1. 2. 3. 4. 5. 6. 7. 8. 9. Log on to the router, and enter the privileged EXEC mode by entering enableand then entering the enable password command. Enter configure terminal to go to Global Configuration Mode. Enter config-register 0x2142. (This causes the router to ignore the startup configuration on the next reload.) Enter end, and reload the router by entering reload at the Router# prompt. The system will ask whether you want to save the configuration. Enter no, and confirm the reload at the next prompt. After the router has reloaded, the system will ask whether you want to enter the initial configuration dialog. Enter no. Change the configuration register setting to 0x2102 by entering enable andconfigure terminal to go back to Global Configuration Mode and then enteringconfig-register 0x2102. Enter end, and then enter write memory to overwrite the existing startup configuration with the current blank running configuration. Enter reload to reload the router and complete the wiping operation.

However, if you already know the password to the router, you can use the second method. Follow these steps: 1. 2. 3. 4. 5. Log on to your router, and enter the privileged EXEC mode by entering enableand then entering the enable password command. Enter configure terminal to go to Global Configuration Mode. Enter config-register 0x2102. Enter end, and then enter the write erase command to delete the current startup configuration on the router. Enter reload to reload the router. When the system asks whether you want to save the configuration, enter no.

When the router reloads, it will reset back to the original factory defaults.

Clear the configuration of your switch


If your Cisco switch runs the CatOS, the procedure to wipe the configuration is relatively quick. Follow these steps: 1. 2. Log on to your switch, and enter the privileged EXEC mode by entering enableand then entering the enable password command. Enter clear config all to reset the entire system. You don't need to reload the switch because processing the command wipes the switch. If you've set a boot option, you need to change that option using the set boot command.

If your switch runs Cisco IOS, it maintains a running configuration file and a startup configuration file, both of which you need to clear. Follow these steps:

1. 2. 3. 4. 5.

Log on to your switch, and enter the privileged EXEC mode by entering enableand then entering the enable password command. Enter write erase, which erases the NVRAM file system and removes all files. At the prompt, confirm that you want to erase all files. Enter reload, and enter no when prompted whether to save the configuration. (Otherwise, the switch will reload the current running configuration.) Confirm that you want to reload the switch, and your switch configuration is almost clean.

It's almost clean, but not quite. Most people forget to clear any VLAN information they've created for their switches. Depending on the hardware version of your switch and the software version of your OS, the command for this varies. For more information, check out Cisco's "Resetting Catalyst Switches to Factory Defaults"documentation, which walks you through the commands for clearing VLAN information from your switch.

# The best way to prepare for CCNA and CCNP exam success is to work with your own home lab, especially when you're configuring them from the very beginning - when the routers and switches have no preexisting configuration. But even if you already have your own lab or aren't planning on one right now, there are some things about erasing configs that you better know before stepping into the exam room! It's easy enough to type "write erase" and "reload", but there are a few details you have to watch if you want your home lab or rack rental devices to act as though they just came out of the box. The first step is indeed to run the command write erase, and then reload the router. You're going to be prompted with a question before the reload starts, though, and you have to give the right answer .... or your configuration will still be there when you reload! First, you will be prompted to confirm the erase. Press to accept the default answer of "confirm". R1#write erase Erasing the nvram file system will remove all configuration files! Continue? [confirm] [OK] Erase of nvram: complete With the startup configuration erased, it's time to reload the router. This is where the second prompt comes in: R1#reload System configuration has been modified. Save? [yes/no]: no When a Cisco router prompts you with two answers to a question, you've got to type the answer in (or at least the first letter of it). Answer NO to this question and press when prompted to confirm the reload.

The router will then start the reload process. Since there is no startup configuration in NVRAM, the router will prompt you to enter setup mode. You should only answer yes if you have a lot of time on your hands, just want to see what setup mode is like, or practice CTRL-C to get out it! Otherwise, answer NO. --- System Configuration Dialog --Would you like to enter the initial configuration dialog? [yes/no]: n Would you like to terminate autoinstall? [yes]:y You'll see quite a few messages after this relating to interface states, and finally you're back at the user exec prompt. Router> Now you're working with a router that's just like it was when it came out of the box! For switches such as the 2950, the process is much the same, but you should delete the VLAN.DAT file before reloading the router. This file contains VLAN information and is kept in flash, so it will still be present after a reload. switch1#write erase Erasing the nvram filesystem will remove all files! Continue? [confirm] [OK] Erase of nvram: complete switch1#delete vlan.dat Delete filename [vlan.dat]? Delete flash:vlan.dat? [confirm] switch1#reload Make sure to hit for the two questions regarding the deletion - if you answer "y" instead, the switch thinks you're trying to erase a file named "y"! After the reload is complete, you'll be prompted to enter setup mode. As you did with the router, enter "N" and begin to configure the router from user exec mode. There's nothing like working with real equipment to prepare for your CCNA and CCNP success, and there's no better practice than configuring routers and switches from the very beginning!

You might also like