Monday, August 25, 2008

Backup and Restore Cisco IOS

The copy command isn’t limited to simply backing up or restoring configuration files. It can also be used to copy your current IOS image to a TFTP server, or to apply a new IOS image to your router. Recall that the Cisco IOS image is stored in Flash memory. Before deciding to install a new IOS image, be sure that your router has enough Flash memory to support the image. Images from different feature sets may require more Flash memory than you currently have installed.

To back up the current IOS to a TFTP server, use the copy flash tftp command.

cisco2501#copy flash tftp
Source filename []? d1205.bin
Address or name of remote host []?
Destination filename [d1205.bin]?
3289170 bytes copied in 47.668 secs (69982 bytes/sec)

While the copy operation to the TFTP server is completing, the exclamation points shown will scroll across the screen – I have eliminated many of these in order to save space. You will notice that the command requires us to provide information on the image filename and the IP address of the TFTP server. If you’re not sure of the name of the image stored in Flash, use the show flash command.

Router#show flash

System flash directory:
File Length Name/status
1 3289170 d1206.bin
[3289236 bytes used, 905068 available, 4194304 total]
4096K bytes of processor board System flash (Read/Write)

Since this router has only 4 MB of Flash, we are obviously limited to an image that will fit within that space. The contents of Flash can also be viewed using the dir command. You will always need to know the name of the images you want to back up or restore. You should also ensure that the TFTP server is available and has enough room to store the image prior to attempting a backup.

Copying a new IOS image from a TFTP server to Flash involves issuing the command copy tftp flash.

cisco2501#copy tftp flash
Address or name of remote host []?
Source filename []? d1206.bin
Destination filename [d1206.bin]?
Accessing tftp://
Erase flash: before copying? [confirm]
Erasing the flash filesystem will remove all files! Continue? [confirm]
Erasing device... eeeeeeeeeeeeeeee ...erased
Erase of flash: complete
Loading d1206.bin from (via Ethernet0): !!!!!!!!!!!!!!!!!!
[OK - 3289170/6578176 bytes]
Verifying checksum... OK (0xB6BD)
3289170 bytes copied in 89.272 secs (36956 bytes/sec)

Notice that Flash memory was erased completely before the new image was copied over to it. Otherwise, there would not have been enough space to complete the copy process. You’ll also need to issue the reload command after updating the IOS. Finally, use the show version command to ensure that the router is now running the IOS version that you intended to install. Show version also provides a quick and easy way to learn more about your router’s hardware, software, and memory.

Cisco2501#show version
Cisco Internetwork Operating System Software
IOS (tm) 2500 Software (C2500-D-L), Version 12.0(5), RELEASE SOFTWARE (fc1)
Copyright (c) 1986-1999 by cisco Systems, Inc.
Compiled Tue 15-Jun-99 20:08 by phanguye
Image text-base: 0x0000144C, data-base: 0x00637308
ROM: System Bootstrap, Version 5.2(8a), RELEASE SOFTWARE
BOOTFLASH: 3000 Bootstrap Software (IGS-RXBOOT), Version 10.2(8a), RELEASE SOFTWARE (fc1)
Router uptime is 2 days, 8 hours, 9 minutes
System restarted by reload
System image file is "flash:d1206.bin"
cisco 2500 (68030) processor (revision A) with 16384K/2048K bytes of memory.
Processor board ID 02285256, with hardware revision 00000000
Bridging software.
X.25 software, Version 3.0.0.
1 Ethernet/IEEE 802.3 interface(s)
2 Serial network interface(s)
32K bytes of non-volatile configuration memory.
4096K bytes of processor board System flash (Read/Write)
Configuration register is 0×2102

On some routers, including those in the Cisco 2500 series, IOS upgrades should be done from the limited IOS version stored in ROM. Depending upon your model and IOS version, you may be prompted to boot into the ROM-based image after issuing the copy tftp flash command, or you may need to change what are known as configuration register settings.

No comments:

Your Ad Here