Flashing a new IOS onto a Cisco switch or router

Flashing a new IOS onto a Cisco switch or router

This tutorial will guide you through flashing a new IOS onto a Cisco switch or router.

Cisco devices use IOS images which are typically in .bin (binary) format. The device will download the image of your choice from a TFTP server and write it to its internal flash memory. Once you have obtained your new IOS image, you will need to set up a TFTP server on a networked PC. A good free TFTP server for Windows can be obtained from http://tftpd32.jounin.net/.

Once you have installed and are running the TFTP server, you will need to go into the Settings (using the obvious button) and change the Base Directory to the directory in which your IOS image resides. Once you have done this and restarted the TFTP server application, you are ready to use it.

Now ensure that at least one Ethernet port of your Cisco device is connected to the same network as the PC running TFTP and log into the console of your router.

Now you must, if you have not done so already, assign an appropriate IP address to the network interface on the Cisco device. For my examples, I am using a Cisco 2610 router which labels its only Ethernet port as Ethernet0/0.

To assign an IP address, you would do the following. The bold bits are the bits that you type:

router-2610-1>enable
router-2610-1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
router-2610-1(config)#int Ethernet0/0
router-2610-1(config-if)#no shutdown
00:04:03: %LINK-3-UPDOWN: Interface Ethernet0/0, changed state to up
00:04:04: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state
router-2610-1(config-if)#ip address 10.0.0.253 255.255.255.0
router-2610-1(config-if)#exit

This assigns the IP address 10.0.0.253 to Ethernet0/0 with a subnet mask of 255.255.255.0.

The device should now be pingable from your TFTP host machine:

E:\Users\Phil>ping 10.0.0.253
Pinging 10.0.0.253 with 32 bytes of data:
Reply from 10.0.0.253: bytes=32 time=7ms TTL=255
Reply from 10.0.0.253: bytes=32 time=5ms TTL=255
Reply from 10.0.0.253: bytes=32 time=4ms TTL=255
Reply from 10.0.0.253: bytes=32 time=5ms TTL=255
Ping statistics for 10.0.0.253:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 4ms, Maximum = 7ms, Average = 5ms
E:\Users\Phil>

Now you can copy the IOS image to your flash from the TFTP server. In my example below, I am copying the image c2600-i-mz.123-19a.bin from the TFTP server at 10.0.0.5 to flash.  The bold bits are the bits that you type, <Hit Enter> is an instruction:

router-2610-1#copy tftp: flash:
Address or name of remote host []? 10.0.0.5
Source filename []? c2600-i-mz.123-19a.bin
Destination filename [c2600-i-mz.123-19a.bin]? c2600-i-mz.123-19a.bin
Accessing tftp://10.0.0.5/c2600-i-mz.123-19a.bin…
Erase flash: before copying? [confirm] <Hit Enter>
Erasing the flash filesystem will remove all files! Continue? [confirm] <Hit Enter>
Erasing device… eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee …erased
Erase of flash: complete
Loading c2600-i-mz.123-19a.bin from 10.0.0.5 (via Ethernet0/0): !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! etc. etc.
[OK – 7738476 bytes]

Verifying checksum… OK (0x213C)
7738476 bytes copied in 68.568 secs (112858 bytes/sec)
router-2610-1#

Now you can reload your router:

router-2610-1#reload

System configuration has been modified. Save? [yes/no]: no
Proceed with reload? [confirm] <Hit Enter>

Your router should now reboot and will hopefully show your new IOS as running when you type show ver on the console.

Leave a Reply

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