Categories
HowTo Guides

Cisco IOS deleted by mistake? Recovery guide

It happens… You are updating the IOS firmware on your Cisco device, and you get distracted. You deleted the old firmware to make space for the new, started the TFTP transfer, and somewhere in the 10 minute wait – you get distracted and something goes wrong. You’ll end up with a Cisco (877 router in my case) which is now in recovery mode – displaying ‘rommon’

A great guide put together by my colleague Josh Cunningham, on his Blog is summarised below to recover your deleted or corrupted Cisco IOS firmware.

First we need to get the router and the computer on the same subnet. Set IP as follows:

IP: 10.0.0.2
Subnet: 255.255.255.0
Default Gateway: 10.0.0.1

Connect an ethernet cable between your computer and Eth0. Ensure that your TFTP server is running on your computer, and type the following commands into the terminal window :

rommon 1 > IP_ADDRESS=10.0.0.1
rommon 2 > IP_SUBNET_MASK=255.255.255.0
rommon 3 > DEFAULT_GATEWAY=10.0.0.2
rommon 4 > TFTP_SERVER=10.0.0.2
rommon 5 > TFTP_FILE=c3845-adventerprisek9-mz.124-21.bin (Example file name, this should be your flash file including ext eg: .bin)
rommon 6 > tftpdnld

After a fairly lengthy wait – your IOS firmware should have transferred, and should boot as normal. So long as you haven’t factory reset, your configuration file will still be present on the flash so should load.

To clarify; to correctly update the flash firmware on the Cisco, you should follow these steps whilst in enable mode :

sh flash     //This will show all current files loaded into the flash
del FILENAME  //will delete a file from the flash memory
copy tftp fl   // will copy a flash file from a TFTP server

By Mik Canavan

I'm a tech obsessed and self-confessed geek. As the Technical Director at Fivenines UK, I'm lucky that I get to faf with gadgets, design websites and fix servers...

2 replies on “Cisco IOS deleted by mistake? Recovery guide”

Leave a Reply

Your email address will not be published. Required fields are marked *