This page is an index of password recovery procedures for Cisco products:
http://www.cisco.com/en/US/customer/products/sw/iosswrel/ps1831/products_tech_note09186a00801746e6.shtml
Showing posts with label Cisco. Show all posts
Showing posts with label Cisco. Show all posts
Thursday, March 4, 2010
Thursday, February 18, 2010
Saturday, June 13, 2009
How do I wipe data from Cisco routers and switches
from http://blogs.techrepublic.com.com/networking/?p=1570&tag=nl.e115
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 0×2142. 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. Log on to the router, and enter the privileged EXEC mode by entering enable and then entering the enable password command.
2. Enter configure terminal to go to Global Configuration Mode.
3. Enter config-register 0×2142. (This causes the router to ignore the startup configuration on the next reload.)
4. Enter end, and reload the router by entering reload at the Router# prompt.
5. The system will ask whether you want to save the configuration. Enter no, and confirm the reload at the next prompt.
6. After the router has reloaded, the system will ask whether you want to enter the initial configuration dialog. Enter no.
7. Change the configuration register setting to 0×2102 by entering enable and configure terminal to go back to Global Configuration Mode and then entering config-register 0×2102.
8. Enter end, and then enter write memory to overwrite the existing startup configuration with the current blank running configuration.
9. 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. Log on to your router, and enter the privileged EXEC mode by entering enable and then entering the enable password command.
2. Enter configure terminal to go to Global Configuration Mode.
3. Enter config-register 0×2102.
4. Enter end, and then enter the write erase command to delete the current startup configuration on the router.
5. 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. Log on to your switch, and enter the privileged EXEC mode by entering enable and then entering the enable password command.
2. 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. Log on to your switch, and enter the privileged EXEC mode by entering enable and then entering the enable password command.
2. Enter write erase, which erases the NVRAM file system and removes all files.
3. At the prompt, confirm that you want to erase all files.
4. Enter reload, and enter no when prompted whether to save the configuration. (Otherwise, the switch will reload the current running configuration.)
5. 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.
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 0×2142. 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. Log on to the router, and enter the privileged EXEC mode by entering enable and then entering the enable password command.
2. Enter configure terminal to go to Global Configuration Mode.
3. Enter config-register 0×2142. (This causes the router to ignore the startup configuration on the next reload.)
4. Enter end, and reload the router by entering reload at the Router# prompt.
5. The system will ask whether you want to save the configuration. Enter no, and confirm the reload at the next prompt.
6. After the router has reloaded, the system will ask whether you want to enter the initial configuration dialog. Enter no.
7. Change the configuration register setting to 0×2102 by entering enable and configure terminal to go back to Global Configuration Mode and then entering config-register 0×2102.
8. Enter end, and then enter write memory to overwrite the existing startup configuration with the current blank running configuration.
9. 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. Log on to your router, and enter the privileged EXEC mode by entering enable and then entering the enable password command.
2. Enter configure terminal to go to Global Configuration Mode.
3. Enter config-register 0×2102.
4. Enter end, and then enter the write erase command to delete the current startup configuration on the router.
5. 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. Log on to your switch, and enter the privileged EXEC mode by entering enable and then entering the enable password command.
2. 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. Log on to your switch, and enter the privileged EXEC mode by entering enable and then entering the enable password command.
2. Enter write erase, which erases the NVRAM file system and removes all files.
3. At the prompt, confirm that you want to erase all files.
4. Enter reload, and enter no when prompted whether to save the configuration. (Otherwise, the switch will reload the current running configuration.)
5. 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.
Thursday, June 4, 2009
Periodic upload of router configuration
from http://blog.ioshints.info/2007/08/sample-configuration-periodic-upload-of.html?showComment=1239216120000 we read this solution:
To get an IOS device to upload it’s configuration periodically to an external FTP server:
ip ftp source-interface loopback 0
ip ftp username ftp_username
ip ftp password ftp_password
file prompt quiet
!
kron policy-list backup
cli copy running-config ftp://10.20.30.40
!
kron occurrence daily-backup at 0:30 recurring
policy-list backup
To get an IOS device to upload it’s configuration periodically to an external FTP server:
ip ftp source-interface loopback 0
ip ftp username ftp_username
ip ftp password ftp_password
file prompt quiet
!
kron policy-list backup
cli copy running-config ftp://10.20.30.40
!
kron occurrence daily-backup at 0:30 recurring
policy-list backup
Wednesday, May 27, 2009
Cisco Catalyst switch passoword recover
This document describes the password recovery procedure for the Cisco Catalyst Layer 2 fixed configuration switches 2900XL/3500XL, 2940, 2950/2955, 2960, and 2970 Series, as well as the Cisco Catalyst Layer 3 fixed configuration switches 3550, 3560, and 3750 Series.
http://www.cisco.com/en/US/products/hw/switches/ps628/products_password_recovery09186a0080094184.shtml
http://www.cisco.com/en/US/products/hw/switches/ps628/products_password_recovery09186a0080094184.shtml
Thursday, May 14, 2009
Cisco mail multiple printouts from EEM applet
http://wiki.nil.com/Time-based_wireless_interface_activity
ip host mail-gw.mydomain.info 10.0.0.1
event manager environment _mail_smtp mail-gw.mydomain.info
event manager environment _mail_domain mydomain.info
event manager environment _mail_rcpt operator@mydomain.info
!
event manager applet RouterReload
event syslog occurs 1 pattern "%SYS-5-RESTART"
action 1.0 cli command "delete /force flash:output.txt"
action 1.1 cli command "show version | append flash:output.txt"
action 1.2 cli command "show logging | append flash:output.txt"
action 1.3 cli command "more flash:output.txt"
action 2.0 info type routername
action 2.1 mail server "$_mail_smtp" to "$_mail_rcpt" from "$_info_routername@$_mail_domain" →
subject "Reload: $_info_routername" body "$_cli_result"
Cisco time-based interface activity
http://wiki.nil.com/Time-based_wireless_interface_activity
event manager environment _disable_ifname dot11radio0
!
event manager applet DisableInterface
event timer cron name DisableInterface cron-entry "0 22 * * *"
action 1.0 cli command "enable"
action 1.1 cli command "configure terminal"
action 1.5 cli command "interface $_disable_ifname"
action 1.6 cli command "shutdown"
!
event manager applet EnableInterface
event timer cron name EnableInterface cron-entry "0 7 * * *"
action 1.0 cli command "enable"
action 1.1 cli command "configure terminal"
action 1.5 cli command "interface $_disable_ifname"
action 1.6 cli command "no shutdown"
!
event manager applet EnableAfterReload
event timer countdown name EnableAfterReload time 10
action 1.0 cli command "enable"
action 1.1 cli command "configure terminal"
action 1.5 cli command "interface $_disable_ifname"
action 1.6 cli command "no shutdown"
Thursday, May 7, 2009
Periodic router reload
Sometimes when using not-so-very stable IOS versions, periodic reload of a router during a non-peak (or idle) period is a good idea that can significantly increase the overall stability of your network. Until release 12.4, you had to write an external script that would log into the router and execute the reload command.
With the Embedded Event Manager, the task is surprisingly simple - just enter the following configuration commands to reload the box every midnight (of course it helps if your router is NTP-synchronized to a reliable clock source and has correctly configured time zone).
event manager applet ReloadThe @midnight is a predefined symbolic value for "0 0 * * *". Of course you can use any other value that the UNIX cron utility would recognize as valid first five fields (time specification; username and command line are obviously not used).
event timer cron name Reload cron-entry "@midnight"
action 1.0 reload
Recovering IOS from ROMMON via TFTP
These are the minimum fields to get this going through TFTP rather than XModem.
rommon 1 > IP_ADDRESS=192.168.1.100
rommon 2 > IP_SUBNET_MASK=255.255.255.0
rommon 3 > DEFAULT_GATEWAY=192.168.1.1
rommon 4 > TFTP_SERVER=192.168.1.50
rommon 5 > TFTP_FILE=c2600-adventerprisek9-mz.124-5a.bin
rommon 6 > tftpdnld (this command kicks off the tftp download)
rommon 1 > IP_ADDRESS=192.168.1.100
rommon 2 > IP_SUBNET_MASK=255.255.255.0
rommon 3 > DEFAULT_GATEWAY=192.168.1.1
rommon 4 > TFTP_SERVER=192.168.1.50
rommon 5 > TFTP_FILE=c2600-adventerprisek9-mz.124-5a.bin
rommon 6 > tftpdnld (this command kicks off the tftp download)
How to enable ssh on cisco routers and procurve switches
Cisco Switch with CatOS
set crypto key rsa 1024
set ip permit 10.0.0.0 255.255.255.0
set ip permit enable ssh
show ip permit
write memory
Cisco Router or Switch with IOS
hostname myrouter
ip domain-name vandeplas.lab
!--- generate the rsa keygen
cry key generate rsa
!--- allow authentication using local aaa username chri password myVerySecurePassword
!--- Use SSH v2 as v1 is insecure
ip ssh version 2
ip ssh time-out 60
ip ssh authentication-retries 2
!--- Prevent non-SSH connections
transport input ssh
write memory
Cisco PIX/ASA
hostname mypix
domain-name vandeplas.lab
!--- generate the rsa key
ca generate rsa key 1024
!--- or on newer versions
crypto key generate rsa modulus 1024
!--- don't forget to save the crypto key into the memory ca save all
!--- allow ssh from the network 10.0.0.0/24 on the inside interface ssh 10.0.0.0 255.255.255.0 inside
!--- allow authentication using local aaa username chri password myVerySecurePassword aaa authentication ssh console LOCAL
!--- save the running-config
write memory
HP Procurve Switch
crypto key generate
ip ssh version 2
ip ssh
write memory
set crypto key rsa 1024
set ip permit 10.0.0.0 255.255.255.0
set ip permit enable ssh
show ip permit
write memory
Cisco Router or Switch with IOS
hostname myrouter
ip domain-name vandeplas.lab
!--- generate the rsa keygen
cry key generate rsa
!--- allow authentication using local aaa username chri password myVerySecurePassword
!--- Use SSH v2 as v1 is insecure
ip ssh version 2
ip ssh time-out 60
ip ssh authentication-retries 2
!--- Prevent non-SSH connections
transport input ssh
write memory
Cisco PIX/ASA
hostname mypix
domain-name vandeplas.lab
!--- generate the rsa key
ca generate rsa key 1024
!--- or on newer versions
crypto key generate rsa modulus 1024
!--- don't forget to save the crypto key into the memory ca save all
!--- allow ssh from the network 10.0.0.0/24 on the inside interface ssh 10.0.0.0 255.255.255.0 inside
!--- allow authentication using local aaa username chri password myVerySecurePassword aaa authentication ssh console LOCAL
!--- save the running-config
write memory
HP Procurve Switch
crypto key generate
ip ssh version 2
ip ssh
write memory
Retrieving ios running-config via scp
First, you need to ensure that ssh and scp have been enabled. I strongly recommend that you run ssh version 2.
ip ssh version 2
ip scp server enable
ip scp server enable
Then, on your PC:
You should then have a file called “running-config” in that directory. Pretty simple…
If you want to grab the startup-config instead of the running-config, try:
By using RSA keys to eliminate the password prompt at login, this method could be expanded to form the basis of an automated config backup. I know that various apps already exist, but a lot of them retrieve the config via “expect” scripts, basically executing a “show run” and capturing the output.
Another method of retrieving the config is via SNMP, however unless you’re using SNMP v3 with encryption, this method is potentially insecure.
Subscribe to:
Posts (Atom)