In this guide, you will learn how to upgrade the Cisco IOS version of a Cisco router or switch. You can accomplish this task using different tools: FTP server, TFTP server, USB driver, or console cable.

You must set up IP addresses for the router/switch and the remote server (FTP, TFTP ….). If you want to upgrade Cisco IOS using a USB drive or the console cable, you do not have to configure IP addressing.

In the next sections, I will be using the following network topology.

The following Cisco IOS upgrade procedures apply almost to every Cisco IOS-based router like Cisco 1000 Series Routers, Cisco 1400 Series Routers, Cisco 1600-R Series Routers,  Cisco 1700 Series Routers, Cisco 2600 Series Routers, Cisco 2800 Series Routers, Cisco 3600 Series Routers, Cisco 3700 Series Routers, Cisco 3800 Series Routers, Cisco 4000 Series Routers, Cisco 4700 Series Routers, Cisco 7200 Series Routers, Cisco 2950 Series Switches, Cisco 2960 Series Switches, Cisco 3550 Series Switches, Cisco 3560 Series Switches, Cisco 3750 Series Switches, and Cisco 3850 Series Switches.

How To Upgrade Cisco IOS for a Router or Switch Using an FTP Server

This section teaches you how to perform firmware upgrades for Cisco IOS-based routers and switches using an FTP server. This procedure requires you to have a Cisco IOS image file stored on an FTP server. If you don’t have such a file, you can log in at Cisco Software Central and download an IOS image file that is suitable for your router/switch model, and then upload it to your FTP server.

Here are the steps to upgrade the Cisco IOS image of router R1 using the file “c2900-universalk9-mz.SPA.155-3.M4a.bin” that is stored on the FTP server with IP address 10.0.0.100. We will use “cisco” and “cisco”, without quotes, as the username and password during the FTP authentication phase.

Step 1. Configure the FTP user credentials that will be used to connect to the FTP server.

R1(config)# ip ftp username cisco
R1(config)# Ip ftp password cisco

Step 2. Download the file “c2900-universalk9-mz.SPA.155-3.M4a.bin” from the FTP server and save it into the flash memory of the router using the copy ftp: flash: command. This Cisco IOS command requires that you enter the IP address of the FTP server and the complete path of the Cisco IOS image file.

R1# copy ftp: flash:
Address or name of remote host []? 10.0.0.100
Source filename []? c2900-universalk9-mz.SPA.155-3.M4a.bin
Destination filename [c2900-universalk9-mz.SPA.155-3.M4a.bin]?   !Just press if you don't want to rename the file

Accessing ftp://10.0.0.100/c2900-universalk9-mz.SPA.155-3.M4a.bin...
[OK - 33591768 bytes]

33591768 bytes copied in 65.21 secs (54086 bytes/sec)

Step 3. Issue the show flash: command to check if the file has been copied successfully to the router.

R1# show flash:

System flash directory:
File  Length   Name/status
  3   33591768 c2900-universalk9-mz.SPA.151-4.M4.bin
  4   33591768 c2900-universalk9-mz.SPA.155-3.M4a.bin
  2   28282    sigdef-category.xml
  1   227537   sigdef-default.xml
[67439355 bytes used, 188304645 available, 255744000 total]
249856K bytes of processor board System flash (Read/Write)

Step 4. Using the boot system command, configure the router/switch to load the new Cisco IOS image the next time it gets restarted, and then save your configuration.

R1(config)# boot system flash:c2900-universalk9-mz.SPA.155-3.M4a.bin
R1(config)#^Z
R1#
R1# write memory 
Building configuration...
[OK]

Step 5. Restart the router using the reload command.

R1# reload
Proceed with reload? [confirm]       ! press Enter key

System Bootstrap, Version 15.1(4)M4, RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 2010 by cisco Systems, Inc.
Total memory size = 512 MB - On-board = 512 MB, DIMM0 = 0 MB
CISCO2911/K9 platform with 524288 Kbytes of main memory
Main memory is configured to 72/-1(On-board/DIMM0) bit mode with ECC disabled

Readonly ROMMON initialized

Omitted output

Step 6. Issue the show version command to make sure the new image file has been loaded successfully.

R1> show version
Cisco IOS Software, C2900 Software (C2900-UNIVERSALK9-M), Version 15.5(3)M4a, RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2016 by Cisco Systems, Inc.
Compiled Thu 06-Oct-16 14:43 by mnguyen

ROM: System Bootstrap, Version 15.1(4)M4, RELEASE SOFTWARE (fc1)
cisco1941 uptime is 37 seconds
System returned to ROM by power-on
System image file is "flash0:c2900-universalk9-mz.SPA.155-3.M4a.bin"

