How to restore a Cisco device to IOS

Source: Internet
Author: User

IOSRecovered2Method

If you accidentally delete the Router or Switch IOS, especially if the IOS in Flash and the Mini IOS in ROM are no longer available, what can be done to restore it? There are two methods. Actually, I only know two types :)

Method 1: X-Modem

I have tried one method before, that is, when Flash is deleted, it cannot be started and can be restored using X-Modem. At that time, I accidentally deleted the Flash ios of a Cisco2950 switch, which caused the system to fail to start. After checking a lot of information, I came to the conclusion that the only method was to restore it through X-Modem. My recovery method is as follows:

1. Use the control line to connect the console port of the switch to the serial port of the computer. 1. Use the terminal software with the xmodem function to connect (win2000 and xp super terminals provide this function ).

2. Set the connection mode to serial port 1 (if other serial ports are connected, select other serial ports). The speed is 9600, no verification, no throttling, and the stop position is 1. Or click the default settings.

3. After the connection, press enter to display the switch without ios interface. The general prompt is: switch:

4. Unplug the power cord of the vswitch and restart the vswitch.

5. input:
Switch: flash_init
The following prompt is displayed:
Initializing Flash...

6. input the Copy command:

Switch: copy xmodem: flash: image_filename.bin

The following prompt is displayed:

Begin the Xmodem or Xmodem-1K transfer now...

7. The system prompts that the letter "C" appears and you can start transferring files.

8. Click the Super Terminal menu: Send --- send file, select Xmodem or Xmodem-1K protocol in protocol options, and then select the ios image file (*. bin) to start transfer.

9. Because the speed cannot be changed, the transmission speed is very slow. It takes about 80 minutes for me to transfer it. Please wait.

10. Prompt after transfer:
File "xmodem:" successfully copied ....
Switch:

11. Enter at the prompt

Switch: boot

Enable the new ios System

12. Re-power up to complete the recovery.

This is my recovery method. Now it seems very unscientific and inefficient. Later, I saw that others used X-Modem to restore IOS, but the efficiency was high:

Open the Super Terminal, enter the rommon mode (Ctrl + Break), and type confreg, as shown below:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~
Rommon 1> confreg press ENTER
  
Configuration Summary
Enabled are:
Load rom after netboot fails
Console BAO: 9600
Boot: image specified by the boot system commands
Or default to: cisco2-C2600
  
Do you wish to change the configuration? Y/n [n]: y (select yes)
Enable "diagnostic mode "? Y/n [n]: n (Select no)
Enable "use net in IP bcast address "? Y/n [n]: n (Select no)
Disable "load rom after netboot fails "? Y/n [n]: n (Select no)
Enable "use all zero broadcast "? Y/n [n]: n (Select no)
Enable "break/abort has effect "? Y/n [n]: n (Select no)
Enable "ignore system config info "? Y/n [n]: n (Select no)
Change console baud rate? Y/n [n]: y (select yes)
Enter rate: 0 = 9600, 1 = 4800, 2 = 1200, 3 = 2400
4 = 19200, 5 = 38400, 6 = 57600, 7 = 115200 [0]: 7 (select 7, use the xmodem with the maximum rate of 115200)
Change the boot characteristics? Y/n [n]: n (Select no)
  
Configuration Summary
Enabled are:
Load rom after netboot fails
Console BAO: 115200
Boot: image specified by the boot system commands
Or default to: cisco2-C2600
  
Do you wish to change the configuration? Y/n [n]: n (Select no)
  
You must reset or power cycle for new config to take effect
  
Rommon 2> reset carriage return
  
Note: before entering the reset key, start to define the serial speed (my computer --- port attribute ---- serial speed adjusted to 115200), and then modify the speed to 115200 in the Super Terminal. Remember, do it! Otherwise, garbled characters will appear! Then close this Super Terminal and re-establish a super terminal connection (during which the system restarts ).
  
Rommon 1> prompt
Then, enter
Rommon 1> xmodem-r
  
Do not start the sending program yet...
  
Invoke this application only for disaster recovery.
Do you wish to continue? Y/n [n]: y (select yes)
Ready to receive file...
  
In this case, choose "send"> "Send File"> "Send File" from the menu of the Super Terminal. Select the location of the IOS image file and use the "xmodem" protocol, and click "send ".
  
Then, wait for about 10-20 minutes to fill in the 3-6 m ios!
  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~
(Modify the serial port of the computer and the transmission rate of 9600 for the Super Terminal and the xmodem under the confreg vro)
  
(Videre note: in actual use, I found that this command is always unsuccessful, and then I found that there is a speed 115200 under line con 0, so even if the register is successfully changed, after the startup, the router executes speed 115200 again, but it still does not work. If you have this problem, remember to leave this statement empty)
  
Router> en enters the privileged mode of the new IOS
  
