Fortinet black logo

CLI Reference

CLI command syntax

CLI command syntax

This guide uses the following conventions to describe command syntax.

  • Angle brackets < > indicate variables.
  • Vertical bar and curly brackets {|} separate alternative, mutually exclusive required keywords.

    For example:

    set protocol {ftp | sftp}

    You can enter set protocol ftp or set protocol sftp.

  • Square brackets [ ] indicate that a variable is optional.

    For example:

    show system interface [<name_str>]

    To show the settings for all interfaces, you can enter show system interface. To show the settings for the Port1 interface, you can enter show system interface port1.

  • A space separates options that can be entered in any combination and must be separated by spaces.

    For example:

    set allowaccess {https ping}

    You can enter any of the following:

    set allowaccess ping

    set allowaccess https ping

    set allowaccess fgfm http https https-logging ping snmp soc-fabric ssh webservice

    In most cases to make changes to lists that contain options separated by spaces, you need to retype the whole list including all the options you want to apply and excluding all the options you want to remove.

  • Special characters:
    • The \ is supported to escape spaces or as a line continuation character.
    • The single quotation mark ' and the double quotation mark “ are supported, but must be used in pairs.
    • If there are spaces in a string, you must precede the spaces with the \ escape character or put the string in a pair of quotation marks.

CLI command syntax

This guide uses the following conventions to describe command syntax.

  • Angle brackets < > indicate variables.
  • Vertical bar and curly brackets {|} separate alternative, mutually exclusive required keywords.

    For example:

    set protocol {ftp | sftp}

    You can enter set protocol ftp or set protocol sftp.

  • Square brackets [ ] indicate that a variable is optional.

    For example:

    show system interface [<name_str>]

    To show the settings for all interfaces, you can enter show system interface. To show the settings for the Port1 interface, you can enter show system interface port1.

  • A space separates options that can be entered in any combination and must be separated by spaces.

    For example:

    set allowaccess {https ping}

    You can enter any of the following:

    set allowaccess ping

    set allowaccess https ping

    set allowaccess fgfm http https https-logging ping snmp soc-fabric ssh webservice

    In most cases to make changes to lists that contain options separated by spaces, you need to retype the whole list including all the options you want to apply and excluding all the options you want to remove.

  • Special characters:
    • The \ is supported to escape spaces or as a line continuation character.
    • The single quotation mark ' and the double quotation mark “ are supported, but must be used in pairs.
    • If there are spaces in a string, you must precede the spaces with the \ escape character or put the string in a pair of quotation marks.