Upgrade IOS

From Ever changing code
Jump to navigation Jump to search

Use USB flash

Some Cisco routers and switches have a usb port which can support USB flash disk. Under Windows/Linux you need to format the usb flash to FAT32, on Cisco devices you can use a command below:

format usbflash0:

copy from flash -> usbflash0

copy flash:{ios.bin} usbflash0: 

from usbflash0 -> flash

copy usbflash0:{ios.bin} flash:

Archive

Switch#dir
Directory of flash:/

 509  -rwx        2301   Mar 1 1993 00:24:41 +00:00  config.text
 510  -rwx          24   Mar 1 1993 00:24:41 +00:00  private-config.text
 511  -rwx        2072   Mar 1 1993 00:24:41 +00:00  multiple-fs
 512  -rwx        3584   Mar 1 1993 00:38:49 +00:00  tftp
   2  drwx         512   Mar 1 1993 00:15:19 +00:00  c3750-ipbasek9-mz.122-55.SE7

The command below creates new archive saved.tar including all files and directories in c3750-ipbasek9-mz.122-55.SE7 directory and saves the TAR archive on tftp server.

Switch#archive tar /create tftp://192.168.173.1/saved.tar c3750-ipbasek9-mz.122-55.SE7

Extract

Switch#archive tar /xtract tftp://192.168.173.1/c3750-ipbasek9-tar.122-55.SE5.tar flash1:
Loading c3750-ipbasek9-tar.122-55.SE5.tar from 192.168.173.1 (via Vlan1): !
c3750-ipbasek9-mz.122-55.SE5/ (directory)
< --- output omitted --- >
extracting c3750-ipbasek9-mz.122-55.SE5/c3750-ipbasek9-mz.122-55.SE5.bin (12098310 bytes)!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
extracting c3750-ipbasek9-mz.122-55.SE5/info (681 bytes)
extracting info (106 bytes)
[OK - 15912960 bytes]

Delete

We need sometimes delete old IOS image due to limited space.

Switch#delete /recursive flash1:c3750-ipbasek9-mz.122-55.SE5
Delete filename [c3750-ipbasek9-mz.122-55.SE5]?
Examine files in directory flash:c3750-ipbasek9-mz.122-55.SE5? [confirm]
Delete flash:c3750-ipbasek9-mz.122-55.SE5? [confirm]

Set to boot from new image

Check current boot anchor

Switch#sh boot
BOOT path-list      : flash:/c3750-ipbasek9-mz.122-55.SE7/c3750-ipbasek9-mz.122-55.SE7.bin
Config file         : flash:/config.text
Private Config file : flash:/private-config.text
Enable Break        : no
Manual Boot         : no
HELPER path-list    :
Auto upgrade        : yes
Auto upgrade path   :
NVRAM/Config file
      buffer size:   524288
Timeout for Config
          Download:    0 seconds
Config Download
       via DHCP:       disabled (next boot: disabled)

List directories on flash1:

Switch(config)#do dir
Directory of flash:/

  509  -rwx        2301   Mar 1 1993 00:24:41 +00:00  config.text
  510  -rwx          24   Mar 1 1993 00:24:41 +00:00  private-config.text
  511  -rwx        2072   Mar 1 1993 00:24:41 +00:00  multiple-fs
  512  -rwx        3584   Mar 1 1993 00:38:49 +00:00  tftp
    2  drwx         512   Mar 1 1993 01:32:54 +00:00  c3750-ipbasek9-mz.122-55.SE5
  513  -rwx         106   Mar 1 1993 01:41:19 +00:00  info

27998208 bytes total (11941888 bytes free)

Swith(config)do dir flash1:c3750-ipbasek9-mz.122-55.SE5
Directory of flash:/c3750-ipbasek9-mz.122-55.SE5/

    3  drwx        5632   Mar 1 1993 01:32:54 +00:00  html
  507  -rwx    12098310   Mar 1 1993 01:34:53 +00:00  c3750-ipbasek9-mz.122-55.SE5.bin
  508  -rwx         681   Mar 1 1993 01:41:19 +00:00  info

27998208 bytes total (11941888 bytes free)

Set to boot from another image

boot system switch all flash1:c3750-ipbasek9-mz.122-55.SE5/c3750-ipbasek9-mz.122-55.SE5.bin

