To format and upgrade the firmware on a FortiGate 40C, you'll need three types of cables:

  • Connect the console cable to the console port of the FortiGate and use a serial to USB converter to connect to a USB port on your laptop.
  • Connect a USB cable (the same one used with printers) to the MNG port of the FortiGate.
  • Connect an Ethernet cable to port 5 (this port is special). Connect the other end to your laptop.

Once all connections are in place, follow the steps below:

Configure Your Laptop's IP Address

Manually set your laptop's IP address:

IP: 192.168.1.168

Subnet mask: 255.255.255.0 (no need for a gateway). You can use any IP, but it’s recommended to use this one.

Install Required Software

Install the following three software tools:

If you have a configuration backup, open it with a text editor to check the firmware build number and version used for that specific configuration.

Download the appropriate firmware from the Fortinet website.

Prepare the Files

For ease of use, create a folder to store all the necessary files. For example:

C:\Users\MyName\Desktop\Fortigate_40c_Format

Make a copy of the firmware file and rename it to image.out.

Setup TFTPD32

Open TFTPD32:

  • Set the interface to the one with the IP address 192.168.1.168.
  • Set the root directory by clicking "Browse" in the TFTP server window and selecting the folder where your files are stored (C:\Users\MyName\Desktop\Fortigate_40c_Format).

Open Putty

Open Putty and set the connection type to Serial. Enter the COM port.

To find the COM port number, right-click Computer, go to Manage, then Devices. The COM port for the USB-Serial connection will be listed. In this case, it was COM4.

Set serial connection properties:

  • Data bits: 8
  • Parity: No parity
  • Stop bits: 1
  • Baud rate: 9600 (For a FortiGate-300, use 115000 baud.)

Power Cycle the FortiGate Device

Turn the power off and then back on for the FortiGate device. The console screen will begin showing output.

When the console displays the message:

"Press any key to display configuration menu."

Press any key to continue.

Now you’ll see the following options:


[G]: Get firmware image from TFTP server.
[F]: Format boot device.
[B]: Boot with backup firmware and set as default.
[Q]: Quit menu and continue to boot with default firmware.
[H]: Display this list of options.
  

Select F to format the boot device.

Note: Some console prompts in this procedure include default values in square brackets, such as [image.out]. To use the default value, simply press Enter.

Once the formatting is complete, the device will restart. Repeat the steps, but this time select G to "Get firmware image from TFTP server."

Set the TFTP Server IP

When prompted for the IP address of the TFTP server, press Enter to use 192.168.1.168 (or enter the IP you assigned to your laptop).

Next, the console will prompt for the IP address of the FortiGate:

"Enter local address [192.168.1.188]: "

Press Enter to proceed with the default value.

When prompted for the firmware file name:

"Enter firmware image file name [image.out]:"

Press Enter to use image.out as the firmware file.

The FortiGate will begin downloading the firmware from the TFTP server and display progress:


MAC: 001122B15D94
########################### (transfer progress)
Total 28385179 bytes data downloaded.
Verifying the integrity of the firmware image..
  

If prompted with "Save as Default firmware/Backup firmware/Run image without saving [D/B/R]?", type D to save the firmware as the default firmware.

If the download fails with an error such as "invalid compressed format," the process will retry automatically.

Complete the Firmware Installation

Once the firmware is installed, the device will restart. You have successfully installed the firmware.

Access the Device via FortiExplorer

Open the FortiExplorer software. It will detect the connected device through the MNG USB cable.

From the available options, select the Web GUI and log in with the default credentials:

  • Username: admin
  • Password: (blank)

If you can log in and the window loads correctly, you can restore your configuration file through the GUI.

Note: This app provides non-IP dependent access to the device (out-of-band access).

Restore Your Configuration

Once logged in, use the wizard to configure the basic settings (IP, username, password, etc.). Afterward, ensure your laptop and FortiGate are on the same subnet.

Open a browser and navigate to the IP address of the FortiGate device. Log in with the username and password you set in the wizard.

In the dashboard, select the Restore option and choose the backup config file. Click restore, and the FortiGate will apply the configuration and restart.

You can monitor the process in the console window.

Once the system initializes, you can ping the FortiGate IP to ensure connectivity:

ping -t

Wait until you start receiving responses from the FortiGate device.

Once the system has finished, log in with your old username and password from the backup config, if needed.

Final Step

Your device is now formatted, firmware has been installed, and the configuration has been restored. Finally, register the device through the portal to activate your FortiCare licenses.