Backing Up and Restoring Cisco IOS Software and Configurations

This chapter provides information and commands concerning the following topics:

Boot system commands

• The Cisco IOS File System

• Backing up configurations to a TFTP server

• Restoring configurations from a TFTP server

• Backing up the Cisco IOS Software to a TFTP server

• Restoring/upgrading the Cisco IOS Software from a TFTP server

• Restoring the Cisco IOS Software from ROM Monitor mode using Xmodem

• Restoring the Cisco IOS Software using the ROM Monitor environmental variables and tftpdnld command

Boot System Commands

Router(config)#boot system flash imagename

Loads the Cisco IOS Software with image-name.

Router(config)#boot system tftp image-name 172.16.10.3

Loads the Cisco IOS Software with image-name from a TFTP server.

Router(config)#boot system rom

Loads the Cisco IOS Software from ROM.

Router(config)#exit

Router#copy running-config startup-config

Saves the running configuration to NVRAM. The router will execute commands in their order on the next reload.

If you enter boot system flash first, that is the first place the router will go to look for the Cisco IOS Software. If you want to go to a TFTP server first, make sure that the boot system tftp command is the first one you enter.

The Cisco IOS File System

NOTE: The Cisco IOS File System (IFS) provides a single interface to all the file systems available on a routing device, including the flash memory file system; network file systems such as TFTP, Remote Copy Protocol (RCP), and File Transfer Protocol (FTP); and any other endpoint for reading and writing data, such as NVRAM, or the running configuration.

The Cisco IFS minimizes the required prompting for many commands. Instead of entering in an EXEC-level copy command and then having the system prompt you for more information, you can enter a single command on one line with all necessary information.

Cisco IOS Software Commands

IFS Commands

copy tftp running-config

copy tftp: system:running-config

copy tftp startup-config

copy tftp: nvram:startup-config

show startup-config

more nvram:startup-config

erase startup-config

erase nvram:

copy running-config startup-config

copy system:running-config nvram:startup-config

copy running-config tftp

copy system:running-config tftp:

show running-config

more system:running-config

Backing Up Configurations to a TFTP Server

Denver#copy running-config startup-config

Saves the running configuration from DRAM to NVRAM (locally).

Denver#copy running-config tftp

Copies the running configuration to the remote TFTP server.

Address or name of remote host[ ]? 192.168.119.20

The IP address of the TFTP server.

Destination Filename [Denver-confg]?®Entsr|

The name to use for the file saved on the TFTP server.

iiiiiiiiiiiiiii

Each bang symbol (!) = 1 datagram of data.

624 bytes copied in 7.05 secs

Denver#

File has been transferred successfully.

NOTE: You can also use the preceding sequence for a copy startup-config tftp command sequence.

Restoring Configurations from a TFTP Server

Denver#copy tftp running-config

Copies the configuration file from the TFTP server to DRAM.

Address or name of remote host[ ]? 192.168.119.20

The IP address of the TFTP server.

Source filename [ ]?Denver-confg

Enter the name of the file you want to retrieve.

Destination filename [running-config]? ®Entsrl

Accessing tftp://192.168.119.20/Denver-confg...

Loading Denver-confg from 192.168.119.02 (via Fast Ethernet 0/0):

iiiiiiiiiiiiii

[OK-624 bytes]

624 bytes copied in 9.45 secs

Denver#

File has been transferred successfully.

NOTE: You can also use the preceding sequence for a copy tftp startup-config command sequence.

Backing Up the Cisco IOS Software to a TFTP Server

Denver#copy flash tftp

Source filename [ ]? c2600-js-l_121-3.bin

Name of the Cisco IOS Software image.

Address or name of remote host [ ]? 192.168.119.20

The address of the TFTP server.

Destination filename [c2600-js-l_121-3.bin]?

(Enter!

The destination filename is the same as the source filename, so just press f Enter].

llllllllllllllllllllllllllllllllllllllllllllll

llllllllllllllllllllllllllllllllllllll

8906589 bytes copied in 263.68 seconds

Denver#

Restoring/Upgrading the Cisco IOS Software from a TFTP Server

Denver#copy tftp flash

Address or name of remote host [ ]?

192.168.119.20

Source filename [ ]? c2600-js-l_121-3.bin

Destination filename [c2600-js-l_121-3.bin]?

Accessing tftp://192.168.119.20/c2600-js-l_121-3.bin

Erase flash: before copying? [confirm]

