Bambang F. Indarto

The Journey… The Shares

Posts Tagged ‘upgrade’

Upgrading the Cisco Routers IOS

Posted by bfindarto on March 12, 2008

In the circumtances of that your router’s IOS is corrupted… or you plan to add more duties to the router or new hardware, then you may do the upgrading proccess of your cisco router’s ios. First, you should make sure that the router’s flash size should be enough for the new IOS image. Also, before starting the procedure of IOS upgrade or installation, you will need to install TFTP server software on a PC connected to the router Ethernet interface. There are many free downloadable TFTP servers’ software on the Internet, however, my recommendation is Free TFTP Server 6.0.

Afterwards, you make sure to direct the TFTP server to the folder containing the new IOS image that you have.

If you have a router with internal flash memory, you may follow these steps:

  1. Create a console connection with the default settings (9600 baud, 8 databits, 0 parity bits, 1 stop bit, no flow control).
  2. Verify the connectivity between the router and the TFTP server using ‘ping’. Make sure that the router interface and the TFTP server IP addresses are in the same range and the ping is responding well.
  3. Although the upgrade will be happening in the flash and the configuration is saved in the NVRAM, make a backup of the configuration. This is recommended in case something goes wrong in the upgrade. Also, make a backup copy of the IOS you already have on the router. In case the new IOS image is corrupted, you will be on the safe side.
  4. Start the upgrade by the command:
    Router#copy tftp flashYou will be prompted to enter some information: remote host address/name,  and the ios file name. Please note that the file name is case sensitive, so be %100 sure of what you are writing.
    Next… you will be ask to enter the destination file name. It is preferred to keep it as the source file name, to be able to easily identify the files on the TFTP servers as compared to the ones on the routers.
  5. Now you will be asked whether to erase the existing file(s) in the flash or not. If you have enough free space on the flash, don’t erase the old IOS image, you might need it.
    Erase flash: before copying? [confirm]
  6. Afterwards, the router starts copying the new IOS file to the router, or start erasing the flash and then copying.
    The copying process takes several minutes; the time differs from network to network. During the copy process, messages and exclamation points (“!”) are displayed to indicate which file has been accessed. The exclamation point “!” indicates that the copy process is taking place. Each exclamation point indicates that ten packets have been transferred successfully. A checksum verification of the image occurs after the image is written to flash memory.
  7. Next… before reloading the router, you need to make sure of two things. The first is that the configuration register value is 0x2102. You can check that wit the ‘show version’ command. If the configuration register’s value is not 0x2102, you will need to set it to that value with the following command:Router(config)#config-register 0x2102

    The second thing is needed to be checked if you did not erase the contents of the flash. You will need to setup the router to boot from the new IOS file with the following commands:

    Router(config)#no boot system
    Router(config)#boot system flash cXXXX-X-XX.XXX-XX.bin

  8. If you type the reload command, the router asks you if you want to save the configuration. You should be very cautious here. The reason is that if the router is in boot mode for instance, it is a subset of the full Cisco IOS software which is running and there is no routing functionality. Therefore, all the routing configuration is gone in the running configuration and if you save the configuration at this time, then you erase the good startup-configuration in NVRAM and replace it by the incomplete running-configuration. Save the configuration only if you are sure that you have the full configuration in the output of show run. It is NOT necessary to save the configuration to take into account the new config-register if this one has been changed previously. That is done automatically.Router#reload
    System configuration has been modified. Save? [yes/no]: y 
    Building configuration…
    [OK]
    Proceed with reload? [confirm]
  9. To verify that the new image is loaded after the ‘reload’, use ‘show version’ command.

Note: In step 1 or after the upgrade, if the router boots into rommon mode or boot mode and you have one of the following case:
rommon 1 > dir flash: 
device does not contain a valid magic number 
dir: cannot open device “flash:” 
rommon 2 >

or

router(boot)>
device does not contain a valid magic number
boot: cannot open “flash:”
boot: cannot determine first file name on device “flash:”

This means that the flash is empty or the file system is corrupted. In this case, you have to consider using the procedure of Upgrading or Installing the IOS from ROMmon mode .

Posted in Cisco Networking | Tagged: , , , , , | Leave a Comment »