Tuesday 10 September 2019

Backup & Restore Cisco Router Configurations VIA TFTP to Flash USB

Backup & Restore Cisco Router Configurations VIA TFTP to Flash USB

This section explains the file systems on routers and switches . It also provide information regarding backup, restore or copy Cisco Router Configuration via TFTP to Flash USB using different techniques. Cisco IOS configuration files such as startup-config or running-config must be archived. These files can be saved in a text file or stored on a TFTP server.

Some router models also have a USB port, and a file backup can be created on a USB drive. If necessary, these files can be copied to the router or switch from the TFTP server or USB drive.

Router File Systems

In addition to implementing and protecting a small network , the network administrator must also manage the configuration files. Configuration file management is important for backup and recovery in case of device failure. The Cisco IOS file system (IFS) provides a single interface to all file systems used by a router, including the following:


  • Flash memory file systems
  • Network file systems (TFTP and FTP)
  • Any other terminal for reading or writing data, such as NVRAM memory, running configuration and ROM memory, among others

With Cisco IFS, you can view and sort all files (image, text file, etc.), including files on remote servers. For example, it is possible to view a configuration file on a remote server to verify that it is the correct configuration file before loading it into the router. Cisco IFS allows the administrator to navigate through different directories, list the files in one of them and create sub-directories in flash memory or on a disk. The directories available depend on the device.

The Flash File System

In Image 2, the content of the current default file system is shown, which in this case is flash, as indicated by the asterisk that preceded the entry in the previous illustration.

There are several files located in flash memory, but the one of greatest interest specifically is the last one on the list: it is the name of the current Cisco IOS image file that runs in RAM.

The NVRAM File System

To view the contents of NVRAM memory, you must change the current default file system with the cd (change directory) command .

The pwd (current working directory) command verifies that we are viewing the NVRAM directory. Finally, the dir (directory) command lists the content of NVRAM memory. Although several configuration files are listed, the one of particular interest is the startup configuration file.

Creating Configuration backup with TFTP Server

Copies of the configuration files should be stored as backup files in the event of a problem. The configuration files can be stored on a trivial file transfer protocol (TFTP) server or on a USB drive. A configuration file should also be included in the network documentation. To save the running configuration or startup configuration on a TFTP server, use the copy running-config tftp or copy startup-config tftp command :

Router # copy running-config tftp
Remote host []? 13,108.2,155
Name of configuration file to write [tokyo-config]? Tokyo.2
Write file tokyo. 2 to 131.108.2.155? [confirm]
Writing tokyo.2 !!!!!! [OKAY]

Follow these steps to back up the running configuration on a TFTP server:

  • Step 1 . Enter the copy running-config tftp command .
  • Step 2 . Enter the IP address of the host where the configuration file will be stored.
  • Step 3 . Enter the name to be assigned to the configuration file.
  • Step 4 . Press Enter to confirm each choice.

Restore Configuration File via TFTP on Cisco Router

To restore the running configuration or startup configuration from a TFTP server, use the copy tftp running-config or copy tftp startup-config command. Follow these steps to restore the running configuration from a TFTP server:


  • Step 1 . Enter the copy tftp running-config command .
  • Step 2 . Enter the IP address of the host where the configuration file is stored.
  • Step 3 . Enter the name to be assigned to the configuration file.
  • Step 4 . Press Enter to confirm each choice.

Save Cisco Router Configurations on USB

The universal serial bus (USB) storage feature enables certain Cisco router models to support USB flash drives. Images, settings and other files can be copied to Cisco USB flash memory and from it with the same reliability with which files are stored and recovered with a Compact Flash card. In addition, modular integrated service routers can boot with any image of Cisco IOS software stored in USB flash memory. Cisco USB flash memory modules are available in 64 MB, 128 MB and 256 MB versions.

To be compatible with a Cisco router, a USB flash drive must be FAT16 format . Otherwise, the show file systems command displays an error indicating that the file system is incompatible.
Here is an example of using the dir command in a USB file system:

Router # dir usbflash0:
Directory of usbflash0: /
1 -rw- 30125020 Dec 22 2032 05:31:32 +00: 00 c3825-entservicesk9-mz.123-14.T
63158272 bytes total (33033216 bytes free)

Ideally, the USB flash memory can contain multiple copies of the Cisco IOS configurations and several router configurations. The USB flash memory allows an administrator to easily move and copy those IOS files and settings from one router to another.

Backup Configurations to USB FLASH DRIVE

When backing up to a USB port, it is recommended to issue the show file systems command to verify that the USB drive is present and confirm the name:

Then use the copy run usbflash0: / command to copy the configuration file to the USB flash drive. Be sure to use the name of the flash drive as indicated in the file system. The bar is optional, but indicates the root directory of the USB flash drive.

R1 # copy running-config usbflash0:
Destination filename [running-config]? R1-Config
5024 bytes copied in 0.736 secs (6826 bytes / sec)
The IOS will request the file name. If the file already exists on the USB flash drive, the router will request the overwrite confirmation.

Use the dir command to view the file on the USB drive, and the more command to view the content:
 Restore Configuration Settings Using A USB FLASH DRIVE
To copy the file again, you must edit the R1-Config USB file with a text editor to transform it into a valid configuration file; otherwise, there are many entries that are invalid commands and no interface will appear.

R1 # copy usbflash0: / R1-Config running-config
Destination filename [running-config]?

Creating Backup & Restoring Using Text Files (TERA TERM, Putty)

Configuration files can be saved or archived in a text file using Tera Term.

As shown in the figure, the steps are:
  • Step 1 . On the File menu, click Log .
  • Step 2 . Choose the location to save the file. Tera Term will start capturing text.
  • Step 3 . Once the capture begins, execute the show running-config or show startup-config command on the privileged EXEC entry request. The text that appears in the terminal window will be placed in the chosen file.
  • Step 4 . When the capture is complete, select Close in the Log window of TeraTerm.
  • Step 5 . Look at the file to verify that it is not damaged.

RESTORING TEXT SETTINGS

A configuration can be copied from a file to a device. When copied from a text file and pasted into a terminal window, the IOS executes each line of the configuration text as if it were a command.
This means that the file will need editing to ensure that the encrypted passwords are in the form of text and that IOS messages and non-command text, such as “–More–“, are removed.
In turn, in the CLI, the device must be set to the global configuration mode to receive the commands from the text file that are pasted into the terminal window.
When Tera Term is used, the steps are as follows:
  • Step 1 . On the File menu, click Send to send the file.
  • Step 2 . Locate the file you should copy on the device and click Open.
  • Step 3 . Tera Term will paste the file into the device.
The text in the file will be applied as commands in the CLI and will become the configuration running on the device. This is a convenient method to manually configure a router.





No comments:

Post a Comment