(

If flash memory is full, erase it first.

Erasing the flash file system will remove all files

Continue? [confirm] (Enter!

Press S-C if you want to cancel.

Erasing device eeeeeeeeeeeeeeeeee...erased

Each e represents data being erased.

Loading c2600-js-l_121-3.bin from 192.168.119.20

(via) FastEthernet 0/0): iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii

Each bang symbol (!) = 1 datagram of data.

iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii

!!!

Verifying Check sum OK

[OK - 8906589 Bytes]

8906589 bytes copied in 277.45 sees

Denver#

Success.

Restoring the Cisco IOS Software from ROM Monitor Mode Using Xmodem

The output that follows was taken from a 1720 router. Some of this output might vary from yours, depending on the router model that you are using.

rommon 1 >confreg

Shows the configuration summary. Step through the questions, answering defaults until you can change the console baud rate. Change it to 115200; it makes transfer go faster.

Configuration Summary enabled are:

load rom after netboot fails console baud: 9600

boot: image specified by the boot system commands or default to: cisco2-c1700

do you wish to change the configuration? y/n [n]: y enable "diagnostic mode"? y/n [n]: n enable "use net in IP bcast address"? y/n [n]: n disable "load rom after netboot fails"? y/n [n]: n enable "use all zero broadcast"? y/n [n]: n enable "break/abort has effect"? y/n [n]: n enable "ignore system config info"? y/n [n]: n change console baud rate? y/n [n]: y enter rate: 0=9600, 1=4800, 2=1200, 3=2400

change the boot characteristics? y/n [n]: n

Prompts begin to ask a series of questions that allow you to change the configuration register. Answer n to all questions except the one that asks you to change the console baud rate. For the enter rate, choose 7 because that is the number that represents a baud rate of 115200.

Configuration Summary enabled are:

load rom after netboot fails console baud: 115200

boot: image specified by the boot system commands or default to: cisco2-c1700

do you wish to change the configuration? y/n [n]: n rommon2>

After the summary is shown again, choose n to not change the configuration and go to the rommon> prompt again.

rommon 2>reset

Reloads the router at the new com speed. Change the HyperTerminal setting to 115200 to match the router's new console setting.

Rommon 1>xmodem c1700-js-l_121-3.bin

Asking to transfer this image using Xmodem.

...<output cut>...

Do you wish to continue? y/n [n ]:y

Choose y to continue.

In HyperTerminal, go to Transfer, then Send File (see Figure 16-1). Locate the Cisco IOS Software file on the hard drive and click Send (see Figure 16-2).

Router will reload when transfer is completed.

Reset baud rate on router.

Router(config)#line con 0

Router(config-line)#speed 9600

Router(config-line)#exit

HyperTerminal will stop responding. Reconnect to the router using 9600 baud, 8-N-1.

Figure 16-1 Finding the Cisco IOS Software Image File

Figure 16-1 Finding the Cisco IOS Software Image File

Figure 16-2 Sending the Cisco IOS Software Image File to the Router

■ Send File E®

Folder C:\DccumertsandSeitrgs\Dad

Fienare:

|c \ios\c17Ü0-y-mz.120-1XM

1 Browe,,, ]

Piotocol;

1 Zmodem wilh Ciwh Ftecovefy

Ml

Restoring the Cisco IOS Software Using the ROM Monitor Environmental Variables and tftpdnld Command

rommon 1>IP_ADDRESS=192.168.100.1

Indicates the IP address for this unit.

rommon 2>IP_SUBNET_MASK=255.255.255.0

Indicates the subnet mask for this unit.

rommon 3>DEFAULT_GATEWAY=192.168.100.1

Indicates the default gateway for this unit.

rommon 4>TFTP_SERVER=192.168.100.2

Indicates the IP address of the TFTP server.

rommon 5>TFTP_FILE= c2600-js-l_121-3.bin

Indicates the filename to fetch from the TFTP server.

rommon 6>tftpdnld

Starts the process.

...<output cut>...

Do you wish to continue? y/n: [n]:y

...<output cut>...

Rommon 7>i

Resets the router. The i stands for initialize.

NOTE: Commands and environmental variables are case sensitive, so be sure that you have not accidentally added spaces between variables and answers.

chapter 17

Continue reading here: Password Recovery Procedures and the Configuration Register

Was this article helpful?

0 0

Readers' Questions

  • nelma
    What is the effect of using the router# copy runningconfig startupconfig command on a router?
    3 months ago
  • Using this command will save the router’s current configuration and settings and store them for future use. This allows the router to maintain the same configuration should the router be powered off or restarted. It also provides a backup to be used in the event that the router's configuration is lost or erased.
    • Elaine
      How to backup cisco switch configuration?
      7 months ago
      1. Access the Cisco switch CLI through serial cable or Telnet/SSH connection.
      2. Type the “show running-config” command to display the current configuration.
      3. Copy the running configuration to a text file on your computer. This can be accomplished by using the “copy running-config tftp” command if your computer is connected to the switch via a local network, or the “copy running-config flash:filename” command if your computer is connected via serial cable.
      4. Verify the copy by typing “show flash” or “dir flash” to make sure the file has been copied to the flash memory.
      5. Transfer the file to a safe location.
      • awet
        How to save cisco switch configuration to file?
        8 months ago
        1. Connect to the Cisco switch using a console/terminal/SSH session.
        2. Enter the “enable” mode.
        3. Enter “copy running-configuration startup-configuration” and press enter.
        4. Type “copy flash:filename” and press enter. This will save the running configuration to the file you specify.
        5. Type “exit” and press enter to exit the configuration mode.
        6. Disconnect from the switch.
        • luca
          How to export running config cisco?
          8 months ago
        • To export the running configuration of a Cisco device, use the copy running-config startup-config command in privileged EXEC mode. This will save the running config to the startup configuration, which is loaded when the device reboots. Alternatively, you can use the show running-config or show startup-config commands to view the configuration and use a terminal emulator to save the output to a file.
          • osman mustafa
            How to copy cisco ios to tftp server?
            8 months ago
            1. Ensure that the TFTP server is connected to the same network as the Cisco device.
            2. Configure the IP address of the TFTP server on the Cisco device.
            3. Connect to the Cisco device using either a console cable or telnet/ssh.
            4. Once connected, enter the privileged EXEC mode.
            5. Enter the command copy flash: [filename] tftp:.
            6. The system will prompt for information, starting with the IP address of the TFTP server.
            7. Enter the IP address of the TFTP server and press enter.
            8. The system will prompt for the filename used to store the IOS image on the TFTP server.
            9. Enter the filename used to store the IOS image and press enter.
            10. The system will prompt to confirm the copy.
            11. Enter the Y key to confirm the transfer and press enter.
            12. The IOS image will transferred to the TFTP server.