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.
me ayudó mucho, gracias!
para que sea más fácil, renombrar el archivo .bin por HOLA o lo que sea
No.
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.
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.
thanks alot,
you helped me 🙂
Very useful contribution!!
This was SO helpful! Thanks a million!
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.
thanx ..this post has helped me a lot….
now my router is working fine….
thanx
does nt work with new 3750..xmodemdoesnt work also.. nice.. fuck
Sorry to hear that. If I get a chance I’ll try it – quite busy right now though.
Thanks man you save my life…………. 🙂
just wondering. Will this work on switches?
Looks like it might for a 3750:
http://forums.whirlpool.net.au/archive/888839
This was so much faster than xmodem, thank you so much for this, you saved me a ton of time.
very helpful… thank you!!!
Could somebody say if this works for a 7606 router, with a Supervisor Engine 32?
Thanks, really helped!
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
Recovered my 2610XM and 2620xm without a problem using this method. Excellent service Dataplumber, we thank you.
this was great
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
In that case, no gateway IP address required – you should be ok.
In that case, no gateway required – they’re on the same network.
save my day mate
u rock
thanks..its working
Thanks for sharing as simple presentation that is easy to apply!
[…] https://dataplumber.wordpress.com/2007/03/16/loading-ios-image-via-tftp-in-rommon/ […]
Thanks a bunch, this saved me a couple of hours waiting for xmodem
Thanks a lot, this saved me a couple of hours waiting for xmodem
there is no tftpdnld for ASR920, any idea how to overcome this problem?
I cannot assign any ip address because it continues to reboot again and again everytime I tried to insert an ip address can u help me?
Hi Dears .
i did the same process but its faied i am posting my result please guys help me whats wrong with my 2600 series router ,,
( IP_ADDRESS: 1.1.1.2
IP_SUBNET_MASK: 255.0.0.0
DEFAULT_GATEWAY: 1.1.1.10
TFTP_SERVER: 1.1.1.1
TFTP_FILE: c2600-j1s3-mz.123-18
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
…….. [TIMED OUT]
ARP: address resolution for 1.1.1.1 timed out.
ARP failed with failure code 1. TFTP transfer aborted.
TFTP: Operation terminated.)
If you have a firwall you will need to turn it off in windows or it will not connect to the tftp server.
Can you ping the router from your PC? Is the TFTP server running? Do you have a firewall on your PC?
Thank you very much for posting this.
I had the issue as Wikee as well: The TFTP mode looks for connection throught the FIRST interface! e.g. FE 0/0, I had it on FE 0/1 and was wondering why it is not fworking. Windows Firewall was NOT blocking it.
Good to know – thanks.
Thank you very much its working fine dude…
Thanks bud! Yep, ol Winders firewall got me!