Putty Xmodem File Transfer

PuTTY wish zmodem. We don't see that this is a vital requirement because we already supply two file transfer mechanisms in the PuTTY suite. To send files back, one of several protocols could be used, kermit, xmodem, ymodem and zmodem. The channel that the files were sent over were the actual login session. ZMODEM YMODEM YMODEM-G YMODEM/BATCH XMODEM-1K XMODEM XMODEM/CRC KERMIT Extended XMODEM ASCII - AS511 3964R RK512 LSV/2 MODBUS SuperCom breaks the limits in fast and reliable data communication and file transfer. It includes nearly all known standard file transfer used in serial communications. It is a fork of the classic PuTTY telnet/ssl client software that also supports “vintage” transfer protocols such as XModem. Once you have it installed it is pretty easy to establish a serial connection at 115200, 8, n, 1, as specified by Soekris.

Contents

Introduction

This document explains how to use the xmodem command at the console to download Cisco IOS® software using the ROM monitor (ROMmon).

Prerequisites

Download

Requirements

There are no specific requirements for this document.

Components Used

Xmodem

The information in this document is based on these software and hardware versions:

  • Cisco 827, 1600, 1700, 2600, 3600, and 3700 Series Routers

  • Cisco AS5200, AS5300, AS5350, and AS5400 Universal Access Servers

Note: Xmodem can also be used on certain Catalyst switches.

The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, make sure that you understand the potential impact of any command.

Conventions

Refer to Cisco Technical Tips Conventions for more information on document conventions.

Overview

Xmodem can be used on a group of routers (see Components Used) and is used in disaster recovery situations where the router has no valid Cisco IOS software or bootflash image to boot from and hence, only boots up in ROMmon. This procedure can also be used where there are no Trivial File Transfer Protocol (TFTP) servers or network connections, and a direct PC connection (or through a modem connection) to the router's console is the only viable option. Because this procedure relies on the console speed of the router and the serial port of the PC, it can take a long time to download an image. For example, downloading Cisco IOS Software Release 12.1(16) IP Plus image to a Cisco 1600 Series Router using a speed of 38400 bps takes approximately 25 minutes.

Usage

Here is the command syntax for xmodem as per the Command Reference Manual for Cisco IOS version 12.2.

This table describes the command syntax for the xmodem command.

syntax Description
-c (Optional) CRC-16 checksumming, which is more sophisticated and thorough than standard checksumming.
-y (Optional) Uses the Ymodem protocol for higher throughput.
-e (Optional) Erases the first partition in Flash memory before starting the download. This option is only valid for the Cisco 1600 series.
-f (Optional) Erases all Flash memory before starting the download. This option is only valid for the Cisco 1600 series routers.
-r (Optional) Downloads the file to DRAM. The default is Flash memory.
-x (Optional) Does not execute the Cisco IOS software image on completion of the download.
-s data-rate (Optional) Sets the console port's data rate during file transfer. Values are 1200, 2400, 4800, 9600, 19200, 38400, and 115200 bps. The default rate is specified in the configuration register. This option is only valid for the Cisco 1600 series routers.
filename (Optional) Filename to copy. This argument is ignored when the -r keyword is specified since only one file can be copied to DRAM. On the Cisco 1600 series routers, files are loaded to the ROMmon for execution.

Note: xmodem options e, f, and s are only supported on the Cisco 1600 Series Routers. In order to find out the syntax and available options to use with the xmodem command, enter xmodem -? at the ROMmon prompt.

Here is an example of the xmodem command issued on a Cisco 1603 Router:

Here is an example of the xmodem command issued on a Cisco 2620 Router:

Examples

Notes:

  • The xmodem transfer only works on the console port. You can only download files to the router. You cannot use xmodem to get files from the router.

  • It is also important to note that the -sdata-rate option is only available on the Cisco 1600 Series Routers and was implemented to overcome the console baud rate limitation of 9600 bps. If you specify -sdata-rate of 115200 bps for example, you can increase the download rate and hence, reduce download time. Other Cisco routers support console speeds up to 115200 bps. Therefore, the -sdata-rate option is not required.

  • Ensure that the PC serial port is using a 16550 universal asynchronous transmitter/receiver (UART) if you are downloading a Cisco IOS software image through the router's console speed at 115200. If the PC serial port is not using a 16550 UART, it is recommended that you use a speed of 38,400 or lower.

