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.
Environment
- 2x brand new Cisco 9300 switches
- 2x Cisco Data Stacking cable & 2 x Cisco Power stacking cable
- 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
- 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]?
Copy in progress…CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC907450095 bytes copied in 56.333 secs (16108677 bytes/sec
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: 17.03.04.0.5557
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:
/flash/cat9k-wlc.17.03.04.SPA.pkg
/flash/cat9k-webui.17.03.04.SPA.pkg
/flash/cat9k-srdriver.17.03.04.SPA.pkg
/flash/cat9k-sipspa.17.03.04.SPA.pkg
/flash/cat9k-sipbase.17.03.04.SPA.pkg
/flash/cat9k-rpboot.17.03.04.SPA.pkg
/flash/cat9k-rpbase.17.03.04.SPA.pkg
/flash/cat9k-lni.17.03.04.SPA.pkg
/flash/cat9k-guestshell.17.03.04.SPA.pkg
/flash/cat9k-espbase.17.03.04.SPA.pkg
/flash/cat9k-cc_srdriver.17.03.04.SPA.pkg
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
Useful links
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