Objective

The Backup Configuration File or log of the switch is useful for troubleshooting or if the device accidentally gets reset. This contains manual copies of files used for protection against system shutdown or for the maintenance of a specific operating state. For instance, you can copy and save the Mirror Configuration, Startup Configuration, or Running Configuration to a Backup file. You can use this file to update or restore the switch back to its functional state.

The Backup Configuration File can be saved on the Internal Flash memory or a USB device attached on your switch, a Trivial File Transfer Protocol (TFTP) server, a Secure Copy (SCP) server, or on your computer. This article will guide you on how to download or back up a system configuration file through the Command Line Interface (CLI) of the switch using any of the following methods:

- Via TFTP — The Trivial File Transfer Protocol (TFTP) method is chosen to download or back up configuration file via TFTP. TFTP is mainly used to boot up computers in LAN, and is also suitable to download files.

- Via SCP (Over SSH) — The Secure Copy (SCP) (Over (SSH)) method is chosen to download or back up configuration file via Secure Shell (SSH). This download or back up of configuration files are done over a secure network.

Note: To learn how to download or back up configuration files on your Sx300 or Sx500 switch through the web-based utility, click here.

Applicable Devices

- Sx300 Series

- Sx500 Series

Software Version

- 1.4.7.6

Back Up Configuration Files

Step 1. Log in to the switch console. The default username and password is cisco/cisco. If you have configured a new username or password, enter the credentials instead.

Note: To learn how to access an SMB switch CLI through SSH or Telnet, click here.

Note: The commands may vary depending on the exact model of your switch. In this example, the SG300-28 switch is accessed through Telnet.

Step 2. To back up a configuration file to a specific destination, enter the following:

SG350X#copy [running-config | startup-config] [dst-url] [exclude | include-encrypted | include-plaintext]

The parameters are:

- running-config — The configuration file that contains the current configuration, including any changes applied in any management sessions since the last reboot.

- startup-config — The configuration file that is saved to flash memory.

- dst-url — The URL of the destination file or the directory to be copied. The predefined URL aliases cannot be configured.

- tftp:// — Source URL (tftp://ip-address/filename) for a file on a TFTP network server from which to download.

- scp:// — Source URL (scp://[username:password@]host/filename) for a file on an SCP server from which to download using SSH client. Before you proceed with the SCP method, make sure that SSH server authentication is enabled and the corresponding settings have been configured. For instructions on how to configure SSH authentication settings on your switch through the CLI, click here.

- exclude — The file does not include sensitive data in the file being copied.

- include-encrypted — The file includes sensitive data in its encrypted form. This secure option is applied by default, if no secure option is configured.

- include-plaintext — The file includes sensitive data in its plaintext form.

Guidelines:

Use the copy running-config dst-url command to copy the current configuration file to a network server such as TFTP or SCP.

Use the copy startup-config dst-url command to copy the startup configuration file to a network server.

TFTP:

Note: In this example, the running configuration file in plaintext form is saved to the TFTP server with IP address 192.168.100.139.

SCP:

Note: In this example, the running configuration file in plaintext form is saved to the SCP server with IP address 192.168.100.139 and credentials cisco and cisco12345 as the username and password, respectively.

You should now have successfully backed up the configuration files from your switch to a network server through the CLI.

Download Configuration Files

Step 1. Log in to the switch console. The default username and password is cisco/cisco. If you have configured a new username or password, enter the credentials instead.

Note: The commands may vary depending on the exact model of your switch. In this example, the SG300-28 switch is accessed through Telnet.

Step 2. To copy a configuration file from a specific source, enter the following:

SG350X#copy [src-url] [running-config | startup-config]

The parameters are:

- src-url — The location URL of the source file to be copied. The predefined URL aliases can be configured. The options are:

- tftp:// — Source URL (tftp://ip-address/filename) for a file on a TFTP network server from which to download.

- scp:// — Source URL (scp://[username:password@]host/filename) for a file on an SCP server from which to download using SSH client.

- running-config — The configuration file that contains the current configuration, including any changes applied in any management sessions since the last reboot.

- startup-config — The configuration file that is saved to flash memory.

Guidelines:

- Use the copy src-url running-config command to load a configuration file from a network server to the running configuration file of the switch. The commands in the loaded configuration file are added to those in the running configuration file as if the commands were typed in the CLI. The resulting configuration file is a combination of the previous running configuration and the loaded configuration files, with the loaded configuration file taking precedence.

- Use the copy src-url startup-config command to copy a configuration file from a network server to the device startup configuration file. The startup configuration file is replaced by the copied configuration file.

TFTP:

Note: In this example, the backed up running configuration file named running-config.txt from a TFTP server with IP address 192.168.100.139 is downloaded as the startup configuration file of the switch.

SCP:

Note: In this example, the backed up running configuration file named config.txt from an SCP server with IP address 192.168.100.139 is downloaded as the startup configuration file of the switch. The credentials used are cisco and cisco12345 as the username and password.

Step 3. Press Y on your keyboard to overwrite the existing configuration file.

TFTP:

SCP:

You should now have successfully downloaded the configuration file into the switch through the CLI.