Use FTP Instead of TFTP to Transfer IOS Images

Michael Lucas' book Cisco Routers for the Desperate saved me this evening. I was trying to update the flash image on my Cisco 2950T-24 switch via TFTP, and had this problem (twice, actually):

gruden#copy tftp flash
Address or name of remote host [192.168.2.7]?
Source filename [c2950-i6k2l2q4-mz.121-22.EA3.bin]?
Destination filename [c2950-i6k2l2q4-mz.121-22.EA3.bin]?
Accessing tftp://192.168.2.7/c2950-i6k2l2q4-mz.121-22.EA3.bin...
Loading c2950-i6k2l2q4-mz.121-22.EA3.bin from 192.168.2.7 (via Vlan1):
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
...edited...
!!!!!!!!!!!O!O!O!O!OO!OO!OO!OOOO
%Error reading tftp://192.168.2.7/c2950-i6k2l2q4-mz.121-22.EA3.bin (Transfer aborted)

Luckily the switch was not hosed at this point. I still had my command prompt and normal functionality. For some reason TFTP kept failing. The image stored on the TFTP server appeared good, since its MD5 hash matched that provided by Cisco. What to do?

I remember Michael Lucas describing how to use FTP to transfer IOS images, so I tried that:

gruden#copy ftp://richard:pasword@192.168.2.7/c2950-i6k2l2q4-mz.121-22.EA3.bin flash
Destination filename [c2950-i6k2l2q4-mz.121-22.EA3.bin]?
Accessing ftp://richard:password@192.168.2.7/c2950-i6k2l2q4-mz.121-22.EA3.bin...
Loading c2950-i6k2l2q4-mz.121-22.EA3.bin !!!!!!!!!!!!!!!!!!!!!!!!!!!!!
...edited...
2867200 bytes copied in 256.536 secs (11177 bytes/sec)

I then reloaded the switch and it came up without any problems. Thanks Michael!

Comments

Anonymous said…
Thanks for the Cisco tips!
Anonymous said…
I find stability greatly varies depending on which TFTP server you are using. The old Cisco one is rubbish, however i find the 3COM TFTP server to be very reliable. I haven't tried any *nix/bsd tftp servers for upgrading IOS images however.

You can download the 3COM TFTP server from : ftp://ftp.3com.com/pub/utilbin/win32/3CTftpSvc.zip
Re: TFTP servers -- I used the tftpd bundled with FreeBSD 5.3. It had no problem with the images transferred between the FreeBSD TFTP server and my Cisco router. Maybe it's the switch?
Anonymous said…
If the image is over 21MB, you cannot transfer it with tftp.
balikbayanbok said…
^ not true. I have transferred 122Mb IOS images via tftp with success
Unknown said…
I had this problem with tftpd32 upgrading ios of my lab switches but only on 1 switch the rest upgraded without any problems.

Popular posts from this blog

Zeek in Action Videos

New Book! The Best of TaoSecurity Blog, Volume 4

MITRE ATT&CK Tactics Are Not Tactics