When entering a command, the command line interface (CLI) requires that you use valid syntax and conform to expected input constraints. It will reject invalid commands.
Fortinet documentation uses the conventions below to describe valid command syntax.
Each command line consists of a command word that is usually followed by words for the configuration data or other specific item that the command uses or affects:
get system admin
To describe the function of each word in the command line, especially if that nature has changed between firmware versions, Fortinet uses terms with the following definitions.
Command syntax terminology
- command — A word that begins the command line and indicates an action that the FortiGate unit should perform on a part of the configuration or host on the network, such as
execute. Together with other words, such as fields or values, that end when you press the Enter key, it forms a command line. Exceptions include multiline command lines, which can be entered using an escape sequence.
Valid command lines must be unambiguous if abbreviated. Optional words or other command line permutations are indicated by syntax notation.
- sub-command — A kind of command that is available only when nested within the scope of another command. After entering a command, its applicable sub-commands are available to you until you exit the scope of the command, or until you descend an additional level into another sub-command. Indentation is used to indicate levels of nested commands.
Not all top-level commands have sub-commands. Available sub-commands vary by their containing scope.
- object — A part of the configuration that contains tables and / or fields. Valid command lines must be specific enough to indicate an individual object.
- table — A set of fields that is one of possibly multiple similar sets which each have a name or number, such as an administrator account, policy, or network interface. These named or numbered sets are sometimes referenced by other parts of the configuration that use them.
- field — The name of a setting, such as
hostname. Fields in some tables must be configured with values. Failure to configure a required field will result in an invalid object configuration error message, and the FortiGate unit will discard the invalid table.
- value — A number, letter, IP address, or other type of input that is usually your configuration setting held by a field. Some commands, however, require multiple input values which may not be named but are simply entered in sequential order in the same command line. Valid input types are indicated by constraint notation.
- option — A kind of value that must be one or more words from of a fixed set of options.
Indentation indicates levels of nested commands, which indicate what other sub-commands are available from within the scope. For example, the
edit sub-command is available only within a command that affects tables, and the
next sub-command is available only from within the
config system interface
set status up
Brackets, braces, and pipes are used to denote valid permutations of the syntax. Constraint notations, such as
<address_ipv4>, indicate which data types or string patterns are acceptable value input.
Command syntax notation
||A non-required word or series of words. For example:
indicates that you may either omit or type both the
||A word constrained by data type. The angled brackets contain a descriptive name followed by an underscore ( _ ) and suffix that indicates the valid data type. For example,
Data types include:
||A word or series of words that is constrained to a set of options delimited by either vertical bars or spaces. You must enter at least one of the options, unless the set of options is surrounded by square brackets
|Options delimited by vertical bars
||Mutually exclusive options. For example:
indicates that you must enter either
|Options delimited by spaces||Non-mutually exclusive options. For example:
indicates that you may enter all or a subset of those options, in any order, in a space-delimited list, such as: