Difference between revisions of "Updating IOS On Cisco Switch or Router"

From 24PinTech Wiki
Jump to navigation Jump to search
(Everything)
(Everything pt.2)
Line 1: Line 1:
Exact command entries written in <code>{This format}</code>
Exact command entries written in <code>{This format}</code>


== '''Updating an IOS on a Cisco Switch/Router using TFTP''' ==
=='''Updating an IOS on a Cisco Switch/Router using TFTP'''==


# Install [https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html PuTTy] or a similar Telnet application to be able to access the Switch/Router (S/R) through an ethernet connection.
#Install [https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html PuTTy] or a similar Telnet application to be able to access the Switch/Router (S/R) through an ethernet connection.
# Install [https://www.solarwinds.com/free-tools/free-tftp-server SolarWinds TFTP server] or similar TFTP application to be able to send the IOS image to the S/R.
#Install [https://www.solarwinds.com/free-tools/free-tftp-server SolarWinds TFTP server] or similar TFTP application to be able to send the IOS image to the S/R.
# Configure TFTP with the correct IP address (192.168.0.0/24) and change your computer’s ethernet interface adapter the right address range. (Verify the adapter appears in TFTP)[[File:Step 3a.png|center|thumb|IP configuration for the TFTP server.]][[File:Step 3b.png|center|thumb|IP configuration for the PC interface.]]
#Configure TFTP with the correct IP address (192.168.0.0/24) and change your computer’s ethernet interface adapter the right address range. (Verify the adapter appears in TFTP)[[File:Step 3a.png|center|thumb|IP configuration for the TFTP server.]][[File:Step 3b.png|center|thumb|IP configuration for the PC interface.]]
# Ensure that the correct IOS images are installed on your computer in the designated TFTP folder. (IOS images will have different names from the one pictured below.)[[File:Step 4.png|center|thumb|Verification of IOS Images (May be ''DIFFERENT'' depending on when you are updating.)]]
#Ensure that the correct IOS images are installed on your computer in the designated TFTP folder. (IOS images will have different names from the one pictured below.)[[File:Step 4.png|center|thumb|Verification of IOS Images (May be ''DIFFERENT'' depending on when you are updating.)]]
# Use a computer with a serial cable or similar console connection (COM1) in order to connect to the console port on the S/R.[[File:Step 5.png|center|thumb|COM1 Connection using Tera Term (Serial).]]
#Use a computer with a serial cable or similar console connection (COM1) in order to connect to the console port on the S/R.[[File:Step 5.png|center|thumb|COM1 Connection using Tera Term (Serial).]]
# Enter privileged executive mode and verify the ''Flash:'' filesystem has enough space for the new image. [[File:Step 6.png|center|thumb|Verify ''Flash:'' directory size and current IOS while In privileged executive.]]
#Enter privileged executive mode and verify the ''Flash:'' filesystem has enough space for the new image. <big><code>{#show flash:}</code></big> [[File:Step 6.png|center|thumb|Verify ''Flash:'' directory size and current IOS while In privileged executive.]]
# Configure the S/R as follows:
#Configure the S/R as follows:
#* Enter configuration terminal mode.
#*Enter configuration terminal mode.
#* Configure the console and vty lines (0 4) for remote access to the S/R. (Use password ''Cisco'' to make things easy.)[[File:Step 7a-b.png|center|thumb|Line console and vty 0 4 configurations.]]
#*Configure the console and vty lines (0 4) for remote access to the S/R. (Use password ''Cisco'' to make things easy.)  
#* Configure the appropriate IP on the VLAN1/Interface (192.168.0.0/24 Network).
#*<big><code>{#config t --> (c)#line con 0 --> (c-line)#password cisco --> (c-line)#login --> (c-line)#logging syn -->      (c-line)#line vty 0 4 --> (c-line)#password cisco --> (c-line)#login --> (c-line)#logging syn}</code></big>[[File:Step 7a-b.png|center|thumb|Line console and vty 0 4 configurations.]]
#* Exit back to privileged executive mode.[[File:Step 7c-d.png|center|thumb|IP address configuration on a switch (Will be an ''INTERFACE'' on a router).]]
#*Configure the appropriate IP on the VLAN1/Interface (192.168.0.0/24 Network).
#* Clear the ''Flash:'' filesystem (This takes several minutes and it might seem frozen at first, it is working, I promise.)
#*Exit back to privileged executive mode. <big><code>{(c)#int vlan 1 --> (c-if)#ip address 192.168.0.2 255.255.255.0 --> (c-if)#no shut    --> (c-if)#end}</code></big>[[File:Step 7c-d.png|center|thumb|IP address configuration on a switch (Will be an ''INTERFACE'' on a router).]]
#* [[File:Step 7e.png|center|thumb|Erasure of ''Flash:'' filesystem.]]
#*Clear the ''Flash:'' filesystem (This takes several minutes and it might seem frozen at first, it is working, I promise.) <big><code>{#erase flash:}</code></big>[[File:Step 7e.png|center|thumb|Erasure of ''Flash:'' filesystem.]]
# Use a telnet connection over ethernet on your computer to connect to the address configured on the S/R.[[File:Step 8.png|center|thumb|IP connection to the S/R using Tera Term (Telnet).]]
#Use a telnet connection over ethernet on your computer to connect to the address configured on the S/R.[[File:Step 8.png|center|thumb|IP connection to the S/R using Tera Term (Telnet).]]
# Start the TFTP server.[[File:Step 9.png|center|thumb|A running TFTP server.]]
#Start the TFTP server.[[File:Step 9.png|center|thumb|A running TFTP server.]]
# Enter commands to send a TFTP file over the connection. (Using the computer address as the source. The filename of the IOS must also be EXACT.)
#Enter commands to send a TFTP file over the connection. (Using the computer address as the source. The filename of the IOS must also be EXACT.) <big><code>{#copy tftp flash --> host []? 192.168.0.1 --> S filename []? c3750-ipservicesk9-mz.122-55.SE9.bin --> D filename []? (Just hit enter)}</code></big>[[File:Step 10.png|center|thumb|Commands used to copy 3750 IOS to a switch.]]
# After the install has finished verify the file is now on the S/R.
#After the install has finished verify the file is now on the S/R. <big><code>{#show flash:}</code></big>[[File:Step 11.png|center|thumb|Verification of correct image in ''Flash:'' filesystem.]]
# Reload the S/R and do not save the configuration.
#Reload the S/R and do not save the configuration. <big><code>{#reload}</code></big>[[File:Step 12.png|center|thumb|Reloading S/R without saving.]]
# Wait for the reboot and verify that the S/R is a blank configuration with the correct IOS installed in ''Flash:''.
#Wait for the reboot and verify that the S/R is a blank configuration with the correct IOS installed in ''Flash:''.


