How to Stack Cisco Switch and Upgrade IOS

Instead of reading Cisco’s lengthy document for switch stacking and IOS XE upgrade procedure, this tutorial explains the simple steps to stack two Cisco L2/L3 switches and upgrade the IOS afterward, this is one of the most common tasks for ICT networking professionals.


  1. 2x brand new Cisco 9300 switches
  2. 2x Cisco Data Stacking cable & 2 x Cisco Power stacking cable
  3. both types of cables are cross-connected and secured prior to powering up

Stacking Priority

By default, two switches will elect an active switch and the other one will be on standby based MAC address, it will like below, please be aware the priority are both on value “1”

Switch#sh switch
Switch/Stack MacAddress: 28af.0000.0000 – Local Mac Address
Mac persistency wait time: Indefinite
H/W Current

Switch# Role Mac Address Priority Version State

*1 Active 28af.0000.0000 1 V05 Ready
2 Standby 28af.0000.0001 1 V05 Ready

To change priority on the active member, simply go to the active member and run below:

Switch#switch 1 priority 15

then you check the switch stacking status:

Switch#sh switch
Switch/Stack Mac Address : 28af.0000.0000 – Local Mac Address
Mac persistency wait time: Indefinite
H/W Current

Switch# Role Mac Address Priority Version State

*1 Active 28af.0000.0000 15 V05 Ready
2 Standby 28af.0000.0001 1 V05 Ready

Upgrade the IOS XE Software

  1. download the IOS XE from Cisco, make sure you choose the recommanded version, normaly it will be highlighted with a star icon like below, download and copy to a USB drive

2. check the USB drive to make sure it got the needed IOS

Switch#dir us –> You can press Tab to find the name of the mounted USB drive
Switch#dir usbflash0:
Directory of usbflash0:/

279 -rwx 326265158 Oct 20 2021 13:48:02 +00:00 junos-arm-32-18.2R3-S6.5.tgz
278 -rwx 907450095 Oct 14 2021 14:40:34 +00:00 cat9k_iosxe.17.03.04.SPA.bin

3. Copy the bin file into the main flash directory via command:

Switch#copy usbflash0:/cat9k_iosxe.17.03.04.SPA.bin flash:/
Destination filename [cat9k_iosxe.17.03.04.SPA.bin]?

4. install the IOS XE file

Switch#install add file flash:cat9k_iosxe.17.03.04.SPA.bin
install_add: START Wed Nov 10 02:46:26 UTC 2021

*Nov 10 02:46:27.141: %INSTALL-5-INSTALL_START_INFO: Switch 1 R0/0: install_engine: Started install add flash:cat9k_iosxe.17.03.04.SPA.bininstall_add: Adding PACKAGE
install_add: Checking whether new add is allowed ….

— Starting initial file syncing —
[1]: Copying flash:cat9k_iosxe.17.03.04.SPA.bin from switch 1 to switch 2
[2]: Finished copying to switch 2
Info: Finished copying flash:cat9k_iosxe.17.03.04.SPA.bin to the selected switch(es)
Finished initial file syncing

— Starting Add —
Performing Add on all members
[1] Add package(s) on switch 1
[1] Finished Add on switch 1
[2] Add package(s) on switch 2
[2] Finished Add on switch 2
Checking status of Add on [1 2]
Add: Passed on [1 2]
Finished Add

Image added. Version:
SUCCESS: install_add Wed Nov 10 02:49:59 UTC 2021

5. activate the IOS, please keep eye on the process and it will time out if you don’t choose to reload the switch stack:

Switch#install activate
install_activate: START Wed Nov 10 02:55:57 UTC 2021

System configuration has been modified.
Press Yes(y) to save the configuration and proceed.
Press No(n) for proceeding without saving the configuration.
Press Quit(q) to exit, you may save configuration and re-enter the command. [y/n/q]yBuilding configuration…

[OK]Modified configuration has been saved
install_activate: Activating PACKAGE

*Nov 10 02:56:17.605: %INSTALL-5-INSTALL_START_INFO: Switch 1 R0/0: install_engine: Started install activateFollowing packages shall be activated:

This operation may require a reload of the system. Do you want to proceed? [y/n]y

6. When you are happy with the new firmware, go ahead with “install commit” to let the switch know you are going ahead with the new IOS. If you forget this step, the switch will roll back its old IOS version, considering this is a fallback option.

Switch#install commit

7. (optional) To remove the old IOS packages, run the command below

Switch#install remove inactive

Note: There are loads of advanced options you can do for IOS upgrades, such as TFTP, StackWise virtual, ISSU upgrades, etc. Please check the below link for more details

Leave a Comment

Your email address will not be published. Required fields are marked *