Wednesday, 24 August 2016

Backup Router/Switch Configuration

Backup Router/Switch Configuration

I am going to mention two easy methods to backup router / switch configuration file.
  • Using Putty logging
  • Using TFTP

Using Putty Logging

  1. Open router / switch terminal via putty connection.
  2. Enter enable mode (by entering enable command).
  3. Enter command terminal length 0 (to display show run commands without breaks)
  4. Right click putty and select Change Settings. 
  5. Select Session
    • Logging
    • All Session output
    • Log File Name – path and filename of the config file.

  6. Enter command show run on your router/switch.
  7. Close the session.

Using TFTP

  1. You can transfer file from router/switch to your TFTP server.
  2. For TFTP server, you can use open source TFTPD32 application.
  3. Configure your TFTPd32 application as shown in screenshot.

    • Current Directory – Directory where you want to store your configuration file.
  4. Enter following command in enable mode of your router / switch.
    • Copy running-config tftp:
      • Enter the tftp server address – eg. 192.168.0.101
      • Enter the file name of the config – eg. r1-config



Similary you can use this method for copying firewall or other device configurations.

Use a TFTP Server to Backup and Restore a Configuration

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.
  2. Copy the running configuration file to the TFTP server:
    CE_2#copy running-config tftp:
    Address or name of remote host []? IP address
    Destination filename [ce_2-confg]? backup_cfg_for_my_router
    !!
    1030 bytes copied in 2.489 secs (395 bytes/sec)
    CE_2#
  3. 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.
  4. Copy the configuration file from the TFTP server to a new router in privileged (enable) mode which has a basic configuration.
    Router#copy tftp: running-config
    Address or name of remote host []? IP Address
    Source filename []? backup_cfg_for_my_router
    Destination filename [running-config]?
    Accessing tftp://10.66.64.10/backup_cfg_for_my_router...
    Loading backup_cfg_for_router from 64.104.207.171 (via FastEthernet0/0): !
    [OK - 1030 bytes]
    
    1030 bytes copied in 9.612 secs (107 bytes/sec)
    CE_2#

No comments: