Recover from IOS Armageddon

Categories: Networking, Tips


Ok, maybe it’s not that extreme, but losing power to a Cisco router or switch, while performing an IOS upgrade, after you’ve deleted your existing IOS can be a headache.  While not a disaster, you can plan on spending about an extra 45 minutes or so to recover.  Here’s the lowdown:


You’ll need to upload a new IOS image using the Xmodem or Ymodem protocol, which is way slower than TFTP or other methods (about 50 times slower!).

What You’ll Need

  • Cisco console cable
  • Terminal emulator w/Xmodem or Ymodem support
  • IOS image of choice

Step 1

Configure the router for the fastest connection possible (115kbps) using the “confreg” command, as shown here.  Also, configure the speed of the serial port on the computer that you are connecting to the device with to the same speed.


Step 2

Upload image using a terminal emulator with support for Xmodem or Ymodem.  If you’re using Windows XP, you can use hyperterminal in combination with telnet.  I prefer to use “SecureCRT“, but if anyone has any other recommendations, don’t be shy to comment.  Be prepared for this process to take up to an hour for an 15 MB IOS image.  If you’re looking at a couple of hours for the same file size, most likely you don’t have your transfer or serial port speed set correctly (see step 1).

Step 3

Reload router using uploaded IOS image.  Don’t forget to change the speed settings on the network device and computer back to the default (9600kbps).

  • In some of the newer routers the xmodem command has been deprecated so you can no longer use this method. However there is another method in place now that is actually faster. You will need a tftp server to use to upload your IOS image. I typically use TFTP32 by Jounin. You can google it, its a free download.

    Step 1) Connect your computer to the WAN port of the device that you need to recover. Manually set the IP on that connection.

    Step 2) Open your tftp server and set its directory to wherever you have the IOS image stored on your computer.

    Step 3) Configure the WAN port in ROMMON. The commands for this are as follows:
    IP_ADDRESS=IP address of the Ethernet port
    IP_SUBNET_MASK=subnet mask of the Ethernet port
    DEFAULT_GATEWAY=the default gateway
    TFTP_SERVER=the IP of the TFTP server (your local computer)
    TFTP_FILE=the file name of the IOS file

    Step 4) Start the download of the file using the “tftpdnld” command in ROMMON.

    Step 5) Reset or power cycle the device.

    *Note* Depending on your set up you may need to specific the file to be opened at boot. Do this by sending the “BOOT=IOSImageName” command where IOSImageName is your IOS file

  • Thanks for the update Colin! TFPT would definitely be a time saver compared to any of the [xyz]modem protocols. I wonder if this would also work on any of the older model routers….