Connecting the world…

archive

Upgrading Cisco switch stack

I always upgrade a switch stack with one single command. Last week I received a call from a customer with the question about the upgrade procedure for a switch stack. The customer wanted to upload the image separately to every single switch. I told him that he could upgrade all switches at once.

Since I am “playing” with a Cisco switch stack of 9 Catalyst 3750X switches today I will describe the upgrade procedure.

  1. 1. You need to download the correct .tar image file;
  2. 2. Copy it to the root of your FTP or TFTP server;
  3. 3. Upload, extract and install the .tar file to the switches (I always use the /imageonly option, because I don’t need the html files for management);
  4. 4. Reload the switch stack;

The command to upload and extract the .tar file can be found below:

sw-stack#archive download-sw /imageonly /overwrite /allow-feature-upgrade ftp://user:password@<IP address FTP server>/image-file.tar

Loading c3750e-universalk9-tar.122-55.SE1.tar !!!!!!!
[OK – 17745920/4096 bytes]

Loading c3750e-universalk9-tar.122-55.SE1.tar !!!!!!!
examining image…
extracting info (110 bytes)
extracting c3750e-universalk9-mz.122-55.SE1/info (444 bytes)
extracting info (110 bytes)

Stacking Version Number: 1.45

System Type:             0x00000002
Ios Image File Size:   0x00DE8200
Total Image File Size: 0x010ECA00
Minimum Dram required: 0x08000000
Image Suffix:          universalk9-122-55.SE1
Image Directory:       c3750e-universalk9-mz.122-55.SE1
Image Name:            c3750e-universalk9-mz.122-55.SE1.bin
Image Feature:         IP|LAYER_3|PLUS|SSH|3DES|MIN_DRAM_MEG=128

Old image for switch 1: flash:/c3750e-universalk9-mz.122-53.SE2
Old image will be deleted after download.
Old image for switch 2: flash2:/c3750e-universalk9-mz.122-53.SE2
Old image will be deleted after download.
Old image for switch 3: flash3:/c3750e-universalk9-mz.122-53.SE2
Old image will be deleted after download.
Old image for switch 4: flash4:/c3750e-universalk9-mz.122-53.SE2
Old image will be deleted after download.
Old image for switch 5: flash5:/c3750e-universalk9-mz.122-53.SE2
Old image will be deleted after download.
Old image for switch 6: flash6:/c3750e-universalk9-mz.122-53.SE2
Old image will be deleted after download.
Old image for switch 7: flash7:/c3750e-universalk9-mz.122-53.SE2
Old image will be deleted after download.
Old image for switch 8: flash8:/c3750e-universalk9-mz.122-53.SE2
Old image will be deleted after download.
Old image for switch 9: flash9:/c3750e-universalk9-mz.122-53.SE2
Old image will be deleted after download.

Extracting images from archive into flash…
Extracting images from archive into flash on switch 2…
Extracting images from archive into flash on switch 3…
Extracting images from archive into flash on switch 4…
Extracting images from archive into flash on switch 5…
Extracting images from archive into flash on switch 6…
Extracting images from archive into flash on switch 7…
Extracting images from archive into flash on switch 8…
Extracting images from archive into flash on switch 9…

extracting c3750e-universalk9-mz.122-55.SE1/c3750e-universalk9-mz.122-55.SE1.bin (14570585 bytes)
extracting c3750e-universalk9-mz.122-55.SE1/info (444 bytes)
extracting info (110 bytes)

<..>

Installing (renaming): `flash:update/c3750e-universalk9-mz.122-55.SE1′ ->
`flash:/c3750e-universalk9-mz.122-55.SE1′
New software image installed in flash:/c3750e-universalk9-mz.122-55.SE1

<..>

Removing old image: flash:/c3750e-universalk9-mz.122-53.SE2
Removing old image: flash2:/c3750e-universalk9-mz.122-53.SE2
Removing old image: flash3:/c3750e-universalk9-mz.122-53.SE2
Removing old image: flash4:/c3750e-universalk9-mz.122-53.SE2

<..>

All software images installed.

The boot parameters are automatically changed to the new IOS firmware. You can check the boot parameters with the show boot command.

Cisco stack: version mismatch

When adding a new switch to an existing stack, the new switch should have the same software image as the existing stack member switches. If the new switch has different software, the switch isn’t capable of joining the stack.

Switch/Stack Mac Address : 588d.0918.3100
H/W   Current
Switch#  Role   Mac Address     Priority Version  State
———————————————————-
*1       Master 588d.0918.3100     15     1       Ready
2       Member c471.fe99.b580     1      2       Version Mismatch

There are different ways to upgrade the new switch to the correct software image. The hard way is unplugging the new switch from the stack, upgrade the switch separately and add the switch to the stack again. A more easy way is using the archive copy-sw command. This command allows you to copy the software from a specific member switch to the new switch.

The example below copies the software from switch 1 to the destiniation switch 2.

sw-stack#archive copy-sw /destination-system 2 1
System software to be uploaded:
System Type:             0x00000002
archiving c3750e-universalk9-mz.122-53.SE2 (directory)
Stacking Version Number: 1.43

System Type:             0x00000002
Ios Image File Size:   0x00DA7200
Total Image File Size: 0x01076600
Minimum Dram required: 0x08000000
Image Suffix:          universalk9-122-53.SE2
Image Directory:       c3750e-universalk9-mz.122-53.SE2
Image Name:            c3750e-universalk9-mz.122-53.SE2.bin
Image Feature:         IP|LAYER_3|PLUS|SSH|3DES|MIN_DRAM_MEG=128

Old image for switch 2: flash2:/c3750e-universalk9-mz.122-53.SE1
Old image will be deleted after download.

Extracting images from archive into flash on switch 2…

Installing (renaming): `flash2:/update/c3750e-universalk9-mz.122-53.SE2′ –> flash2:/c3750e-universalk9-mz.122-53.SE2′
New software image installed in flash2:/c3750e-universalk9-mz.122-53.SE2
Removing old image: flash2:/c3750e-universalk9-mz.122-53.SE

All software images installed.

sw-stack#reload slot 2

This is by far the easiest way to upgrade the new switch to the correct software image. Another method is using the copy command.

sw-stack#copy image-file.bin flash2:

sw-stack#config t

sw-stack(config)#boot system switch 2 flash:/image-file.bin

sw-stack(config)#exit

sw-stack#wr mem

sw-stack#reload slot 2

This method is very useful if you are using an image without the html web features.

Auto Backup Configurations

Till recently I didn’t have a decent way to backup configurations from routers and switches without using some kind of management tool, like Cacti or Nagios. I wanted to automatically backup configurations by only using a TFTP or FTP server on a network.

I started looking and found the solution by using the archive and kron configurations. I decided to look for methods to backup configurations when one of the following occurrences happen:

  1. Somebody enters the save running-config to startup-config command (write memory);
  2. A certain time of day threshold is reached;

The following example configuration shows both occurrences.

archive
path tftp://192.168.1.100/C2960-01/$h
write-memory

!

kron occurrence SCHEDULE-TO-BACKUP-CONFIG at 20:00 recurring
policy-list BACKUP-CONFIG
!
kron policy-list BACKUP-CONFIG
cli write memory

The configuration above copies the configuration to TFTP server 192.168.1.100 at 20:00h every day. The configuration is also copied to the TFTP server after issuing a write memory. The syntax of the file name on the TFTP server is hostname-seq.number (e.q. SWITCH01-1, the following file would be SWITCH01-2).

I used it several times now and it works great. I use Tftpd32 as TFTP server on Windows, because it is freeware and can be configured as service.