== '''Updating an IOS on a Cisco Switch/Router Using HyperTerminal''' ==
=='''Updating an IOS on a Cisco Switch/Router Using HyperTerminal'''==
ROMMON COMMANDS ARE DIFFERENT FROM REGULAR CLI FOR S/R. CHECK YOUR SYNTAX.
ROMMON COMMANDS ARE DIFFERENT FROM REGULAR CLI FOR S/R. CHECK YOUR SYNTAX.


# So you’re the [https://www.merriam-webster.com/dictionary/idiot idiot] that reloaded an S/R without an IOS on the flash and it only boots into ROMMON? (i.e. switch: )
#So you’re the [https://www.merriam-webster.com/dictionary/idiot idiot] that reloaded an S/R without an IOS on the flash and it only boots into ROMMON? (i.e. switch: )
# Install HyperTerminal using a Windows XP disc. (Find instructions on how [https://www.instructables.com/Port-Hyperterminal-to-Windows-7/ here].)
#Install HyperTerminal using a Windows XP disc. (Find instructions on how [https://www.instructables.com/Port-Hyperterminal-to-Windows-7/ here].)
# Connect to the S/R using a console connection over COM1 (Run the .exe file to access HyperTerminal (HT). It may ask for a phone number, you do not need one.) (BAUD rate may also be an issue. The usual default is 9600 bits/sec. If the connection is not working try matching the default BAUD rate of the S/R and then use [https://www.cisco.com/c/en/us/support/docs/routers/10000-series-routers/50421-config-register-use.html CONFREG] command to change the rate (Higher rates may run into problems).)
#Connect to the S/R using a console connection over COM1 (Run the .exe file to access HyperTerminal (HT). BAUD rate may also be an issue. The usual default is 9600 bits/sec. If the connection is not working try matching the default BAUD rate of the S/R and, if you want it to be ''faster,'' then use [https://www.cisco.com/c/en/us/support/docs/routers/10000-series-routers/50421-config-register-use.html CONFREG] command to change the rate (Higher rates may run into problems).)[[File:Step H3.png|center|thumb|Connecting using HyperTerminal using COM1 (Serial).]]
# Check the ''Flash:'' filesystem to verify it can fit the new IOS.
#Check the ''Flash:'' filesystem to verify it can fit the new IOS. <big><code>{dir flash:}</code></big>[[File:Step H4.png|center|thumb|Checking size of ''Flash:'' using {dir flash:} command.]]
# Use copy xmodem: flash:FILENAME command to copy the IOS from the computer.
#Use {copy xmodem: flash:FILENAME} command to copy the IOS from the computer. <big><code>{copy xmodem: flash:c3750-ipservicesk9-mz.122-55.SE9.bin}</code></big>[[File:Step H5.png|center|thumb|Copying IOS using {copy xmodem: flash:*} command.]]
# Click the transfer button and then send file while the previous command is still running to send the file (Use xmodem or xmodem-1K)
#Click the transfer button and then send file while the previous command is still running to send the file (Use xmodem or xmodem-1K) [[File:Step H6.png|center|thumb|Sending the exact file path using 1K Xmodem.]]
# Once the install has finished verify the IOS has been installed to the ''Flash:'' filesystem.
#Once the install has finished verify the IOS has been installed to the ''Flash:'' filesystem. <code><big>{Dir flash:}</big></code>
# Reset the switch and then verify the correct IOS is installed once more.
#Reset the switch and then verify the correct IOS is installed once more. <big><code>{Reset}</code></big>

