Skip to main content
Contributor
March 4, 2020

Technical Tip: Restoring a config file from the CLI by using TFTP server

  • March 4, 2020
  • 0 replies
  • 17538 views
Description This article describes how to restore the config file from the CLI by using the TFTP server.

Consider backing up the current configuration (using the GUI or CLI commands below) before starting to restore the config file in question, so that the admin can revert to the current status if needed.

 

execute backup config

execute backup ipsuserdefsig

 

The first command backs up the configuration, and the second one backs up the IPS custom signatures, if any.

Scope FortiGate.
Solution On the PC connected to FortiGate, set up the TFTP server by downloading the preferred TFTP server application. In this example, TFTPD64 is used.

 

TFTPD64 Project Page

TFTPD64 GitHub Download Page

Once installed, place the backup config on the 'Current Directory'. Verify it by selecting 'Show Dir'. Next, choose the correct NIC that connects to the FortiGate for 'Server interfaces':

TFTPD64.png
Verify further by pinging the FortiGate and check by using the sniffer: 

Screenshot 2024-06-05 104618.png

 

Screenshot 2024-06-05 104624.png
Commands for restoring the config from TFTP are mentioned below:

 

execute restore config tftp {string} {Tftp server} {passwd}

{string}                                <- Configure file name (path) on the remote server.

{Tftp server}                        <- TFTP server IP.

{passwd}                                <- TFTP server password.        

                                                                                                                                            

 Find the following example in the CLI:

 

execute restore config tftp test.conf 10.82.2.2
This operation will overwrite the current setting and could possibly reboot the system!
Do you want to continue? (y/n)y

Please wait...
Connect to TFTP server 10.82.2.2 ...

Get file from TFTP server OK.
File check OK.

 

test.conf is the config file name, 10.82.2.2 is the IP address of the TFTP server, which is the PC that connects to FortiGate.