IOS upgrade via FTP (Cisco)

Design & Configure

IOS upgrade via FTP (Cisco)

Technology: Setup
Area: Setup
Vendor: Cisco
Software: 12.X , 15.X, IP Base, IP Services, LAN Base, LAN Light
Platform: Catalyst 2960-X, Catalyst 3560

The firmware is a program which controls the operation and functionality of the switch. This is a mixture of software and hardware that has program code and data stored in it for the computer to operate. Firmware upgrade boost the performance of the system, which could include improved security, new functionality, and bug fixes. At the beginning we will deal with the basic upgrade of a single switch, and finally the stack upgrade will be discussed.

Single switch upgrade

Before upgrade Cisco IOS you must check current device model, amount of flash memory, RAM memory available and bootvar configuration settings using show version command. As it was in the general IOS image upgrade procedure.

Example:

Switch#sh version
Cisco IOS Software, C3750 Software (C3750-IPSERVICESK9-M), Version 12.2(55)SE12, RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2017 by Cisco Systems, Inc.
Compiled Thu 28-Sep-17 02:29 by prod_rel_team
Image text-base: 0x01000000, data-base: 0x02F00000

ROM: Bootstrap program is C3750 boot loader
BOOTLDR: C3750 Boot Loader (C3750-HBOOT-M) Version 12.2(44)SE5, RELEASE SOFTWARE (fc1)

Switch uptime is 6 weeks, 1 day, 17 hours, 13 minutes
System returned to ROM by power-on
System restarted at 18:23:52 CET Wed Mar 11 2020
System image file is "flash:c3750-ipservicesk9-mz.122-55.SE12.bin"

It is highly recommended to perform this check of parameters as a prerequisite to every upgrade. Choosing new IOS pay attention to resources and feature set that are needed in order to use new image. Current and future version image features are included in Cisco IOS software name (c3750-ipservicesk9-mz.122-55.SE12.bin).

In comparison to TFTP, FTP supports authentication, and you will need to provide a valid FTP server username and password.

In order to use FTP transfers the following steps are required:

  1. As we mentioned before you have to provide the username and password that were already created on the FTP server. To do this, create an username and password by using  the ip ftp username [username] and ip ftp password [password].
  2. Use the copy ftp flash command and follow the wizard.
  3. Configure the switch to load the new IOS version.

 

Step 1:

Switch#configure terminal
Switch(config)#ip ftp username User
Switch(config)#ip ftp password Password
Switch(config)#end

 

Step 2:

Switch#copy ftp flash
Address or name of remote host []? x.x.x.x
Source filename []? c3750-ipservicesk9-mz.122-55.SE12.bin
Destination filename [c3750-ipservicesk9-mz.122-55.SE12.bin]?

Accessing ftp://x.x.x.x/c3750-ipservicesk9-mz.122-55.SE12.bin...
[OK - 13013140 bytes]

13013140 bytes copied in 11.04 secs (1183012 bytes/sec)

Now let’s verify if the file have been correctly transferred using show flash: command.

Router#show flash:
Directory of flash:/
2 -rwx 1932 Mar 23 2020 14:15:48 +01:00 some-config.text
3 -rwx 11364 Mar 23 2020 14:15:48 +01:00 config.text
4 -rwx 1936 Mar 2 2020 01:01:26 +01:00 vlan.dat
6 -rwx 13013140 Mar 2 2020 02:15:34 +01:00 c3750-ipservicesk9-mz.122-55.SE12.bin
7 -rwx 3096 Mar 23 2020 14:15:48 +01:00 multiple-fs
15998976 bytes total (2964992 bytes free)

 

Step 3:

The last step is to configure the switch to load the new version of IOS. We have to do this, because otherwise the old version of IOS would be loaded.

Switch(config)#boot system c3750-ipservicesk9-mz.122-55.SE12.bin

Finally, we have to save the configuration using the write memory command and restart the device using the reboot command. We can verify that the newer version of IOS is being used.