Verify new boot image has been anchored

Switch#sh boot
BOOT path-list      : flash1:c3750-ipbasek9-mz.122-55.SE5/c3750-ipbasek9-mz.122-55.SE5.bin
Config file         : flash:/config.text
Private Config file : flash:/private-config.text
Enable Break        : no
Manual Boot         : no
HELPER path-list    :
Auto upgrade        : yes
Auto upgrade path   :
NVRAM/Config file
      buffer size:   524288
Timeout for Config
          Download:    0 seconds
Config Download
       via DHCP:       disabled (next boot: disabled)

Write changes and reload

#wri
#reload

After reboot

Before reboot

Switch#show version
Cisco IOS Software, C3750 Software (C3750-IPBASEK9-M), Version 12.2(55)SE7, RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2013 by Cisco Systems, Inc.
Compiled Mon 28-Jan-13 10:16 by prod_rel_team
Image text-base: 0x01000000, data-base: 0x02D00000

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

Switch uptime is 2 hours, 2 minutes
System returned to ROM by power-on
System image file is "flash:/c3750-ipbasek9-mz.122-55.SE7/c3750-ipbasek9-mz.122-55.SE7.bin"

After reboot

Switch#sh version
Cisco IOS Software, C3750 Software (C3750-IPBASEK9-M), Version 12.2(55)SE5, RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2012 by Cisco Systems, Inc.
Compiled Thu 09-Feb-12 18:59 by prod_rel_team
Image text-base: 0x01000000, data-base: 0x02D00000

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

Switch uptime is 3 minutes
System returned to ROM by power-on
System image file is "flash:/c3750-ipbasek9-mz.122-55.SE5/c3750-ipbasek9-mz.122-55.SE5.bin"

Upgrade all switches in stack

This procedure allows upgrade/downgrade ios image on up to 9 switches connected by stack cable. In the example we use Cisco WS-C3750V2-24PS stack of 8x switches.

Switch(config)#do sh flash

Directory of flash:/

  509  -rwx        1048   Mar 1 1993 00:02:43 +00:00  multiple-fs
    2  drwx         512   Mar 1 1993 00:42:48 +00:00  c3750-ipbasek9-mz.122-55.SE7

27998208 bytes total (11952128 bytes free)
Switch(config)#do show inventory                               Switch#show version
NAME: "1", DESCR: "WS-C3750V2-24PS"                          <---- output omitted ------>       
PID: WS-C3750V2-24PS-S , VID: V08  , SN: FDO1718AAA1         Switch Ports Model              SW Version            SW Image       
NAME: "2", DESCR: "WS-C3750V2-24PS"                          ------ ----- -----              ----------            ----------       
PID: WS-C3750V2-24PS-S , VID: V08  , SN: FDO1718AAA2         *    1 26    WS-C3750V2-24PS    12.2(55)SE7           C3750-IPBASEK9-M       
NAME: "3", DESCR: "WS-C3750V2-24PS"                               2 26    WS-C3750V2-24PS    12.2(55)SE7           C3750-IPBASEK9-M       
PID: WS-C3750V2-24PS-S , VID: V08  , SN: FDO1718AAA3              3 26    WS-C3750V2-24PS    12.2(55)SE7           C3750-IPBASEK9-M       
NAME: "4", DESCR: "WS-C3750V2-24PS"                               4 26    WS-C3750V2-24PS    12.2(55)SE7           C3750-IPBASEK9-M       
PID: WS-C3750V2-24PS-S , VID: V08  , SN: FDO1718AAA4              5 26    WS-C3750V2-24PS    12.2(55)SE7           C3750-IPBASEK9-M       
NAME: "5", DESCR: "WS-C3750V2-24PS"                               6 26    WS-C3750V2-24PS    12.2(55)SE7           C3750-IPBASEK9-M
PID: WS-C3750V2-24PS-S , VID: V08  , SN: FDO1726AAA5              7 26    WS-C3750V2-24PS    12.2(55)SE7           C3750-IPBASEK9-M
NAME: "6", DESCR: "WS-C3750V2-24PS"                               8 26    WS-C3750V2-24PS    12.2(55)SE7           C3750-IPBASEK9-M
PID: WS-C3750V2-24PS-S , VID: V08  , SN: FDO1718AAA6
NAME: "7", DESCR: "WS-C3750V2-24PS"
PID: WS-C3750V2-24PS-S , VID: V08  , SN: FDO1718AAA7
NAME: "8", DESCR: "WS-C3750V2-24PS"
PID: WS-C3750V2-24PS-S , VID: V08  , SN: FDO1718AAA8
Outline procedure
en
archive download-sw /imageonly  tftp://192.168.0.2/c3750-ipbasek9-tar.122-50.SE4.tar
show boot
wri
reload

