Loading an IOS on a switch via Xmodem

Blog

Thu, 10/20/2016 - 08:47
Jan 24th, 2012

A very good evening to all!

There are times when the IOS on a switch may crash and (as a last resort) you need to use the painfully slow Xmodem transfer to save your life. I bought a 3550 a while back and that is precisely what happened with me. Without much else to try, I decided to give Xmodem a shot. I want to share how this can be used and I hope that this may be useful to others.

Since the device is in ROMMON, there’s not much that you can do.  There is, however, a method to transfer another IOS using a direct  console connection with a PC (the transfer is over your console cable itself). This wonderful little thing is called  Xmodem. Now the rate of transfer depends on the baud rate that you set  for your console connection. I tried this with baud set to 9600 and man,  it seemed like it would take over 3 hours for the transfer to complete.  With a little trial and error, I found that the maximum baud rate I  could set it up to work perfectly with was 57600. You can set the baud  rate in ROMMON using the set BAUD <value> command. See below:

switch: set BAUD 57600

This MUST also match on the terminal program setting as well. So (I’m  using TeraTerm) under Setup -> Serial Port, set the baud rate to  match whatever you set it as in ROMMON. Now we’re ready to transfer the  file. The command is very straight forward:

switch: copy xmodem: flash:c3550-ipservicesk9-mz.122-44.SE6.bin

Once you press enter, you see the following:

Begin the Xmodem or Xmodem-1K transfer now…
C

At this point, you need to choose the file location from the terminal  program. Go under File -> Transfer -> Xmodem -> Send and  choose the file that you wish the transfer. The transfer will start and  you will see a transfer window pop up like this:

untitled.png

Once completed, you should get a prompt back to your ROMMON:

Begin the Xmodem or Xmodem-1K transfer now…
C…………………………………………………………………….                                                                                                 ……………………………………………………………………..                                                                                                 ……………………………………………………………………..                                                                                                 ……………………………………………………………………..                                                                                                 ……………………………………………………………………..                                                                                                 ……………………………………………………………………..                                                                                                 ……………………………………………………………………..                                                                                                 ……………………………………………………………………..                                                                                                 ……………………………………………………………………..                                                                                                 ……………………………………………………………………..                                                                                                 ……………………………………………………………………..                                                                                                 ……………………………………………………………………..                                                                                                 ……………………………………………………………………..                                                                                                 ……………………………………………………………………..                                                                                                 ……………………………………………………………………..                                                                                                 ……………………………………………………………………..                                                                                                 ……………………………………………………………………..                                                                                                 ……………………………………………………………………..                                                                                                 ……………………………………………………………………..                                                                                                 ……………………………………………………………………..                                                                                                 ……………………………………………………………………..                                                                                                 ……………………………………………………………………..                                                                                                 ……………………………………………………………………..                                                                                                 ……………………………………………………………………..                                                                                                 ……………………………………………………………………..                                                                                                 ……………………………………………………………………..                                                                                                 ……………………………………………………………………..                                                                                                 ……………………………………………………………………..                                                                                                 ……………………………………………………………………..                                                                                                ……………………………………………
File “xmodem:” successfully copied to “flash:c3550-ipservicesk9-mz.122-44.SE6.bin”

Now from ROMMON, boot from flash using the following command:

switch: boot flash:c3550-ipservicesk9-mz.122-44.SE6.bin

This will try to boot the IOS specified and if the transfer was good, then this should go smoothly.

Loading  “flash:c3550-ipservicesk9-mz.122-44.SE6.bin”…#########################                                                                                                 ################################################################################                                                                                                 ################################################################################                                                                                                 ################################################################################                                                                                                 ################################################################################                                                                                                 ################################################################################                                                                                                 ################################################################################                                                                                                 ################################################################################                                                                                                 ################################################################################                                                                                                 ################################################################################                                                                                                 ################################################################################                                                                                                 ################################################################################                                                                                                 ################################################################################                                                                                                 ################################################################################                                                                                                 ################################################################################                                                                                                ########

File “flash:c3550-ipservicesk9-mz.122-44.SE6.bin” uncompressed and installed, entry point: 0×3000
executing…

All’s good again!! The switch runs a POST, once everything checks out, you’re back into the familiar territory! :)

        — System Configuration Dialog —

Would you like to enter the initial configuration dialog? [yes/no]: no

I hope this was informative.

Loading.
Alessio Andreoli Thu, 08/16/2012 - 02:17

I was once in pre-production environment with two 6513 doing Xmodem!!! Brilliant.... !! but trust me guys... how much i desired having 1 Mbps!!!!!!

Alessio

glennmcc64 Mon, 06/23/2014 - 03:40

Excellent post.

The only addition would be;

switch: set BAUD 9600

after the transfer is finished

 

Jeffrey Ambrose Thu, 10/01/2015 - 15:23

I just wanted to thank you.  I was in serious trouble, but your post brought me back from the dead!

Very informative and helpful to me.

You are the man!

 

 

patilmahesh100 Sun, 12/13/2015 - 01:58

Good article. But please anyone tell me "How to decide, when to use "xmodem method" and when to use "tftpdnld method" while recovering the router from ROMMON mode??? means what is differences in these 2 methods????"

bartuszzz1 Mon, 03/14/2016 - 07:51

Thank you! This is the best, most straightforward post about reinstalling your ios with xmodem. I was fixing my 3560 and this did it for me! I only had trouble with changing baud rate. Once I would change it to anything other than 9600 my switch would go berserk, displaying random letters and becoming useless. Only way of fixing it would be to turn it off and back on holding the mode button for 15 seconds. Changing it back to 9600 was a challenge of it's own. At the end I took my time (2-3 hours) and did the transfer at 9600. Curious if anyone else had similar experience?

Frederic Markarian Wed, 03/16/2016 - 02:51

Because you also must set up the baud rate on TeraTerm:

This MUST also match on the terminal program setting as well. So (I’m  using TeraTerm) under Setup -> Serial Port, set the baud rate to  match whatever you set it as in ROMMON

tawhid.84 Mon, 03/21/2016 - 22:32

Hello ,

When you have changed baud from default to anything , you will see random letter / signs.For this you need to change your hyper terminal settings.Suppose you have made baud to 56700 of the Switch, then disconnect hyperterminal and connect again hyperterminal by baud of 56700.I am sure it will work 100%.

bartuszzz1 Tue, 03/22/2016 - 10:36

Reconnecting the hyperterminal is the fix... that's what I was doing wrong. Thanks! I guess it depends what program you use. With putty you can choose baud rate before you connect but with teraterm you change baud after you connect and that's where I got stuck. I guess it works better when you reconnect with putty. Thanks again for reply.

jordiconrald Fri, 04/22/2016 - 05:05

hey guys. i have a prob just as stated but I cant copy my image file. it always fails. What i noticed though was that there are no files when i run the "dir flash:" command. Could that be where my problem lies?! i am using a cisco switch 2960 series.

carlosrifel Mon, 07/04/2016 - 06:16

Hello! One question: 

How can establish the new flash: like the default, because first it try to connect from old flash:, give me an error and then from the new one which works without problem. But i would like to skip the first error.

Thanks!

Actions

This Blog