Xmodem Procedure for Downloading a Cisco IOS Software Image onto a Cisco 1603 Router

Using xmodem with putty

Use this xmodem procedure in order to download a Cisco IOS software image onto a Cisco 1603 Router.

  1. Launch a terminal emulator program.

    In this example, configure Windows HyperTerminal for 8-N-1 at 9600 bps and connect your PC's serial port to the console port of the router. Once connected, you need to get into the ROMmon prompt (rommon 1>). Typically, if the router's Cisco IOS software image and bootflash image are both corrupt, the router only comes up in ROMmon mode. If the former is not true and you need to get into the ROMmon prompt, you need to change the configuration register (typically 0x2102 as given by show version) to 0x0:

  2. From the ROMmon prompt, issue the xmodem command. However, before you issue the xmodem command, ensure that you have the new Cisco IOS software image on your PC.

    In this example, all Flash memory is erased before downloading using the f option (only on the Cisco 1600 Series ). Perform a CRC-16 checksum using the c option and using a download speed of 115200 bps (only on the Cisco 1600 Series ) by specifying -s115200:

    Note: If the console port is attached to a modem, both the console port and the modem must be operating at the same baud rate.

    Warning:

  3. Configure the terminal emulator program for a data rate of 115200 bps to match the xmodem speed specified above. This is done by closing the previous terminal session of 9600 bps and opening a new one at 115200 with 8-N-1. The trick here is that the Cisco 1603 only supports a maximum baud rate of 9600 bps. Therefore, when connecting at 115200 bps, you cannot see the router prompt. This is an important point to remember. Once connected to the router at 115200 bps, select Transfer and Send File from the HyperTerminal menu bar.

  4. Specify the image file name and location and enter xmodem as the protocol.

  5. Click on Send to start the transfer.

    This message is received when the transfer is complete:

  6. Per the message above, you need to exit your 115200 bps HyperTerminal session and restart a new one at 9600 bps. Once connected, the router's ROMmon prompt appears. Verify that the download was successful by issuing a dir flash:.

  7. Change the config register back to 0x2102 and reset or power cycle the router so that the new Cisco IOS software image gets loaded.

Putty Xmodem File Transfer Tool

Xmodem Procedure for Downloading a Cisco IOS Software Image onto a Cisco 2620 Router

Use this xmodem procedure in order to download a Cisco IOS software image onto a Cisco 2620 Router.

  1. Launch a terminal emulator program.

    This example Windows HyperTerminal is configured for 8-N-1 at 9600 bps. Connect your PC's serial port to the console port of the router. Once connected, get into the ROMmon prompt (rommon 1>). Typically, if the router's Cisco IOS software image and bootflash image are both corrupt, the router only comes up in ROMmon mode. If the former is not true and you need to get into the ROMmon prompt, then you will need to change the configuration register (typically 0x2102 as given by show version) to 0x0 as follows:

  2. Once in ROMmon, change the console baud rate from 9600 bps to 115200 bps to speed up the download time. Use the confreg command and complete the instructions presented on the screen.

  3. Once the router boots up in ROMmon, the HyperTerminal sessions start to display illegible characters. You need to exit the current terminal session and start a new one at a data rate of 115200 bps to match the console rate as in step 2.

  4. You are now ready to issue the xmodem command. However, before issuing the xmodem command, ensure that you have the new Cisco IOS software image on your PC.

    Warning:

  5. From the HyperTerminal menu bar, select Transfer > Send and specify the image name/location and xmodem protocol as in steps 3 and 4 and start the transfer.

  6. Once the transfer is complete, these messages appear:

    Notice how the Flash gets erased towards the end automatically compared to Cisco C1600. Therefore, the reason why the f option is not required here. Finally, ensure that you reset the console speed back to 9600 and change the boot sequence back to default by changing the configuration register back to 0x2102:

Xmodem Procedure for Downloading a Cisco IOS Software Image onto a Cisco 3600 Router

Use this xmodem procedure in order to download a Cisco IOS software image onto a Cisco 3600 Series Router.