Router # reload restart system
  
Proceed with reload? [Confirm] Press ENTER
  
00: 01: 04:% SYS-5-RELOAD: Reload requested
System Bootstrap, Version 11.3 (2) XA4, release software (fc1)
Copyright (c) 1999 by cisco Systems, Inc.
TAC: Home: SW: IOS: Specials for info
PC = 0xfff0a530, Vector = 0x500, SP = 0x680108b0
C2600 platform with 24576 Kbytes of main memory
  
PC = 0xfff0a530, Vector = 0x500, SP = 0x80004684
  
Monitor: command "boot" aborted due to user interrupt
  
Rommon 1> confreg (enter the "confreg" command)
  
Configuration Summary
Enabled are:
Load rom after netboot fails
Console BAO: 115200
Boot: image specified by the boot system commands
Or default to: cisco2-C2600
  
Do you wish to change the configuration? Y/n [n]: y (select yes)
Enable "diagnostic mode "? Y/n [n]: n (Select no)
Enable "use net in IP bcast address "? Y/n [n]: n (Select no)
Disable "load rom after netboot fails "? Y/n [n]: n (Select no)
Enable "use all zero broadcast "? Y/n [n]: n (Select no)
Enable "break/abort has effect "? Y/n [n]: n (Select no)
Enable "ignore system config info "? Y/n [n]: n (Select no)
Change console baud rate? Y/n [n]: y (select yes)
Enter rate: 0 = 9600, 1 = 4800, 2 = 1200, 3 = 2400
4 = 19200, 5 = 38400, 6 = 57600, 7 = 115200 [7]: 0 (select 0, and use the xmodem transmission with the standard rate of 9600)
Change the boot characteristics? Y/n [n]: n (Select no)
  
Configuration Summary
Enabled are:
Load rom after netboot fails
Console BAO: 9600
Boot: image specified by the boot system commands
Or default to: cisco2-C2600
  
Do you wish to change the configuration? Y/n [n]: n
  
You must reset or power cycle for new config to take effect
Rommon 2>
  
At this time, manually switch back to the computer serial port and the Super Terminal with a transfer rate of 9600
  
Then
Rommon 2> reset
(Preferably power off)
  
His method is different from mine in two ways. First, he enters the rommon mode after startup, and second, he

Modified the speed of the serial port, which is much faster than me.

Method 2: TFTP

I tried to use the TFTP method to restore data before using the X-Modem method, but none of them were successful, so I thought the TFTP method would be different. However, as you can see on the Internet, TFTP can also be used, and the efficiency may be higher. The following is a recovery method for others. Unfortunately, I have never practiced it because I have never entered the rommon mode:

Install the TFTP server software on a machine, place the IOS file in the default root directory of the TFTP server, open the TFTP server, and connect the machine to the ROUTER using the control line, in addition, use a crossover network cable to connect the NIC of the machine to the Ethernet port of the ROUTER. (You can also use a common network cable to connect the ROUTER to the switch and then connect to the machine) after completing the above work, open the Super Terminal tool of the machine, connect to the ROUTER, and press Ctrl + Break, the command line prompt displayed in the window is ROMMON 1> ("1" indicates the number of lines in the command line ). Enter the following command at the prompt:

ROMMON 1> IP_ADDRESS = IP address of the ROUTER (the IP address must be in the same CIDR block as the TFTP server)
ROMMON 2> IP_SUBNET_MASK = subnet mask of the ROUTER
ROMMON 3> DEFAUT_GATEWAY = default gateway address (either no or TFTP Server)
ROMMON 4> TFTP_SERVER = TFTP Server IP Address
ROMMON 5> TFTP_FILE = IOS file name (only file name is provided, no path is required)
ROMMON 6> tftpdnld press ENTER
  
Note: The preceding commands must be in upper case, while the last tftpdnld command must be in lower case.
After the tftpdnld command is executed, you only need to select as prompted to complete file transmission. After the file is transferred, it will automatically return to the command line and enter reset to restart the ROUTER. After the restart, it will return to the familiar IOS mode and even the previously configured information will not be lost.
Notes:
A. when connecting a PC running the tftp server to a vro, you must use the first Ethernet port of the vro, that is, Ethernt0 (for 2500 series, etc.) and Ethernet0/0 (for 2600 series, etc ), other series are slightly different and can be determined according to the user manual.
B. When using a connection cable, you must use a crossover cable, because this is the connection between DTE and DCE.
C. On a PC running the tftp server, you must have an IOS image file of the corresponding vro. You can obtain the file through multiple channels and methods.
D. the IP address of the tftp server can be defined at will, but must be in the same network segment as the IP address defined by the router.

We can see that the above two methods both require IOS files. If you do not back up the original files, you can replace them with IOS of the same version.

Article entry: csh responsible editor: csh

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.