Below are detailed steps

Configure switch interface

Switch(config)#interface vlan 1
Switch(config-if)#ip add 10.0.99.100 255.255.255.128

You can manually delete image but this need to be done on per switch basis. It is no required as the upgrade command will take care of it if there is not enough space on a flash card.

Switch#delete /force /recursive flash:c3750-ipbasek9-mz.122-55.SE7

Download image

Start TFTP server on your laptop. Connect your laptop configured as static ip address i.e 10.0.99.1 255.255.255.128 to any of a master switch ports. Then issue the command below. This process can take up to 30 min as image is downloaded to each switch separately and applied on one by one basis. Once process finish the switch will reload itself.

Switch#archive download-sw /imageonly tftp://10.0.99.2/c3750-ipbasek9-tar.122-55.SE5.tar
Loading c3750-ipbasek9-tar.122-55.SE5.tar from 10.0.99.2 (via Vlan1): !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[OK - 15912960 bytes]

Loading c3750-ipbasek9-tar.122-55.SE5.tar from 10.0.99.2 (via Vlan1): !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
examining image...
extracting info (106 bytes)
extracting c3750-ipbasek9-mz.122-55.SE5/info (681 bytes)
extracting info (106 bytes)

Stacking Version Number: 1.45

System Type:             0x00000000
  Ios Image File Size:   0x00B8B200
  Total Image File Size: 0x00F2D200
  Minimum Dram required: 0x08000000
  Image Suffix:          ipbasek9-122-55.SE5
  Image Directory:       c3750-ipbasek9-mz.122-55.SE5
  Image Name:            c3750-ipbasek9-mz.122-55.SE5.bin
  Image Feature:         IP|LAYER_3|SSH|3DES|MIN_DRAM_MEG=128

Old image for switch 1: unknown
Old image for switch 2: flash2:/c3750-ipbasek9-mz.122-55.SE7
  Old image will be deleted before download.
Old image for switch 3: flash3:/c3750-ipbasek9-mz.122-55.SE7
  Old image will be deleted before download.
Old image for switch 4: flash4:/c3750-ipbasek9-mz.122-55.SE7
  Old image will be deleted before download.
Old image for switch 5: flash5:/c3750-ipbasek9-mz.122-55.SE7
  Old image will be deleted before download.
Old image for switch 6: flash6:/c3750-ipbasek9-mz.122-55.SE7
  Old image will be deleted before download.
Old image for switch 7: flash7:/c3750-ipbasek9-mz.122-55.SE7
  Old image will be deleted before download.
Old image for switch 8: flash8:/c3750-ipbasek9-mz.122-55.SE7
  Old image will be deleted before download.

