SoFunction
Updated on 2025-04-12

How to restore IOS of Cisco device

IOSRecovered2A method

If you accidentally delete the Router or Switch IOS, especially if the IOS in Flash and Mini IOS in ROM are gone, and if you can't even start it, is there any way to restore it? The answer is that there are not only one method, but two methods. Actually, I only know two types:)


The first method: X-Modem

I have tried a method before, which is that when Flash is deleted, it cannot enter the system after startup, and can use X-Modem to restore it. 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 a conclusion: the only way to recover through X-Modem. My recovery method is as follows:

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

2. Set the connection method to serial port 1 (if the other serial port is connected, select other serial ports), the speed is 9600, no verification, no flow control, stop bit 1. Or click on the default settings.

3. After connecting, the computer enters the switch without iOS interface. The general prompt is: switch:

4. Unplug the switch's power cord and restart the switch

5. Enter in the hyper terminal:
switch:flash_init
The following prompt will appear:
Initializing Flash...  

6: Enter the copy command:

switch:copy xmodem: flash:image_filename.bin

The following prompt appears:

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

7. The system prompts that the letter C is constantly appearing and you can start transferring files.

8. Click the hyper terminal menu: Transfer ---Send files, select Xmodem or Xmodem-1K protocol in the protocol options, and then select the image file of ios (*.bin) to start transfer.

9. Because the speed cannot be changed, the transmission is very slow. Mine has been teleported for about 80 minutes, please wait patiently.

10. Tips after the transmission is completed:
File "xmodem:" successfully copied to ....
switch:

11. Enter at the prompt

switch:boot

Enable new iOS system

12. Re-power and complete the recovery work.


This is my recovery method, which now seems very unscientific and inefficient. Later I saw how others used X-Modem to restore IOS, but had high efficiency:

First open the hyper terminal, enter romon mode (Ctrl+Break key combination), type confreg, as follows:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rommon 1 > confreg Enter

Configuration Summary
enabled are:
load rom after netboot fails
console baud: 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, transmit with the maximum 115200 rate xmodem)
change the boot characteristics? y/n [n]: n (select no)

Configuration Summary
enabled are:
load rom after netboot fails
console baud: 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 Enter

Note: Before typing the reset key at this time, start defining the serial port speed (My computer---port property------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Otherwise, garbled code appears! Then close the hyper terminal and re-establish a hyper terminal connection. (During the system restarts) after startup, a

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 ...

At this time, on the menu of the hyper terminal, "Transfer" ----Select the location of the IOS image file and select the "xmodem" protocol, click "Send"

Then wait for about 10-20 minutes and then pour 3-6M IOS into it!

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(Modify the transmission rate of 9600 such as the computer serial port and hyper terminal, router confreg, etc.)

(Videre Note: When I actually used it, I found that this command was always unsuccessful. Later, I found that there was a speed 115200 under line con 0. So even if the register is successfully changed, the router will execute speed 115200 after starting, but it still doesn't work. So if you have this problem, remember to drop this statement)

Router>en Enter the privileged mode of the new IOS

Router#reload Restart the system

Proceed with reload? [confirm] 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 = 0x680127b0
C2600 platform with 24576 Kbytes of main memory

PC = 0xfff0a530, Vector = 0x500, SP = 0x80004684

monitor: command "boot" aborted due to user interrupt

romon 1 > confreg (Enter the "confreg" command)

Configuration Summary
enabled are:
load rom after netboot fails
console baud: 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, change back to xmodem transmission with standard rate 9600)
change the boot characteristics? y/n [n]: n (select no)

Configuration Summary
enabled are:
load rom after netboot fails
console baud: 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, the transmission rate is 9600 when manually reverting back to the computer serial port and super terminal.

Then knock in
rommon 2 >reset
(It is best to turn off the power supply)

There are two differences between his method and mine. First, he entered rommon mode after starting, and secondly he