If you accidentally erased your flash or have a Cisco router with an empty flash, you can upload an IOS image from ROMmon to recover the device to a functional router. Connect your router via console-cable to a PC and use PuTTY to connect to your device. I use TFTPD32 from Philippe Jounin. When starting in rommon you need to type the following commands manually, don’t copy them from a texteditor to the console. When you make a mistake, press Enter and type it again because you can’t correct your words by pressing backspace. You also need to configure a gateway even if you configure the TFTP server IP address within the same subnet:
IP_ADDRESS=172.16.1.254
IP_SUBNET_MASK=255.255.255.0
DEFAULT_GATEWAY=172.16.1.2
TFTP_SERVER=172.16.1.100
TFTP_FILE=c1841-adventerprisek9-mz.124-9.T7.bin
Now you can decide how recovering the IOS image to your device. If you want to download the file to the flash you will use this command:
tftpdnld -u
reset
After this the download will start immediately. In the past I had often problems downloading IOS files from TFTP to flash within ROMmon, so I copy the IOS to DRAM without writing it to the flash file system and booted it with this command:
tftpdnld -r
After the IOS image is loaded into DRAM it boots automatically the IOS file image (keep in mind that your flash keeps still empty). Now you can copy the IOS file from TFTP to flash with
copy tftp flash
Address or name of remote host []? 172.16.1.100
Source filename []? c1841-adventerprisek9-mz.124-9.T7.bin
Destination filename [c1841-adventerprisek9-mz.124-9.T7.bin]?
Accessing tftp://172.16.1.100/c1841-adventerprisek9-mz.124-9.T7.bin…
Loading c1841-adventerprisek9-mz.124-9.T7.bin from 172.16.1.100 (via FastEthernet0):
!!!!!!!!!!!!!!!!!!!
Check your flash file system after the download:
Router#show flash
24576K bytes of processor board System flash (Intel Strataflash)
Directory of flash:/
2 -rwx 19063988 Apr 27 2002 16:49:50 +00:00 c1841-adventerprisek9-mz.124-9.T7.bin
Have a nice weekend! :)
One Response
Great post Michel :)
One more thing , For a blank flash, you will have to format it depending on the category of the flash i.e A , B or C. I was doing this on 1841 router which has a class C flash ,so i used the command format flash:
There is a link for this on Cisco support forum,
https://supportforums.cisco.com/document/21981/how-format-and-erase-flash-cisco-router
Great stuff Michel. This helped me a great deal.Cheers