Loading IOS image via TFTP in ROMMON

16 03 2007

Always a pain in the backside, isn’t it, when you’re stuck with a router that has no image on it. Even if you up the baud rate to 115,200 it still takes an age to download an image over the serial port to the thing.

More recent routers seem to have a TFTP client built-into the ROMMON software though. Not entirely sure how recent a router has to be in order to have this facility, but it’s very handy and saves a lot of time.

You basically set a few environment variables so that the router knows what its IP address is, where the server is and what the file it should download is. After that, just issue the “tftpdnld” command and off it goes. Here’s what you do:

rommon 11 > IP_ADDRESS=192.168.1.5
rommon 12 > IP_SUBNET_MASK=255.255.255.0
rommon 13 > DEFAULT_GATEWAY=192.168.1.1
rommon 14 > TFTP_SERVER=192.168.1.10
rommon 15 > TFTP_FILE=c1841-advipservicesk9-mz.124-13a.bin
rommon 16 > tftpdnld
.
IP_ADDRESS: 192.168.1.5
IP_SUBNET_MASK: 255.255.255.0
DEFAULT_GATEWAY: 192.168.1.1
TFTP_SERVER: 192.168.1.10
TFTP_FILE: c1841-advipservicesk9-mz.124-13a.bin
TFTP_MACADDR: 00:13:80:7b:20:1e
TFTP_VERBOSE: Progress
TFTP_RETRY_COUNT: 18
TFTP_TIMEOUT: 7200
TFTP_CHECKSUM: Yes
FE_PORT: 0
FE_SPEED_MODE: Auto Detect
.
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 c1841-advipservicesk9-mz.124-13a.bin from 192.168.1.10 !!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
....
File reception completed.
Validating checksum.
Copying file c1841-advipservicesk9-mz.124-13a.bin to flash.
program load complete, entry point: 0x8000f000, size: 0xc100
.
Initializing ATA monitor library.......
.
Format: Drive communication & 1st Sector Write OK...
Writing Monlib sectors.
................................................................................
..................
Monlib write complete
Format: All system sectors written. OK...
Format: Operation completed successfully.
Format of flash: complete
program load complete, entry point: 0x8000f000, size: 0xc100
Initializing ATA monitor library.......
rommon 17 >

Once that’s done, just issue a reset command and it should boot into IOS.

About these ads

Actions

Information

30 responses

2 05 2008
Sandra

me ayudó mucho, gracias!
para que sea más fácil, renombrar el archivo .bin por HOLA o lo que sea

11 06 2008
Mark

Hi,

I know this is an old post but I was wondering if you could clear something up. You’ve listed some IP addresses and Im not sure which is which. My Router doesnt have any flash files so I dont have a clue what it’s IP might be. Not sure if resetting it will set the IP to the default of 10.10.10.1.

Thanks for any help.

24 07 2008
IT Joe

Mark,

The router’s IP address is determined by the IP_ADDRESS statement in the original post. The IP address you give it is completely arbitrary. It only needs to match the environment you are working in so you can communicate with it. There is no such thing as a “default IP address” for Cisco routers with no configuration.

23 08 2008
haraj2

thanks alot,
you helped me :)

15 11 2008
Edward Lubaini

Very useful contribution!!

12 03 2009
Kristi

This was SO helpful! Thanks a million!

9 09 2009
Tony

Great posting…helped me out perfectly! My need was that I put in a brand new flash memory upgrade with no IOS. There is no formatting of flash per say, but when you perform the steps outlined above, the flash gets prepared and the IOS gets placed on it just fine.

Once I copied the IOS then did “CONFREG 0x2102″, my old startup-config was brought up and all was well…

Thanks again! Great job.

15 09 2010
prachi

thanx ..this post has helped me a lot….
now my router is working fine….
thanx

3 02 2011
kevin

does nt work with new 3750..xmodemdoesnt work also.. nice.. fuck

17 02 2011
DataPlumber

Sorry to hear that. If I get a chance I’ll try it – quite busy right now though.

10 04 2011
Rock

Thanks man you save my life…………. :)

12 07 2011
night_wolf

just wondering. Will this work on switches?

19 07 2011
DataPlumber

Looks like it might for a 3750:

http://forums.whirlpool.net.au/archive/888839

22 10 2011
CCNAMike

This was so much faster than xmodem, thank you so much for this, you saved me a ton of time.

5 12 2011
cosickeeg

very helpful… thank you!!!

16 12 2011
ssssantossss

Could somebody say if this works for a 7606 router, with a Supervisor Engine 32?

1 09 2012
Malt

Thanks, really helped!

26 10 2012
Chennai CCNA

Thank you very much.. My Cisco 2610XM IOS was amost corrupted. Want to recover it with a new copy of IOS from TFTP server.

Thanks again,
Chennai CCNA

13 04 2013
MasterT

Recovered my 2610XM and 2620xm without a problem using this method. Excellent service Dataplumber, we thank you.

21 04 2013
john

this was great

30 04 2013
Suhas

I got a doubt regarding the Gateway Ip Addr. I am going to directly connect my router to Tftp server, so do i need a gateway ip address

24 05 2013
DataPlumber

In that case, no gateway IP address required – you should be ok.

3 09 2013
DataPlumber

In that case, no gateway required – they’re on the same network.

18 09 2013
rimka

save my day mate
u rock

4 12 2013
Dhiren sahoo

thanks..its working

12 02 2014
Marco

Thanks for sharing as simple presentation that is easy to apply!

5 03 2014
31 05 2014
Darren

Thanks a bunch, this saved me a couple of hours waiting for xmodem

6 06 2014
Dhanu

Thanks a lot, this saved me a couple of hours waiting for xmodem

10 08 2014
Mohammad

there is no tftpdnld for ASR920, any idea how to overcome this problem?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




Follow

Get every new post delivered to your Inbox.

%d bloggers like this: