How to: Export Configuration Files from a Switch to a TFTP Server

How to: Export Configuration Files from a Switch to a TFTP Server


Overview

This document describes how to export the current configuration file of a switch to a Trivial File Transfer Protocol (TFTP) server. This process is essential for network administrators to back up switch configurations and to ensure smooth recovery in case of a configuration error or hardware failure.


Pre-requisites

  1. A TFTP client such as Tftpd64.

Link to download Tftpd64: https://pjo2.github.io/tftpd64/

Through the TFTP client, ensure that the TFTP server is running and accessible by verifying the IP address of the TFTP server (in this example, 192.168.2.2).
  1. SSH/Telnet/Serial client such as PuTTY or Tera Term.

Link to download PuTTY: https://www.putty.org/

  1. Procedure for connecting to the switch via SSH, Telnet, or the console port as the following procedure will require this knowledge.

The procedure(s) to connect to the switch via SSH, Telnet, or the console port can be found in the Basic Operation Configuration Guide.


Procedure 

Set the PC IP Address

1. Navigate to the Control Panel on your Windows PC and select the View network status and tasks under the Network and Internet heading.


2. Click on the Change adapter settings in the left panel of the window.


3. In the Network Connections window, double click on the Ethernet port that will be used to access the switch. In the example below, Ethernet 2 was the port connected to the switch.


4. At the bottom of the Ethernet status menu click on the Properties button.


5. Under the “This connection uses the following items:” list heading, double click on Internet Protocol Version 4 (TCP/IPv4)


6. Click on the Use the following IP address radio button and change the IP address of your PC to an IP address within the subnet of your switch. Your switch IP address can be found using the Basic Operation Configuration Guide which will be the default IP address of 192.168.1.238. When finished entering the parameters, click on OK. In this example, the switch IP address is 192.168.2.110, so the PC IP address was set to 192.168.2.2 with a /24 subnet.


Set up the TFTP client

Open Tftpd64. Change the Current Directory to the folder you intend to have the switch config saved to on your PC. In this example, the Downloads folder was the intended directory. From the Server Interfaces dropdown select the IP address of your PC that was setup in the "Set the IP Address" section. The example IP address set was 192.168.2.2.


Commands for copying the switch configurations

1. Connect to the switch via SSH, Telnet, or the console cable and log in using your username and password. Per the Basic Operation Configuration Guide the default credentials are admin/admin. Screenshots below represent a connection to the switch through Telnet.




2. To export the current running configuration file, run the following command with your IP address inserted in place of 192.168.2.2 (192.168.2.2 was the example PC’s IP address):
      ```
      copy running-config tftp://192.168.2.2/test.cfg
      enter “y” when prompted
      ```
Expected return from the above command:


3. To export the startup configuration file, run the following command:

      ```

      copy startup.cfg tftp://192.168.2.2/test2.cfg

      enter “y” when prompted

      ```

Expected return from the above command:


This command instructs the switch to copy the startup configuration (i.e., the configuration loaded when the switch is powered on or restarted) to a TFTP server with the IP address 192.168.2.2. The file will be named "test2.cfg" on the TFTP server.

Post-steps

Verify that the configuration files have been transferred successfully by accessing your TFTP server and confirming the presence of "test.cfg" and "test2.cfg".