Friday, August 22, 2008

Recover IOS using tftpdnld from ROMMON

In Cisco 2600/2800/3800 Series Router we can recover IOS using Trivial File Transfer Protocol (TFTP) over ethernet interface using the ROMmon tftpdnld command.
tfptdnld is more faster rather than recovering IOS via Xmodem.

There are some variables to set when we want to transfer files to router using tftpdnld.
You can type tftpdnld -h

rommon 1 > tftpdnld -r

usage: tftpdnld [-hr]


Use this command for disaster recovery only to recover an image via TFTP.

Monitor variables are used to set up parameters for the transfer.

(Syntax: "VARIABLE_NAME=value" and use "set" to show current variables.)
"ctrl-c" or "break" stops the transfer before flash erase begins.


The following variables are REQUIRED to be set for tftpdnld:
IP_ADDRESS: The IP address for this unit
IP_SUBNET_MASK: The subnet mask for this unit
DEFAULT_GATEWAY: The default gateway for this unit

TFTP_SERVER: The IP address of the server to fetch from

TFTP_FILE: The filename to fetch


The following variables are OPTIONAL:
GE_PORT: Ethernet port number for download, 0 or 1 (default=0)

TFTP_MEDIA_TYPE: Media select for GE_PORT=0, 0(Copper) or 1(Fiber) (default=0)
TFTP_VERBOSE: Print setting. 0=quiet, 1=progress(default), 2=verbose
TFTP_RETRY_COUNT: Retry count for ARP and TFTP (default=20)
TFTP_TIMEOUT: Overall timeout of operation in seconds (default=7200)

TFTP_CHECKSUM: Perform checksum test on image, 0=no, 1=yes (default=1)

TFTP_MACADDR: The MAC address for this unit

GE_SPEED_MODE: 0=10/hdx, 1=10/fdx, 2=100/hdx, 3=100/fdx, 4=1000/fdx,
5=Auto (default)

Command line options:
-h: this help screen

-r: do not write flash, load to DRAM only and launch image


Below is an example in using tftpdnld to recover an IOS image name c3845-adventerprisek9-mz.124-21.bin to a Cisco 3845 router:

rommon 1 > IP_ADDRESS=171.68.171.0
rommon 2 > IP_ADDRESS=10.0.0.1

rommon 3 > IP_SUBNET_MASK=255.255.255.0

rommon 4 > DEFAULT_GATEWAY=10.0.0.13

rommon 5 > TFTP_SERVER=10.0.0.13

rommon 6 > TFTP_FILE=c3845-adventerprisek9-mz.124-21.bin

rommon 7 > tftpdnld

IP_ADDRESS: 10.0.0.1

IP_SUBNET_MASK: 255.255.255.0

DEFAULT_GATEWAY: 10.0.0.13

TFTP_SERVER: 10.0.0.13
TFTP_FILE: c3845-adventerprisek9-mz.124-21.bin
GE_PORT: Ge0/0
TFTP_MEDIA_TYPE: Copper

GE_SPEED_MODE: Auto
Invoke this command for disaster recovery only.

WARNING: all existing data in all partitions on flash will be lost!

Do you wish to continue? y/n: [n]: y


Receiving c3845-adventerprisek9-mz.124-21.bin from 10.0.0.13 !!!!!!!!!!!!!!!!!!!!!!!!!!!!

File reception completed.
Copying file c3845-adventerprisek9-mz.124-21.bin to flash.
Erasing flash at 0x607c0000

program flash location 0x60440000

rommon 8 >


References:
http://www.cisco.com/en/US/products/hw/routers/ps259/products_tech_note09186a008015bf9e.shtml

8 comments:

Anonymous said...

Interesting article you got here. It would be great to read a bit more concerning that topic. The only thing it would also be great to see here is some photos of some gadgets.
Nickolas Kripke
Cell phone blocker

rosemary said...

One of our 1841 routers only boots in rommon and there is nothing in flash. After inputting the tftpdnld -r command, the image is downloaded from tftp, the router goes to CLI requesting a password which I do not have as I am not the one who previously configured it. What do I do so that it goes back to rommon after the download for me to put the confreg command?

rosemary said...

One of our 1841 routers only boots in rommon and there is nothing in flash. After inputting the tftpdnld -r command, the image is downloaded from tftp, the router goes to CLI requesting a password which I do not have as I am not the one who previously configured it. What do I do so that it goes back to rommon after the download for me to put the confreg command?

Bayu Prasidha Wibowo said...

@rosemary
so do you want to go to rommon again?
you can follow this procedure
http://www.cisco.com/en/US/products/hw/routers/ps133/products_tech_note09186a0080174a34.shtml

Chennai CCNA said...

Thanks a lot..

I had deleted my old IOS when I was learning TFTP in 2610XM router and copied a new version IOS to thr router. Router is now displaying "Memory not enough" error and not able to boot. I will try this.

Thank you very much...

Unknown said...

Nice blog, it is very informative and helpful for me , I am always ready to read informative and interesting blogs, thanks

http://www.isolcertificationtraining.com/cisco-training/

Unknown said...

Nice blog, it is very informative and helpful for me , I am always ready to read informative and interesting blogs, thanks

http://www.isolcertificationtraining.com/cisco-training/

mcclane said...

Very helpful post. continue posting the article.
thanks.