Revision as of 17:05, 23 February 2021

Exact command entries written in {This format}

Updating an IOS on a Cisco Switch/Router using TFTP

  1. Install PuTTy or a similar Telnet application to be able to access the Switch/Router (S/R) through an ethernet connection.
  2. Install SolarWinds TFTP server or similar TFTP application to be able to send the IOS image to the S/R.
  3. Configure TFTP with the correct IP address (192.168.0.0/24) and change your computer’s ethernet interface adapter the right address range. (Verify the adapter appears in TFTP)
    IP configuration for the TFTP server.
    IP configuration for the PC interface.
  4. Ensure that the correct IOS images are installed on your computer in the designated TFTP folder. (IOS images will have different names from the one pictured below.)
    Verification of IOS Images (May be DIFFERENT depending on when you are updating.)
  5. Use a computer with a serial cable or similar console connection (COM1) in order to connect to the console port on the S/R.
    COM1 Connection using Tera Term (Serial).
  6. Enter privileged executive mode and verify the Flash: filesystem has enough space for the new image. {#show flash:}
    Verify Flash: directory size and current IOS while In privileged executive.
  7. Configure the S/R as follows:
    • Enter configuration terminal mode.
    • Configure the console and vty lines (0 4) for remote access to the S/R. (Use password Cisco to make things easy.)
    • {#config t --> (c)#line con 0 --> (c-line)#password cisco --> (c-line)#login --> (c-line)#logging syn --> (c-line)#line vty 0 4 --> (c-line)#password cisco --> (c-line)#login --> (c-line)#logging syn}
      Line console and vty 0 4 configurations.
    • Configure the appropriate IP on the VLAN1/Interface (192.168.0.0/24 Network).
    • Exit back to privileged executive mode. {(c)#int vlan 1 --> (c-if)#ip address 192.168.0.2 255.255.255.0 --> (c-if)#no shut --> (c-if)#end}
      IP address configuration on a switch (Will be an INTERFACE on a router).
    • Clear the Flash: filesystem (This takes several minutes and it might seem frozen at first, it is working, I promise.) {#erase flash:}
      Erasure of Flash: filesystem.
  8. Use a telnet connection over ethernet on your computer to connect to the address configured on the S/R.
    IP connection to the S/R using Tera Term (Telnet).
  9. Start the TFTP server.
    A running TFTP server.
  10. Enter commands to send a TFTP file over the connection. (Using the computer address as the source. The filename of the IOS must also be EXACT.) {#copy tftp flash --> host []? 192.168.0.1 --> S filename []? c3750-ipservicesk9-mz.122-55.SE9.bin --> D filename []? (Just hit enter)}
    Commands used to copy 3750 IOS to a switch.
  11. After the install has finished verify the file is now on the S/R. {#show flash:}
    Verification of correct image in Flash: filesystem.
  12. Reload the S/R and do not save the configuration. {#reload}
    Reloading S/R without saving.
  13. Wait for the reboot and verify that the S/R is a blank configuration with the correct IOS installed in Flash:.

Updating an IOS on a Cisco Switch/Router Using HyperTerminal

ROMMON COMMANDS ARE DIFFERENT FROM REGULAR CLI FOR S/R. CHECK YOUR SYNTAX.

  1. So you’re the idiot that reloaded an S/R without an IOS on the flash and it only boots into ROMMON? (i.e. switch: )
  2. Install HyperTerminal using a Windows XP disc. (Find instructions on how here.)
  3. Connect to the S/R using a console connection over COM1 (Run the .exe file to access HyperTerminal (HT). BAUD rate may also be an issue. The usual default is 9600 bits/sec. If the connection is not working try matching the default BAUD rate of the S/R and, if you want it to be faster, then use CONFREG command to change the rate (Higher rates may run into problems).)
    Connecting using HyperTerminal using COM1 (Serial).
  4. Check the Flash: filesystem to verify it can fit the new IOS. {dir flash:}
    Checking size of Flash: using {dir flash:} command.
  5. Use {copy xmodem: flash:FILENAME} command to copy the IOS from the computer. {copy xmodem: flash:c3750-ipservicesk9-mz.122-55.SE9.bin}
    Copying IOS using {copy xmodem: flash:*} command.
  6. Click the transfer button and then send file while the previous command is still running to send the file (Use xmodem or xmodem-1K)
    Sending the exact file path using 1K Xmodem.
  7. Once the install has finished verify the IOS has been installed to the Flash: filesystem. {Dir flash:}
  8. Reset the switch and then verify the correct IOS is installed once more. {Reset}