Description | This article describes how to download and upload the configuration on a FortiSwitch using FTP/TFTP through CLI commands, with a PC connected to the FortiSwitch's management port. |
Scope | Fortiswitch v7.2, v7.4. |
Solution |
Topology:
In this example:
config system interface
Note:
From FortiSwitch:
S648FFTXXXXXXXX # execute ping 192.168.1.100
From PC:
TestPC> ping 192.168.1.99
Download FortiSwitch Configuration to an FTP Server.
Note: The FortiSwitch does not reboot during this process.
S648FFTXXXXXXXX # execute backup config ftp <Filename/FTP-path> <ftp server>[:ftp port] <FTP-username> <FTP-password> <passwd>
<Filename/FTP-path> <----- <string> Define a file name/path on the FTP server. <ftp server>[:ftp port] <----- Specify the FTP server (IPv4, IPv6, or FQDN). (if changed default ftp port then specify in the command). <FTP-username> <----- FTP username (based on FTP server configuration). <FTP-password> <----- FTP password (based on FTP server configuration). <passwd> <----- (Optional) password to protect the backup content.
Example:
S648FFTXXXXXXXX # execute backup config ftp test.conf 192.168.1.100 admin admin123 test123
Connect to ftp server 192.168.1.100 ...
The above command demonstrates that the backup configuration is saved to the FTP server (PC 192.168.1.100) with the configuration file named 'test. conf'. 'admin' and 'admin123' are the FTP username and password, respectively. The password 'test123' is used to encrypt the content, which is optional and can be skipped. If the <passwd> (test123) is not used, the configuration file will be in a clear, readable format.
If the <passwd> is used in the command, ensure to keep a record of the password, as it will be required when restoring the configuration on the FortiSwitch.
Upload Configuration from FTP Server to FortiSwitch.
Note: The FortiSwitch will reboot during this process.
S648FFTXXXXXXXX # execute restore config ftp test.conf 192.168.1.100 admin admin123 test123
Here is the command to get the config from the TFTP server using restore.
S648FFTXXXXXXXX # execute restore config ftp test.conf 192.168.1.100 admin admin123 test123
Please wait... Connect to ftp server 192.168.1.100 ...
Note: If the configuration file was encrypted using the password during the process mentioned in 'Download the FortiSwitch config to an FTP server', and if the password is either not provided or incorrect during the restoration process, the FortiSwitch will fail to restore the configuration. Below is the error that might be noticed when failed:
S648FFTXXXXXXXX # execute restore config ftp test.conf 192.168.1.100 admin admin123 Please wait... Connect to ftp server 192.168.1.100 ...
Download FortiSwitch Configuration to a TFTP Server.
Note: The FortiSwitch does not reboot during this process.
S648FFTXXXXXXXX # execute backup config tftp <Filename/TFTP-path> <tftp server> <passwd>
<Filename/TFTP-path> <----- <string> Make a file name(path) on the FTP server. <tftp server> <----- FTP server IPv4, IPv6, or FQDN can be attached with port. <passwd> <----- (Optional) password to protect the backup content.
S648FFTXXXXXXXX # execute backup config tftp testtftp.conf 192.168.1.100 test123
The above command shows that the backup configuration is saved to the TFTP server (PC 192.168.1.100) using TFTP, with the configuration file named 'testtftp.conf'. The password 'test123' is used to encrypt the configuration content.
Note: If the <passwd> is used in the command, ensure to keep a record of the password, as it will be required when restoring the configuration on the FortiSwitch.
Upload Configuration from TFTP Server to FortiSwitch.
Note: The FortiSwitch will reboot during this process.
S648FFTXXXXXXXX # execute restore config tftp test.conf 192.168.1.100 test123 Please wait... Connect to tftp server 192.168.1.100 ... Get config file from tftp server OK.
Note: If the configuration file was encrypted using the password during the process mentioned in 'Download the FortiSwitch config to an TFTP server', and if the password is either not provided or incorrect during the restoration process, the FortiSwitch will fail to restore the configuration. Below is the error that might noticed:
S648FFTXXXXXXXX # execute restore config tftp test.conf 192.168.1.100 Please wait... Connect to tftp server 192.168.1.100 ... Get config file from tftp server OK.
To verify the config was restored run the following command:
S648FFTXXXXXXXX # execute revision list config
ID TIME ADMIN FIRMWARE VERSION COMMENT
The same command can be applied for remote TFTP/FTP servers, provided that:
|
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2025 Fortinet, Inc. All Rights Reserved.