The standard procedure uses the default console speed of 9600 bits per second. Xmodem is a slow transfer protocol, and the transfer of a file as large as a Cisco IOS software image could take an unacceptably long time. An increase to the console speed on the 3600 router helps decrease the time it takes to do the xmodem file transfer.

    When in ROMMON mode, complete this procedure using the ROMMON confreg utility.

  1. Open a new hyperterminal with these settings:

  2. After setting the hyperterminal, you receive a rommon prompt. Enter the xmodem command. Before you enter an xmodem command, there should be a software image residing in your terminal or your local hard drive.

  3. After this message appears, you have to download the file using xmodem and this procedure:

    1. Go to Hyperterminal and click the Transfer menu.

    2. Select Send File.

    3. In the dialog box which appears, click on browse and look for the file name on your local hard drive.

    4. Under the filename field is the Protocol drop-down box. Choose Xmodem.

    5. Click Send to initiate the file transfer.

  4. After the transfer completes, the router will reload itself. When the reload completes, press the return key to be taken to a prompt and to reset the configuration register and the console line speed.

  5. Upon changing the console speed, you will lose connectivity. Go to your terminal program, change the baud rate to 9600, and reconnect to the router console.

Putty Xmodem File Transfer Download

Related Information

Last week at work now, so been rushing to get things sorted out. I have still been doing a bit of study and planing some more ROUTE posts, but with a broken down car and house sale looking like its falling through haven’t had time to do any actually real posting.

However I came across something today, that I have known about for a while but never really used much. One of the things every one seems to love about CISCO is the fact you can simple copy and past configurations in to the terminal emulator window. And this is indeed great. set up one interface, copy the config to notepad, update it as you wish and past it back in… A real time saver and why we all love CISCO more than Microsoft ;).

In the past this is also how I have always copied backed up configurations on to a new switch/router. Simply open the saved config in notepad. Ctrl-A to select it all, copy and paste to the device. However I was doing this today and hit an issues. With really large configuration files (500+ lines of configuration), I was watching the console windows and could see it was skipping some of the configuration when doing this connected through the serial port. I could see that while things like VLAN’s where being created and the device was pausing, the following lines would some times get lost or corrupted. Now while if you only have a small size configuration file this is not an issue as it is quite easy to check, hundreds of lines become very hard to validate.

I found the best way around this problem was to set up the device with an IP address, put it on a limited access network that has a TFTP sever and copy over the configuration file, either to the startup-config or running-config. This works fine but it is a bit of a hassle going to all that trouble and it means you have to connect the switch to the network, so you have to be very careful with things like VTP and spanning tree. What I really wanted was a way to send the configuration file through the console port.

This made me think of how to recover a corrupted IOS image (which you can fine in the tips and tricks link above). Where boot the device in to ROMmon mode, and then copy the IOS over using the xmodem protocol. Almost all the mainstream terminual emulators have this built in, and while for recovering the IOS you need to increase the baud speed of the console port to speed up the copying process, as the configuration file is only 20-30kb max for most people, the standard speed will move that across in a few seconds.

So then it is just a case of knowing the command to achieve the goal, and I was happy to see it is as simple as it should be. On the device simple type the following from the enable prompt.

Putty And Xmodem

router#copy xmodem: startup-config

That’s it, no file names or anything, the device will now wait to receive the file(if you do not start the transfer within a few minutes the device will time out waiting). Then in your terminal emulation program start the transfer. In teraterm it is under the file menu, while secure CRT has a whole menu structure dedicated to various methods to transfer files. Simple chose the xmodem protocol (I found selecting the 1K option was more reliable), and browse to the configuration file, and away it goes. A few moments later the configuration will be on the device (#show Flash: to confirm), and a reboot will have it all up and running.

To me this is a far more reliable way of copying large configurations across, and allows you to easily set up the device from any client, this can be very useful if you are out on site and don’t have access to a limited access network, or the TFTP server to use to copy the files via TFTP or FTP using the network.

DevilWAH.

PS. Some older routers don’t seem to like you copying from xmodem to nvram, or require you to give a source file name. But you can still achieve the same by copying the file to Flash: .

Putty Xmodem Cisco

PPS. Although I prefer the xmodem method, you can improve the reliability of the copy/paste method by increasing the line/character delay in you terminal emulation program. A 5msec delay per character seems to help, although with a 1000+ lines of configuration you may get from a complex configuration, you may find the paste takes a little time, and you may still get errors.