Deleting `flash2:/c3750-ipbasek9-mz.122-55.SE7' to create required space
Deleting `flash3:/c3750-ipbasek9-mz.122-55.SE7' to create required space
Deleting `flash4:/c3750-ipbasek9-mz.122-55.SE7' to create required space
Deleting `flash5:/c3750-ipbasek9-mz.122-55.SE7' to create required space
Deleting `flash6:/c3750-ipbasek9-mz.122-55.SE7' to create required space
Deleting `flash7:/c3750-ipbasek9-mz.122-55.SE7' to create required space
Deleting `flash8:/c3750-ipbasek9-mz.122-55.SE7' to create required space

extracting c3750-ipbasek9-mz.122-55.SE5/c3750-ipbasek9-mz.122-55.SE5.bin (12098310 bytes)
extracting c3750-ipbasek9-mz.122-55.SE5/info (681 bytes)
extracting info (106 bytes)

extracting c3750-ipbasek9-mz.122-55.SE5/c3750-ipbasek9-mz.122-55.SE5.bin (12098310 bytes)
extracting c3750-ipbasek9-mz.122-55.SE5/info (681 bytes)
extracting info (106 bytes)

extracting c3750-ipbasek9-mz.122-55.SE5/c3750-ipbasek9-mz.122-55.SE5.bin (12098310 bytes)
extracting c3750-ipbasek9-mz.122-55.SE5/info (681 bytes)
extracting info (106 bytes)

extracting c3750-ipbasek9-mz.122-55.SE5/c3750-ipbasek9-mz.122-55.SE5.bin (12098310 bytes)
extracting c3750-ipbasek9-mz.122-55.SE5/info (681 bytes)
extracting info (106 bytes)

extracting c3750-ipbasek9-mz.122-55.SE5/c3750-ipbasek9-mz.122-55.SE5.bin (12098310 bytes)
extracting c3750-ipbasek9-mz.122-55.SE5/info (681 bytes)
extracting info (106 bytes)

extracting c3750-ipbasek9-mz.122-55.SE5/c3750-ipbasek9-mz.122-55.SE5.bin (12098310 bytes)
extracting c3750-ipbasek9-mz.122-55.SE5/info (681 bytes)
extracting info (106 bytes)

extracting c3750-ipbasek9-mz.122-55.SE5/c3750-ipbasek9-mz.122-55.SE5.bin (12098310 bytes)
extracting c3750-ipbasek9-mz.122-55.SE5/info (681 bytes)
extracting info (106 bytes)

extracting c3750-ipbasek9-mz.122-55.SE5/c3750-ipbasek9-mz.122-55.SE5.bin (12098310 bytes)
extracting c3750-ipbasek9-mz.122-55.SE5/info (681 bytes)
extracting info (106 bytes)
Installing (renaming): `flash:update/c3750-ipbasek9-mz.122-55.SE5' ->
                                       `flash:/c3750-ipbasek9-mz.122-55.SE5'
New software image installed in flash:/c3750-ipbasek9-mz.122-55.SE5

Installing (renaming): `flash2:/update/c3750-ipbasek9-mz.122-55.SE5' ->
                                       `flash2:/c3750-ipbasek9-mz.122-55.SE5'
New software image installed in flash2:/c3750-ipbasek9-mz.122-55.SE5

Installing (renaming): `flash3:/update/c3750-ipbasek9-mz.122-55.SE5' ->
                                       `flash3:/c3750-ipbasek9-mz.122-55.SE5'
New software image installed in flash3:/c3750-ipbasek9-mz.122-55.SE5

Installing (renaming): `flash4:/update/c3750-ipbasek9-mz.122-55.SE5' ->
                                       `flash4:/c3750-ipbasek9-mz.122-55.SE5'
New software image installed in flash4:/c3750-ipbasek9-mz.122-55.SE5

Installing (renaming): `flash5:/update/c3750-ipbasek9-mz.122-55.SE5' ->
                                       `flash5:/c3750-ipbasek9-mz.122-55.SE5'
New software image installed in flash5:/c3750-ipbasek9-mz.122-55.SE5

Installing (renaming): `flash6:/update/c3750-ipbasek9-mz.122-55.SE5' ->
                                       `flash6:/c3750-ipbasek9-mz.122-55.SE5'
New software image installed in flash6:/c3750-ipbasek9-mz.122-55.SE5

Installing (renaming): `flash7:/update/c3750-ipbasek9-mz.122-55.SE5' ->
                                       `flash7:/c3750-ipbasek9-mz.122-55.SE5'
New software image installed in flash7:/c3750-ipbasek9-mz.122-55.SE5

Installing (renaming): `flash8:/update/c3750-ipbasek9-mz.122-55.SE5' ->
                                       `flash8:/c3750-ipbasek9-mz.122-55.SE5'
New software image installed in flash8:/c3750-ipbasek9-mz.122-55.SE5


All software images installed.
Verify
Switch#sh flash?
flash1:  flash2:  flash3:  flash4:
flash5:  flash6:  flash7:  flash8:
flash:

Switch#sh flash1

Directory of flash:/

  509  -rwx        1048   Mar 1 1993 00:02:43 +00:00  multiple-fs
    3  drwx         512   Mar 1 1993 01:11:02 +00:00  c3750-ipbasek9-mz.122-55.SE5

27998208 bytes total (15796736 bytes free)
Switch#sh flash2?
flash2:

Switch#sh flash2:

Directory of flash2:/

  509  -rwx        1048   Mar 1 1993 00:02:48 +00:00  multiple-fs
    2  drwx         512   Mar 1 1993 01:11:02 +00:00  c3750-ipbasek9-mz.122-55.SE5

27998208 bytes total (15796736 bytes free)

Save configuration

Switch#write mem
Building configuration...
[OK]

Reload

#reload

WS-C4503-E 3 slot switch with IOS-XE

Switch#sh version
Cisco IOS Software, IOS-XE Software, Catalyst 4500 L3 Switch Software (cat4500e-UNIVERSALK9-M), Version 03.03.00.SG RELEASE SOFTWARE (fc3)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2012 by Cisco Systems, Inc.
Compiled Sun 15-Apr-12 08:06 by prod_rel_team

ROM: 15.0(1r)SG5
Switch uptime is 10 minutes
System returned to ROM by power-on
Running default software
Jawa Revision 7, Snowtrooper Revision 0x0.0x1C

<-- output omitted -->

License Information for 'WS-X45-SUP7-E'
    License Level: lanbase   Type: Default. No valid license found.
    Next reboot license Level: lanbase

cisco WS-C4503-E (MPC8572) processor (revision 10) with 2097152K/20480K bytes of memory.
Processor board ID SPE1645AAA1
MPC8572 CPU at 1.5GHz, Supervisor 7
Last reset from PowerUp
1 Virtual Ethernet interface
60 Gigabit Ethernet interfaces
4 Ten Gigabit Ethernet interfaces
511K bytes of non-volatile configuration memory.

Configuration register is 0x2101

Modular switch does not have flash: instead it has cat4000_flash: where a system image is stored. This is the main difference when upgrading/downgrading Catalyst modular switches.

Switch#dir ?
  /all             List all files
  /recursive       List files recursively
  all-filesystems  List files on all filesystems
  bootflash:       Directory or file name
  cat4000_flash:   Directory or file name
  cns:             Directory or file name
  crashinfo:       Directory or file name
  kinfo:           Directory or file name
  null:            Directory or file name
  nvram:           Directory or file name
  slot0:           Directory or file name
  system:          Directory or file name
  tar:             Directory or file name
  tmpsys:          Directory or file name
  usb0:            Directory or file name
  |                Output modifiers
  <cr>
Switch#dir cat4000_flash:
Directory of cat4000_flash:/

    1  -rw-         556                    <no date>  vlan.dat

524284 bytes total (523728 bytes free)
Switch#dir /all
Directory of bootflash:/

14563  -rwx   115624136  Feb 25 2013 07:35:48 +00:00  cat4500e-universalk9.SPA.03.03.00.SG.151-1.SG.bin

820875264 bytes total (705028096 bytes free)

Backing up image on tftp server. This can be easy reversed to copy a new image from the tftp server but because the already image is the newest it will stay loaded and it does not require upgrade.

Switch#copy bootflash:cat4500e-universalk9.SPA.03.03.00.SG.151-1.SG.bin tftp
Switch#$bin tftp://10.0.0.2/cat4500e-universalk9.SPA.03.03.00.SG.151-1.SG.bin
Address or name of remote host [10.0.0.2]?
Destination filename [cat4500e-universalk9.SPA.03.03.00.SG.151-1.SG.bin]?
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
115624136 bytes copied in 332.184 secs (348073 bytes/sec)
Switch#
Verification md5 checksum
Switch#verify /md5 bootflash:cat4500e-universalk9.SPA.03.03.00.SG.151-1.SG.bin
...................................................................................................Done!
verify /md5 (bootflash:cat4500e-universalk9.SPA.03.03.00.SG.151-1.SG.bin) = b836a6c34b9d42695b4c1a9c960e6897

Find MD5 hash on Cisco website

Transferring images over TFTP and also other protocols it can get easy corrupted. Therefore it is important to verify whether the file has kept its integrity during the transfer. The most reliable source to look up for MD5 hashes is Cisco download website

http://software.cisco.com/download/navigator.html
Open Cisco Download Centre
Select Cisco IOS version
Serch for your platform
Select IOS Software link
Find Cisco IOS MD5 checksum