CISCO

1 minute read

Update Cisco switch

1. Install a TFTP server

sudo apt-get install tftp-hpa tftpd-hpa

edit the config :

nano /etc/default/tftpd-hpa
# /etc/default/tftpd-hpa

TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/srv/tftp"
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="--create"
service tftpd-hpa start

ss -lnup | grep tftpd

2. Download the new firmware

Download latest official firmwares

And select your right appliance’s firmware.

:information_source: : please note the MD5 hash

3. Send firmware image to the switch

Put the .bin firmware into the tftp directory :

scp NEW_FIRMWARE.bin USER@IP_TFTP:/srv/tftp/

Now connect to the switch and copy the firmware from the tftp to the flash :

enable
copy tftp: flash:

Address or name of remote host []? 192.168.0.254
Source filename []? /srv/tftp/c2960x-universalk9-mz.152-2.E8.bin
Destination filename [c2960x-universalk9-mz.152-2.E8.bin]?

Accessing tftp://IP_TFTP/NEW_FIRMWARE.bin...
Loading NEW_FIRMWARE.bin from IP_TFTP (via Vlan1): !!!!!!!!!!!!!

Run show flash: to be sure that the firmware is present in the flash directory.

4.Load Firmware

Before any changes, you can check the md5 hash with /md5 flash:NEW_FIRMWARE.bin

See the current Boot parameter :

Switch#show boot
BOOT path-list      : flash:OLD_FIRMWARE.bin
...
...
...

Change the boot image :

configure terminal
boot system flash:NEW_FIRMWARE

You can list files in the flash with the command :

Switch#dir flash:

Verify the new boot parameter with : show boot

Apply with :

Switch#wr mem
Switch#reload

Now the switch is loading the new image.

Eventual fails

If the equipment appears in rommon, please follow the steps in this link to recover the original state.

delete a file in flash:

delete flash:firmware.bin

Exemple

SW-SW03-DC1#delete flash:c2960x-universalk9-mz.152-2.E7.bin
Delete filename [c2960x-universalk9-mz.152-2.E7.bin]? 
Delete flash:/c2960x-universalk9-mz.152-2.E7.bin? [confirm]
SW-SW03-DC1#dir flash:                                     
Directory of flash:/

    2  -rwx         796  Aug 13 2015 13:15:49 +02:00  vlan.dat
    4  -rwx        2072  Jul 31 2018 16:24:24 +02:00  multiple-fs
    5  -rwx        5743  Jul 31 2018 16:24:23 +02:00  config.text
    6  drwx         512  Aug 22 2014 10:54:59 +02:00  c2960x-universalk9-mz.150-2.EX5
  645  drwx         512  Aug 22 2014 10:55:00 +02:00  dc_profile_dir
  648  -rwx        3575  Jul 31 2018 16:24:23 +02:00  private-config.text

122185728 bytes total (98700800 bytes free)
SW-SW03-DC1#

Show ios version

show version

Copy ios to tftp

copy flash:c2960x-universalk9-mz.150-2.EX5/c2960x-universalk9-mz.150-2.EX5.bin tftp://192.168.0.254//srv/tftp/c2960x-universalk9-mz.150-2.EX5.bin

Leave a comment

Leave a comment