You can upload a copy of your router’s IOS image to a TFTP server with the following set of commands:
Freebsd%touch
Freebsd%
/tftpboot/c2600-ik9o3s-mz.122-12a.bin
chmod 666
Freebsd%
/tftpboot/c2600-ik9o3s-mz.122-12a.bin
telnet
Trying 172.25.1.5... Connected to Router1. Escape character is '^]'. User Access Verification Password:
Router1
<vtypassword>
Router1>enable
Password:<enablepassword>
Router1#copy flash:
c2600-ik9o3s-mz.122-12a.bin
tftp
Address or name of remote host []?Destination filename [c2600-ik9o3s-mz.122-12a.bin]?
172.25.1.1
<enter>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 11135588 bytes copied in 52.588 secs (211752 bytes/sec) Router1#
Before attempting to upgrade the IOS version of a router it’s a good idea to save a copy of the current IOS image. This way, if an upgrade fails or if you have problems with the new IOS version, you can revert back to the old proven IOS version. The procedure to copy an IOS image to a TFTP server is very similar to the way we backed up a configuration file in Recipe 1.2. The only real difference is the size of the file involved, since IOS images are quite a bit larger than configuration files.
As we mentioned in Recipe 1.2, you have to watch out for the file permissions on your TFTP server. The transfer will fail if this file isn’t world writable. We highly recommend that you remove the world-writable attribute on this file after uploading it. On Unix systems, you can use the chmod command to change the file attributes. This will ensure that the file isn’t accidentally overwritten. Unlike configuration files, which you should never store in your TFTP directory, IOS images pose no security concerns, as long as they are not world writeable.
Get Cisco IOS Cookbook, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.