FortiGate Firewall CLI commands

The FortiAuthenticator has CLI commands that are accessed using SSH or Telnet, or through the CLI Console if a FortiAuthenticator is installed on a FortiHypervisor. The commands can be used to initially configure the unit, perform a factory reset, or reset the values if the GUI is not accessible.


Command Description
help Display list of valid CLI commands. You can also enter ? for help.
exit Terminate the CLI session.
show Display bootstrap configuration.
set port1-ip <IP/netmask> Enter the IPv4 address and netmask for the port1 interface. Netmask is expected in the /xx format, for example 192.168.0.1/24.
Once this port is configured, you can use the GUI to configure the remaining ports.
set default-gw <IP> Enter the IPv4 address of the default gateway for this interface. This is the default route for this interface.
set date <YYYY-MM-DD> Enter the current date. Valid format is four digit year, two digit month, and two digit day. For example: set date 2014-08-12 sets the date to August 12th, 2014.
set time <HH:MM:SS> Enter the current time. Valid format is two digits each for hours, minutes, and seconds. 24-hour clock is used. For example 15:10:00 is 3:10pm.
set tz <timezone_index> Enter the current time zone using the time zone index. To see a list of index numbers and their corresponding time zones, enter set tz ?.
set ha-mode {enable | disable} Enable or disable (default) HA mode.
set ha-port <interface> Select a network interface to use for communication between the two cluster members. This interface must not already have an IP address assigned and it cannot be used for authentication services. Both units must use the same interface for HA communication.
set ha-priority {high | low} Set to Low on one unit and High on the other. Normally, the unit with High priority is the master unit.
set ha-password <password> Set the HA password.
set ha-mgmt-ip <IP/netmask> Enter the IP address, with netmask, that this unit uses for HA related communication with the other FortiAuthenticator unit. Format: 1.2.3.4/24.
The two units must have different addresses. Usually, you should assign addresses on the same private subnet.
set ha-mgmt-access {ssh | https | http | telnet} Select the types of administrative access to allow.
set ha-dbg-level <level> Enter the level for HA service debug logs. Range: -4 (fatal) to 4 (debug high). Default: -2 (warn).
unset <setting> Restore default value. For each set command listed above, there is an unset command, for example unset port1-ip.
raid-add-disk <slot> Add a disk to a degraded RAID array.
ha-rebuild Rebuild the configuration database from scratch using the HA peer's configuration.
restore-admin Restore factory reset's admin access settings to the port1 network interface.
reboot Perform a hard restart of the FortiAuthenticator unit. All sessions will be terminated. The unit will go offline and there will be a delay while it restarts.
factory-reset Enter this command to reset the FortiAuthenticator settings to factory default settings. This includes clearing the user database.
This procedure deletes all changes that you have made to the FortiAuthenticator configuration and reverts the system to its original configuration, including resetting interface addresses.
shutdown Turn off the FortiAuthenticator.
status Display basic system status information including firmware version, build number, serial number of the unit, and system time.
hardware-info Display general hardware status information.
disk-attributes Display system disk attributes.
disk-errors Display any system disk errors.
disk-health Display disk health information.
disk-info Display disk hardware status information.
raid-hwinfo Display RAID hardware status information.
nslookup Basic tool for DNS debugging.
dig Advanced DNS debugging.
ping Test network connectivity to another network host.
tcpdump Examine local network traffic.
tcpdumpfile Same as tcpdump, but the output is written to a downloadable file that can be downloaded in the debug logs.
Debug logs can be accessed by using your web browser to browse to https://<FortiAuthenticator IP Address>/debug. For more information, see Debug logs.
traceroute Examine the route taken to another network host.

Keys Action
? List valid word completions or subsequent words.

If multiple words could complete your entry, display all possible completions with helpful descriptions of each.
Tab Complete the word with the next available match.

Press the Tab key multiple times to cycle through available matches.
Up arrow, or
Ctrl + P
Recall the previous command.

Command memory is limited to the current session.
Down arrow, or
Ctrl + N
Recall the next command.
Left or Right arrow Move the cursor left or right within the command line.
Ctrl + A Move the cursor to the beginning of the command line.
Ctrl + E Move the cursor to the end of the command line.
Ctrl + B Move the cursor backwards one word.
Ctrl + F Move the cursor forwards one word.
Ctrl + D Delete the current character.
Ctrl + C Abort current interactive commands, such as when entering multiple lines.

If you are not currently within an interactive command such as config or edit, this closes the CLI connection.
\ then Enter Continue typing a command on the next line for a multiline command.

For each line that you want to continue, terminate it with a backslash ( \ ). To complete the command line, terminate it by pressing the spacebar and then the Enter key, without an immediately preceding backslash.

:
https://help.fortinet.com/cli/fos60h...20CLI%7C_____3
https://help.fortinet.com/fauth/5-3/...I_commands.htm