Upgrading CISCO IOS

I imported this from my old website from way back in time as I just needed it as a reference for myself again.

Warning! Everything here is on your own risk. If you don’t know what you are doing DON’T.

This is a small step-by-step guide on updating IOS annotated from a script(1) transcript I took from a while back. In my case I’m upgrading IOS 12.1(20)EA1a to IOS 12.1(22)EA14, the latter of which is the last version supporting the Catalyst 2950 series.

Step 1: TFTP

Start a TFTP server. My administration machine runs OpenBSD which ships by default with tftpd. Go to the directory with your IOS images and type:

# tftpd -c

The -c option allows the creation of files which is not needed if you don’t want to backup the old IOS image. Ensure the folder has the right permissions.

Also don’t forget to allow the IP address of the switch to pass traffic on the tftp port if you use a firewall.

Step 2 (Optional) Backup old IOS image

Switch# copy flash tftp
Source filename []? c2950-i6q4l2-mz.121-20.EA1a.bin
Address or name of remote host []? <tftp-server>
Destination filename [c2950-i6q4l2-mz.121-20.EA1a.bin]?
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3036020 bytes copied in 17.016 secs (178421 bytes/sec) 

Step 3: Do I have enough space left on flash:?

Switch> show flash
(Omitted)
7741440 bytes total (1608704 bytes free) 

So only around 1MB free, but we need around 4MB so lets delete the current IOS image. Ensure the Switch is not restarted until the new IOS image is transferred and set up for boot, hence it is a good idea to have it being attached to an UPS. If you have enough space left go to step 4 without deleting the old image.

Switch> delete c2950-i6q4l2-mz.121-20.EA1a.bin
Delete filename [c2950-i6q4l2-mz.121-20.EA1a.bin]?
Delete flash:y? [confirm] y

Step 3: Transfer new IOS image

Switch# copy tftp flash
Address or name of remote host []? <tftp-server>
Source filename []? c2950-i6k2l2q4-mz.121-22.EA14.bin
Destination filename [c2950-i6k2l2q4-mz.121-22.EA14.bin]?
Accessing tftp://tftp-server/c2950-i6k2l2q4-mz.121-22.EA14.bin...
Loading c2950-i6k2l2q4-mz.121-22.EA14.bin from tftp-server (via Vlan120): !!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[OK - 3722814 bytes] 

Step 5: Verify new image

Switch# verify /md5 c2950-i6k2l2q4-mz.121-22.EA14.bin
.................................................................................
.................................................................................
.................................................................................
.................................................................................
.................................................................................
.................................................................................
.................................................................................
.................................................................................
.................................................................................
.................................................................................
.................................................................................
..................Done!
verify /md5 (flash:c2950-i6k2l2q4-mz.121-22.EA14.bin) = 8d3250ee253b81b7fe2762e281773fbc 

Now we check this against the file MD5 on the administration machine:

# md5 c2950-i6k2l2q4-mz.121-22.EA14.bin
MD5 (c2950-i6k2l2q4-mz.121-22.EA14.bin) = 8d3250ee253b81b7fe2762e281773fbc 

All fine!

Step 6: Setup boot NVRAM

To make the switch actually boot the new image we need to update a NVRAM variable:

Switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)# boot system flash:c2950-i6k2l2q4-mz.121-22.EA14.bin
Switch(config)# exit
Switch# show boot
BOOT path-list: flash:c2950-i6k2l2q4-mz.121-22.EA14.bin
Config file: flash:/config.text
Private Config file: flash:/private-config.text
Enable Break: no
Manual Boot: no
HELPER path-list:
NVRAM/Config file
buffer size: 32768
Switch# write memory
Building configuration...
[OK] 

Step 7: Reload the Switch

Switch# reload
Proceed with reload? [confirm] y

And there you go!

If something goes wrong at this point (i.e. image got corrupted somehow and does not boot) you can transfer the old image using XMODEM over the serial line. This is a slow process though. See the respective handbook from CISCO on how to do that.

Also a consideration: Update the Sticker on the rear to match the currently installed IOS. My sticker was still from the factory installed IOS 12.1(6)EA2a even though it was upgraded to the aforementioned IOS 12.1(20)EA1a at some point.

It really helps when you can look at the sticker in the back and know what the switch is running, there is nothing more annoying than thinking that you have to upgrade IOS, allocate time for it and then realize that it is already up to date once you are hooked up to it.

Contents