Fortinet black logo

CLI Reference

FortiOS CLI reference

FortiOS CLI reference

This document describes FortiOS 6.0 CLI commands used to configure and manage a FortiGate unit from the command line interface (CLI).

Before now, our focus was on documenting the most commonly used CLI commands, or those commands that required more explanation. Therefore, some commands have Supplemental Information sections below the CLI syntax that dive into a little extra detail.

The CLI syntax is created by processing a schema of a particular build of FortiOS 6.0, and reformatting the resulting CLI output into content that resembles the output found in the CLI console.

If you have comments on this content, its format, or requests for commands that are not included, contact us at techdoc@fortinet.com.

How this guide is organized

This document contains the following sections:

Managing Firmware with the FortiGate BIOS describes how to change firmware at the console during FortiGate unit boot-up.

Using the CLI describes how to connect to the CLI and some basics of how it works.

config describes the commands for each configuration branch of the FortiOS CLI.

execute describes execute commands.

get describes get commands.

tree describes the tree command.

Any new changes to commands since the release of FortiOS 6.0 will be shown at the top of each command.

Availability of commands and options

Some FortiOS™ CLI commands and options are not available on all FortiGate units. The CLI displays an error message if you attempt to enter a command or option that is not available. You can use the question mark ‘?’ to verify the commands and options that are available.

Commands and options may not be available for the following reasons:

FortiGate model

All commands are not available on all FortiGate models. For example, low-end FortiGate models do not support the aggregate interface type option of the config system interface command.

Hardware configuration

For example, some AMC module commands are only available when an AMC module is installed.

FortiOS Carrier, FortiGate Voice, FortiWiFi, etc

Commands for extended functionality are not available on all FortiGate models. The CLI Reference includes commands only available for FortiWiFi units, FortiOS Carrier, and FortiGate Voice units.

Disclaimer: CLI syntax parameter format

For the time being, all CLI commands in this guide display their syntax-parameters with braces, or { }. This is a departure from previous versions of the CLI Reference, which used the following criteria:

< > - Used for variables

{ } - Used for multiple settings

[ ] - Used for settings that are optional

See below for an example:

Current syntax format:

config alertemail setting

set username {string}

...

Traditional syntax format:

config alertemail setting

set username <string>

...

We will attempt to reintroduce the traditional formatting for all CLI commands and their syntaxes.

FortiOS CLI reference

This document describes FortiOS 6.0 CLI commands used to configure and manage a FortiGate unit from the command line interface (CLI).

Before now, our focus was on documenting the most commonly used CLI commands, or those commands that required more explanation. Therefore, some commands have Supplemental Information sections below the CLI syntax that dive into a little extra detail.

The CLI syntax is created by processing a schema of a particular build of FortiOS 6.0, and reformatting the resulting CLI output into content that resembles the output found in the CLI console.

If you have comments on this content, its format, or requests for commands that are not included, contact us at techdoc@fortinet.com.

How this guide is organized

This document contains the following sections:

Managing Firmware with the FortiGate BIOS describes how to change firmware at the console during FortiGate unit boot-up.

Using the CLI describes how to connect to the CLI and some basics of how it works.

config describes the commands for each configuration branch of the FortiOS CLI.

execute describes execute commands.

get describes get commands.

tree describes the tree command.

Any new changes to commands since the release of FortiOS 6.0 will be shown at the top of each command.

Availability of commands and options

Some FortiOS™ CLI commands and options are not available on all FortiGate units. The CLI displays an error message if you attempt to enter a command or option that is not available. You can use the question mark ‘?’ to verify the commands and options that are available.

Commands and options may not be available for the following reasons:

FortiGate model

All commands are not available on all FortiGate models. For example, low-end FortiGate models do not support the aggregate interface type option of the config system interface command.

Hardware configuration

For example, some AMC module commands are only available when an AMC module is installed.

FortiOS Carrier, FortiGate Voice, FortiWiFi, etc

Commands for extended functionality are not available on all FortiGate models. The CLI Reference includes commands only available for FortiWiFi units, FortiOS Carrier, and FortiGate Voice units.

Disclaimer: CLI syntax parameter format

For the time being, all CLI commands in this guide display their syntax-parameters with braces, or { }. This is a departure from previous versions of the CLI Reference, which used the following criteria:

< > - Used for variables

{ } - Used for multiple settings

[ ] - Used for settings that are optional

See below for an example:

Current syntax format:

config alertemail setting

set username {string}

...

Traditional syntax format:

config alertemail setting

set username <string>

...

We will attempt to reintroduce the traditional formatting for all CLI commands and their syntaxes.