omitted output

How To Upgrade Cisco IOS for a Router or Switch Using a TFTP Server

In this section, we will walk you through a way process of performing Cisco IOS image upgrades for Cisco IOS-based routers and switches. Upgrading Cisco IOS via TFTP involves owning a Cisco IOS image file stored on a TFTP server.

If you don’t have the required image file, worry not! You can obtain one by logging in at Cisco Software Central and downloading an IOS image file that is suitable for use with your particular router or switch model. Once you have the image file, you can proceed to copy it to your TFTP server.

Here are the steps to upgrade Cisco IOS operation system to a newer version via TFTP.

Step 1. Issue the copy tftp: flash: command to transfer the new image file from the TFTP server to the flash memory of the router/switch. In this example, we download the file c3560-advipservicesk9-mz.122-46.SE.bin for a Cisco switch from the TFTP server with IP address 10.0.0.100 to flash memory.

SW1# copy tftp: flash:
Address or name of remote host []? 10.0.0.100
Source filename []? c3560-advipservicesk9-mz.122-46.SE.bin
Destination filename [c3560-advipservicesk9-mz.122-46.SE.bin]?    ! press Enter key

Accessing tftp://10.0.0.100/c3560-advipservicesk9-mz.122-46.SE.bin.....
Loading c3560-advipservicesk9-mz.122-46.SE.bin from 10.0.0.100: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[OK - 10713279 bytes]

10713279 bytes copied in 7.576 secs (280272 bytes/sec)

The copy command requires that you enter the IP address of the TFTP server and the exact filename of the image you want to transfer. Additionally, you have to specify the destination filename. If you simply press Enter key, that will be the same as the source filename.

Step 2. Issue the show flash: command to see that the file was transferred to the router/switch.

SW1# show flash:

System flash directory:
File  Length   Name/status
  3   8662192  c3560-advipservicesk9-mz.122-37.SE1.bin
  4   10713279 c3560-advipservicesk9-mz.122-46.SE.bin
  2   28282    sigdef-category.xml
  1   227537   sigdef-default.xml
[19631290 bytes used, 44385094 available, 64016384 total]
63488K bytes of processor board System flash (Read/Write)

Step 3. Configure the router/switch to use the new IOS image file using the boot system command, and then save the running configuration.

SW1(config)# boot system c3560-advipservicesk9-mz.122-46.SE.bin
SW1(config)#^Z
SW1#
SW1# copy running-config startup-config 
Destination filename [startup-config]? 
Building configuration...
[OK]
SW1#

Step 4. Reboot the device.

SW1# reload
Proceed with reload? [confirm]
C3560 Boot Loader (C3560-HBOOT-M) Version 12.2(25r)SEC, RELEASE SOFTWARE (fc4)
cisco WS-C3560-24PS (PowerPC405) processor (revision P0) with 122880K/8184K bytes of memory.
3560-24PS starting...

omitted output


Step 5. Enter the show version command to verify that the newer Cisco IOS version is being loaded.

SW1# show version
Cisco IOS Software, C3560 Software (C3560-ADVIPSERVICESK9-M), Version 12.2(46)SE, RELEASE SOFTWARE (fc1)
Copyright (c) 1986-2007 by Cisco Systems, Inc.
Compiled Thu 27-Aug-08 22:22 by pt_team
Image text-base: 0x00003000, data-base: 0x01500000

ROM: C3560 Boot Loader (C3560-HBOOT-M) Version 12.2(25r)SEC, RELEASE SOFTWARE (fc4)

System returned to ROM by power-on

omitted output

How To Upgrade Cisco IOS for a Router or Switch using a USB Drive

Step 1. Format the USB flash drive to FAT16 or FAT32. IF the USB drive is not well formatted, Cisco IOS would display this error message.

%USBFLASH-4-FORMAT: usbflash0 contains unexpected values in partition table or boot sector.
Device needs formatting before use!

Step 2. Copy the new Cisco IOS image file into the USB drive.

Step 3. Connect your management station to your Cisco router/switch using the appropriate cable (Console or Ethernet).

Step 4. (Optional) If you are not using a console cable, configure IP addressing on the Cisco device and your computer to ensure they can communicate.

Step 5. Plug the USB Flash drive into the router/switch. It does not matter which USB port you use in this procedure.

Step 6. Log into your Cisco device using a terminal emulator like Putty, and then access enable mode.

