CCNP Course Institute in Delhi

Tuesday, December 14, 2010

Backing Up and Restoring the Cisco IOS Best Cisco CCSP Bootcamp Training Institute in Delhi Gurgaon

Network Bulls
www.networkbulls.com
Best Institute for CCNA CCNP CCSP CCIP CCIE Training in India
M-44, Old Dlf, Sector-14 Gurgaon, Haryana, India
Call: +91-9654672192

Before you upgrade or restore a Cisco IOS, you really should copy the existing file to a TFTP
host as a backup just in case the new image crashes and burns.
And you can use any TFTP host to accomplish this. By default, the flash memory in a router
is used to store the Cisco IOS. In the following sections, I’ll describe how to check the amount
of flash memory, how to copy the Cisco IOS from flash memory to a TFTP host, and how to
copy the IOS from a TFTP host to flash memory.
You’ll learn how to use the Cisco IFS and SDM to manage your IOS files after
first learning how to manage them with a TFTP host.
But before you back up an IOS image to a network server on your intranet, you’ve got to
do these three things:
Make sure you can access the network server.
Ensure that the network server has adequate space for the code image.
Verify the file naming and path requirement.
And if you have a laptop or workstation’s Ethernet port directly connected to a router’s
Ethernet interface, as shown in Figure 5.1, you need to verify the following before attempting
to copy the image to or from the router:
FIGURE 5 . 1 Copying an IOS from a workstation to a router
TFTP server software must be running on the administrator’s workstation.
The Ethernet connection between the router and the workstation must be made with a
crossover cable.
The workstation must be on the same subnet as the router’s Ethernet interface.
The copy flash tftp command must be supplied the IP address of the workstation if
you are copying from the router flash.
And if you’re copying “into” flash, you need to verify that there’s enough room in flash
memory to accommodate the file to be copied.
Verifying Flash Memory
Before you attempt to upgrade the Cisco IOS on your router with a new IOS file, it’s a good
idea to verify that your flash memory has enough room to hold the new image. You verify the
Console
E0
276 Chapter 5 Managing a Cisco Internetwork
amount of flash memory and the file or files being stored in flash memory by using the show
flash command (sh flash for short):
Router#sh flash
-#- --length-- -----date/time------ path
1 21710744 Jan 2 2007 22:41:14 +00:00 c2800nm-advsecurityk9-mz.124-12.bin
[output cut]
32989184 bytes available (31027200 bytes used)
The ISR router above has 64MB of RAM, and roughly half of the memory is in use.
The show flash command displays the amount of memory consumed by
the current IOS image and tells you if there’s enough room available to hold
both current and new images. You should know that if there’s not enough
room for both the old image and the new image you want to load, the old
image will be erased!
The amount of flash is actually easier to tally using the show version command on the
ISR routers:
Router#show version
[output cut]
Cisco 2811 (revision 49.46) with 249856K/12288K bytes of memory.
Processor board ID FTX1049A1AB
2 FastEthernet interfaces
4 Serial(sync/async) interfaces
1 Virtual Private Network (VPN) Module
DRAM configuration is 64 bits wide with parity enabled.
239K bytes of non-volatile configuration memory.
62720K bytes of ATA CompactFlash (Read/Write)
You can see that the amount of flash shows up on the last line. By averaging up, we get the
amount of flash to 64MB.
Notice that the filename in this example is c2800nm-advsecurityk9-mz.124-12.bin. The
main difference in the output of the show flash and show version commands is that the show
flash command displays all files in flash and the show version command shows the actual
name of the file that the router is using to run the router.
Backing Up the Cisco IOS
To back up the Cisco IOS to a TFTP server, you use the copy flash tftp command. It’s
a straightforward command that requires only the source filename and the IP address of the
TFTP server.
Backing Up and Restoring the Cisco IOS 277
The key to success in this backup routine is to make sure you’ve got good, solid connectivity
to the TFTP server. Check this by pinging the TFTP device from the router console
prompt like this:
Router#ping 1.1.1.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.2, timeout
is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max
= 4/4/8 ms
The Packet Internet Groper (Ping) utility is used to test network connectivity, and
I use it in some of the examples in this chapter. I’ll be talking about it in more
detail in the section “Checking Network Connectivity and Troubleshooting” later
in the chapter.
After you ping the TFTP server to make sure that IP is working, you can use the copy
flash tftp command to copy the IOS to the TFTP server as shown next:
Router#copy flash tftp
Source filename []?c2800nm-advsecurityk9-mz.124-12.bin
Address or name of remote host []?1.1.1.2
Destination filename [c2800nm-advsecurityk9-mz.124-12.bin]?[enter]
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!
21710744 bytes copied in 60.724 secs (357532 bytes/sec)
Router#
Just copy the IOS filename from either the show flash or show version command and
then paste it when prompted for the source filename.
In the preceding example, the contents of flash memory were copied successfully to the
TFTP server. The address of the remote host is the IP address of the TFTP host, and the source
filename is the file in flash memory.
The copy flash tftp command won’t prompt you for the location of any file
or ask you where to put the file. TFTP is just a “grab it and place it” program
in this situation. This means that the TFTP server must have a default directory
specified or it won’t work!
278 Chapter 5 Managing a Cisco Internetwork
Restoring or Upgrading the Cisco Router IOS
What happens if you need to restore the Cisco IOS to flash memory to replace an original file
that has been damaged or if you want to upgrade the IOS? You can download the file from
a TFTP server to flash memory by using the copy tftp flash command. This command
requires the IP address of the TFTP host and the name of the file you want to download.
But before you begin, make sure the file you want to place in flash memory is in the default
TFTP directory on your host. When you issue the command, TFTP won’t ask you where the
file is, so if the file you want to use isn’t in the default directory of the TFTP host, this just
won’t work.
Router#copy tftp flash
Address or name of remote host []?1.1.1.2
Source filename []?c2800nm-advsecurityk9-mz.124-12.bin
Destination filename [c2800nm-advsecurityk9-mz.124-12.bin]?[enter]
%Warning:There is a file already existing with this name
Do you want to over write? [confirm][enter]
Accessing tftp://1.1.1.2/c2800nm-advsecurityk9-mz.124-12.bin...
Loading c2800nm-advsecurityk9-mz.124-12.bin from 1.1.1.2 (via
FastEthernet0/0):
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[OK - 21710744 bytes]
21710744 bytes copied in 82.880 secs (261954 bytes/sec)
Router#
In the above example, I copied the same file into flash memory, so it asked me if I wanted
to overwrite it. Remember that we are “playing” with files in flash memory. If I had just corrupted
my file by overwriting it, I won’t know until I reboot the router. Be careful with this
command! If the file is corrupted, you’ll need to do an IOS restore from ROM monitor mode.
If you are loading a new file and you don’t have enough room in flash memory to store both
the new and existing copies, the router will ask to erase the contents of flash memory before
writing the new file into flash memory.
A Cisco router can become a TFTP server host for a router system image
that’s run in flash memory. The global configuration command is tftpserver
flash: ios_name.

No comments:

Post a Comment