Using TFTP to Backup and Restore a Config

This is a step-by-step approach to copy a configuration from a router to a TFTP server, and back to another router. Before you proceed with this method, make sure you have a TFTP server on the network to which you have IP connectivity.

  1. At the Router> prompt, issue the enable command, and provide the required password when prompted.

The prompt changes to Router#, which indicates that the router is now in privileged mode.

  1. Copy the running configuration file to the TFTP server:
  2. CE_2#copy running-config tftp:
  3. Address or name of remote host []? 64.104.207.171
  4. Destination filename [ce_2-confg]? backup_cfg_for_my_router
  5. !!
  6. 1030 bytes copied in 2.489 secs (395 bytes/sec)

CE_2#

  1. Open the configuration file with a text editor. Search for and remove any line that starts with “AAA”.

Note: This step is to remove any security commands that can lock you out of the router.

  1. Copy the configuration file from the TFTP server to a new router in privileged (enable) mode which has a basic configuration.
  2. Router#copy tftp: running-config
  3. Address or name of remote host []? 64.104.207.171
  4. Source filename []? backup_cfg_for_my_router
  5. Destination filename [running-config]?
  6. Accessing tftp://10.66.64.10/backup_cfg_for_my_router…
  7. Loading backup_cfg_for_router from 64.104.207.171 (via    FastEthernet0/0): !
  8. [OK – 1030 bytes]
  9.  
  10. 1030 bytes copied in 9.612 secs (107 bytes/sec)

CE_2#

Use an FTP Server to Backup and Restore a Configuration

In this procedure, an FTP server can be used in place of a TFTP server.

  1. At the Router> prompt, issue the enable command, and provide the required password when prompted.

The prompt changes to Router#, which indicates that the router is now in privileged mode.

  1. Configure the FTP username and password.
  2. CE_2#config terminal
  3. CE_2(config)#ip ftp username cisco
  4. CE_2(config)#ip ftp password cisco123
  5. CE_2(config)#end

CE_2#

  1. Copy the configuration to the FTP server.
  2. CE_2#copy running-config ftp:
  3. Address or name of remote host []? 10.66.64.10
  4. Destination filename [ce_2-confg]? backup_cfg_for_router
  5. Writing backup_cfg_for_router !
  6. 1030 bytes copied in 3.341 secs (308 bytes/sec)

CE_2#

  1. Open the configuration file with a text editor. Search for and remove any line that starts with “AAA”.

Note: This step is to remove any security commands that can lock you out of the router.

  1. Copy the configuration file from the FTP server to a router in privileged (enable) mode which has a basic configuration.
  2. Router#copy ftp: running-config
  3. Address or name of remote host [10.66.64.10]?
  4. Source filename [backup_cfg_for_router]?
  5. Destination filename [running-config]?
  6. Accessing ftp://10.66.64.10/backup_cfg_for_router…
  7. Loading backup_cfg_for_router !
  8. [OK – 1030/4096 bytes]
  9. 1030 bytes copied in 13.213 secs (78 bytes/sec)

CE_2#

Use a Terminal Emulation Program to Backup and Restore a Configuration

A terminal emualation program can be used to back up and restore a configuration. This is a description of the procedure using Microsoft Hyperterminal Terminal Emulation software:

  1. If the configuration needs to be copied from another router, connect to that router through the console or Telnet.
  2. At the Router> prompt, issue the enable command, and provide the required password when prompted.

The prompt changes to Router#, which indicates that the router is now in privileged mode.

  1. Issue the terminal length 0 command in order to force the router to return the entire response at once, rather than one screen at a time.

This allows you to capture the configuration without extraneous –more– prompts generated when the router responds one screen at a time.

  1. On the HyperTerminal menu, choose Transfer > Capture Text.

The Capture Text window appears.

  1. Name this file “config.txt.”
  2. Click Start in order to dismiss the Capture Text window and begin the capture.
  3. Issue the show running-config command, and allow time for the router to complete its response. You will see:

Building configuration…

followed by the configuration.

  1. On the HyperTerminal menu, choose Transfer > Capture Text > Stop in order to end the screen capture.
  2. Open the config.txt file you created in any text editor, such as Notepad or Wordpad.
  3. Search for and remove any line that starts with “AAA”.

Note: This step is to remove any security commands that could lock you out of the router.

  1. Save the file.
  2. Connect to the router that needs the configuration.
  3. Open the config.txt file.
  4. Highlight the entire contents of the config.txt file.

You can do this by dragging the cursor from before the first character to after the last character in the file while holding down the left mouse button. Alternatively, if you use Notepad, you can choose Edit > Select All from the menu.

  1. Copy the selected text to the Windows clipboard.

You can either choose Edit > Copy from the text editor menu, or hold down the CTRL key and simultaneously press the C key in order to perform the copy.

  1. Switch to the HyperTerminal window, and issue the configure terminal command at the Router# prompt. Then press Enter.
  2. Paste the configuration file into the router by selecting Edit > Paste to Host on the HyperTerminal menu.
  3. After the configuration has finished pasting and the router brings you back to the configuration prompt, issue the copy running-config startup-config command in order to write the configuration into memory.
  4. Issue the exit command in order to return to the Router# prompt.

Source

https://www.cisco.com/c/en/us/support/docs/ios-nx-os-software/ios-software-releases-122-mainline/46741-backup-config.html

Leave a comment