Step 7. Use the copy command to transfer the new image file to flash memory. In this example, we copy the file c3750e-universalk9-mz.152-4.E10.bin into flash memory.

SW1# copy usbflash0: flash:
Source filename []? c3750e-universalk9-mz.152-4.E10.bin
Destination filename [c3750e-universalk9-mz.152-4.E10.bin]? ! press Enter key
Copy in progress...CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
20354176 bytes copied in 56.849 secs (358039 bytes/sec)

Step 8. In router configuration mode, configure the BOOT variable using the boot system command. In this example, we configure Cisco IOS to boot using the image c3750e-universalk9-mz.152-4.E10.bin.

SW1(config)# boot system flash:c3750e-universalk9-mz.152-4.E10.bin

Step 9. Save the configuration using the write memory command.

Step 10. Restart your Cisco device using the reload command.

How To Upgrade Cisco IOS for a Router or Switch Using the Console Cable

Upgrading Cisco IOS through the console port does not require network connectivity like using an FTP, TFTP, or SCP server. You only need a console cable, terminal emulator software like Hyper Terminal or Tera Term, and a Cisco IOS image file.

Here are steps to replace the current Cisco IOS image of a particular router/switch with a more recent one.

Step 1. Connect your PC to the Cisco router/switch using a console cable.

Step 2. Connect the router/switch to the power and boot it up.

Step 3. Create a new connection in the terminal application and set the transfer rate to 9600.

Step 4. Enter ROMMON mode. This can be achieved in different ways. For a Cisco switch, power the switch on, and then hold the Mode button for two seconds while Cisco IOS is loading.

For Cisco routers, press Break or Shift+Break on the keyboard within around a minute after powering up the router.

Step 5. On the Cisco device, issue the set BAUD 115200 command in order to increase the data transfer rate between the terminal application and the Cisco device. Thus, allowing you to copy the new Cisco IOS image to the Cisco router/switch faster.

Step 6. Similarly, change the Baud rate on the terminal emulator to 115200. Next, disconnect and then connect your terminal program to Cisco IOS CLI.

Step 7. Issue the copy xmodem: command to tell the router/switch the name of the Cisco IOS image to download and where to store it.

In this example, we instruct the switch to copy the file c3560e-universalk9-mz.152-4.E10.bin to flash memory using the copy xmodem:c3560e-universalk9-mz.152-4.E10.bin flash:c3560e-universalk9-mz.152-4.E10.bin statement.

At this step, Cisco IOS displays “Begin the Xmodem or Xmodem-1K transfer now…” and starts waiting for the file transfer to begin.

Step 8. Instruct your terminal software to send the Cisco IOS image file to the router/switch. For example, if you are using Hyper Terminal, in the Transfer menu, click Send file, click Browse to select the file, change the protocol to Xmodem, and then click Send.

Step 9. Once the transfer process finishes, issue the dir flash: command in order to check that the file has been uploaded successfully.

Step 10. Issue the set BAUD 9600 command to set the transfer rate back to 9600.

Step 11. Disconnect, and then reconnect your terminal program to Cisco IOS CLI using the Baud rate of 9600.

Step 12. Issue the set boot command to instruct the Cisco router/switch to load the new IOS image after the next reboot.

Step 13. Enter the reset command and type in “y” to reload the Cisco device.

MD5 Verification for Cisco IOS Image Files

Before you upload a Cisco IOS image file to a router/switch, it is highly recommended to make sure it is not corrupt or damaged. To achieve this, calculate the MD5 hash of the downloaded image file using the certutil -hashfile MD5 command in Windows CMD or PowerShell.

The file is not valid if the resulting hash is not equal to the corresponding MD5 value stated on the Cisco software central.

To generate the MD5 hash for the file c3560e-universalk9-mz.152-4.E10.bin stored in the folder “D:\Cisco\Images\IOS\Switches\”, we need to use the following command:

certutil -hashfile D:\Cisco\Images\IOS\Switches\c3560e-universalk9-mz.152-4.E10.bin MD5

Related Lessons to How To Upgrade Cisco IOS via FTP/TFTP/USB Drive or Console Cable

Conclusion

I hope this blog post helps you learn something.
Now I’d like to turn it over to you:
What did you like about this tutorial?
Or maybe you have an excellent idea that you think I need to add.
Either way, let me know by leaving a comment below right now.

Mohamed Ouamer
Mohamed Ouamer is a computer science teacher and a self-published author. He taught networking technologies and programming for more than fifteen years. While he loves to share knowledge and write, Mohamed's best passions include spending time with his family, visiting his parents, and learning new things.