Bambang F. Indarto

The Journey… The Shares

Posts Tagged ‘flash’

How to Copy IOS From One Cisco Router to Another

Posted by bfindarto on March 12, 2008

Well.. there will be the time that you want to install an ios for your router (maybe becouse of your router’s ios is crashed) or you want to upgrade your ios… but… you dont’t have the tftp server around, then you guys can follow these steps.

This method will work with requirements: the flash size of the destination router should be adequate for the new IOS file size.

Okay… here’s how to do it:

On the source router that contains the IOS file that you want to copy, issue the following command:

Router(config)#tftp-server flash:/SOURCE-IOS-FILE.bin

Where SOURCE-IOS-FILE.bin is the name of the IOS file that you want to copy. If you are using a router that has PCMCIA flash card, replace the ‘flash:’ with ‘slot0:’ or ‘slot1:’ in the previous command, depending on the slot that contains the file that you want to copy.

This command will make the router act as a TFTP server. And the rest of the procedure is done on the target router and can be found on this link.

After you complete the copy operation, issue the command:

Router(config)#no tftp-server flash:/SOURCE-IOS-FILE.bin

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

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 »