Switch#write memory
Switch#reload

We can also send the file to the other side for backup in the following way:

Switch#copy startup-config ftp
Address or name of remote host []? x.x.x.x
Destination filename [Switch-confg]?
Writing startup-config...
[OK - 2137 bytes]
2137 bytes copied in 0.07 secs (22000 bytes/sec)
64317364 bytes total (53027856 bytes free)

 

Cisco stack upgrade via FTP

We can disinguish two main methods to upgrade the IOS:

  1. Using  TAR image
  2. Using BIN image

TAR image

The TAR file is an archive file from which you can extract both the IOS image and the CMS files during the upgrade process. It is the only needed file if you want to manage switches or cluster of switches through a web interface.

Step 1:

Issue the show flash: command  mentioned above to verify the amount of free memory – it must be sufficient to upgrade.

Step 2:

Issue the archive download-sw command.

Switch#archive download-sw ?
/allow-feature-upgrade Allow installation of image with different feature sets
/directory Specify a directory for images
/force-reload Unconditionally reload system after successful sw upgrade
/force-ucode-reload Upgrade UCODE after successful sw upgrade and before an unconditional reload
/imageonly Load only the IOS image(s)
/leave-old-sw Leave old sw installed after successful sw upgrade
/no-set-boot Don't set BOOT -- leave existing boot config alone
/no-version-check skip version check that prevents incompatible image install
/overwrite OK to overwrite an existing image
/reload Reload system (if no unsaved config changes) after successful sw upgrade
/safe Always load before deleting old version
/upgrade-ucode Upgrade UCODE after successful sw upgrade (no reload)
flash1: Image file
flash: Image file
ftp: Image file
http: Image file
https: Image file
rcp: Image file
scp: Image file
tftp: Image file

 

There are number of options, but in this particular case we are interested in upgrade the IOS via FTP, so we need to  create an username and password by using the ip ftp username [username] and ip ftp password [password].

Switch#configure terminal
Switch(config)#ip ftp username User
Switch(config)#ip ftp password Password
Switch(config)#end

Then we execute the command archive download-sw /leave-old-sw ftp://x.x.x.x/c3750-ipservicesk9-mz.122-55.SE12.tar.

Switch#archive download-sw /leave-old-sw ftp://x.x.x.x/c3750-ipservicesk9-mz.122-55.SE12.tar

Installation will be done as many times as there are switches in the stack. In the end you will obtain an output: “All software images installed.”

 

Step 3:

Using show boot command, you can verify if the new image is now the image in the BOOT path-list that will load at the next switch reload.

Switch#show boot

 

Step 4:

Use the reload command at the prompt and confirm to begin reloading. The new code revision will come up and start running as planned on all the switches in the stack.

Switch#write memory
Switch#reload

 

BIN image

Step 1:

Issue the show flash: command  mentioned above to verify the amount of free memory – it must be sufficient to upgrade.

 

Step 2:

Copy the bin image to the flash of each switch. For example there are two switches in the stack:

copy ftp: flash1:
copy ftp: flash2:

 

Step 3:

The next step is to configure the switch to load the new version of IOS. We have to do this, because otherwise the old version of IOS would be loaded.

Switch(config)#boot system switch all flash:/ c3750-ipservicesk9-mz.122-55.SE12.bin

 

Step 4:

Save and reload device.

Switch#write memory
Switch#reload

 

Note that if you don’t upgrade the IOS on every switch, you will have a version mismatch. It can be easily solved using the command archive copy-sw /force-reload /overwrite /dest 2 1 as suggested by the local log. You can verify if all the switches are ready using show switch command.

Switch#show switch
Switch#show log | i IMAGEMGR
Switch#archive copy-sw /force-reload /overwrite /dest 2 1

Author: Karol Piatek
 
PreviousNext

Cisco Catalyst Switches Offer


Up to 60% discount for Cisco
Catalyst switches portfolio.
Get quote for C9200 | C9300
C9400 | C9500 | C3850 family

 

Newsletter