Fortinet white logo
Fortinet white logo

User Guide

Command Line Interface (CLI) Reference

Command Line Interface (CLI) Reference

You are required to set up a new password after logging in for the first time. The password must be 8-12 characters long. Open the CLI and log in as the admin user (admin). Change the password at the admin prompt and the CLI administration menu is displayed.

The following commands are supported for FortiGuest.

Configuration Commands

The following commands are available to configure FortiGuest.

Command

Parameters

Description

config system interface

?

Displays the various parameters available for this command.

edit <interface port>

Edit the interface port and enter the port setting mode in the CLI.

?

Displays the various parameters available for this command.

abort

Aborts the port setting mode and exits.

next

Returns to the interface configuration mode.

set mode <static|DHCP>

Configure the port IP address mode; static or DHCP.

set ip <IP/netmask>

Configure the port IP address (static).

set allowaccess <ssh|https|http|ping>

Configure the admin access type; SSH, HTTP, HTTPS, Ping, or SNMP.

unset ip

Removes the configured IP address.

unset allowaccess <ssh|https|http|ping>

Removes the specified admin access.

unset mode

Sets the port IP addressing to default mode.

unset dns-server-override

Sets the dns-server-override to default setting.

get

Obtain the system information.

show

Displays the current interface configuration details.

end

Exit the port configuration mode; the configuration changes then take effect.

config system

admin

Configures admin users.

edit admin - Edit admin user details.

set password - Set the admin user password.

dns

Configures DNS and enters the DNS configuration mode.

set primary - Configures the primary DNS server.

global

Configures global settings and enters the global configuration mode.

interface

Configures the system interface.

ntp

Configures system NTP information.

  • set ntpsync - Enable/disable the system time by synchronizing with the NTP server.

  • set ntpserver - Configure the IP address or hostname of the NTP servers (up to 10).

config route

static

Edit the IPv4 static routing tables and enter route configuration mode.

Show Commands

The following commands can be used for viewing configuration information.

Command

Parameters

Description

show

Displays bootstrap configuration.

show full-configuration

Displays all configuration (includes defaults).

Diagnostic Commands

The following commands are used to diagnose and troubleshoot issues.

Command

Parameters

Description

diagnose

?

Displays the various parameters available for this command.

hardware ?

Displays the various parameters available for this command.

hardware deviceinfo disk

Displays information of all disks.

hardware deviceinfo nic

Display the available list of NICs.

hardware deviceinfo <nic name>

Displays information of a specific NIC.

hardware lspci

Displays the PCI parameters.

hardware lspci tree

Displays PCI bus tree.

hardware lspci verbose

Displays detailed information about all devices.

hardware sysinfo ?

Displays the various parameters available for this command.

hardware sysinfo cpu

Displays detailed information for all installed CPU(s).

hardware sysinfo interrupts

Displays details of system interruptions.

hardware sysinfo iomem

Displays the memory map of I/O ports.

hardware sysinfo ioports

Display the address list of I/O ports.

hardware sysinfo memory

Displays the system memory details.

hardware sysinfo mtrr

Displays the memory type range register.

hardware sysinfo slab

Displays the memory allocation information.

diagnose service

log

Displays service logs.

start

Starts the specified service.

status

Displays the status of service.

stop

Stops the specified service.

diagnose debug cache

get

Displays the Redis cache.

hget

Displays the Redis cache.

Management Commands

The following enable some management and other operations in FortiGuest.

Command

Parameters

Description

execute

?

Displays the various parameters available for this command.

date <YYYY-MM-DD>

Set the date in the YYYY-MM-DD format.

time <HH:MM:SS>

Set the time in the HH:MM:SS format.

factoryreset

Resets all the three data disks to the factory default settings and reboots the device.

formatlogdisk

Formats the log disk and reboots the device.

ping <destination>

Ping the host name or IPv4 address.

traceroute <destination>

Traceroute of the host name or IPv4 address.

reboot

Reboot the system.

shutdown

Shut down the device.

sysctl sh

Enter shell environment.

backup config ftp <filepath> <ftp server>[:port] [ftp_user] [ftp_passwd]

Creates a remote backup of the configuration file using FTP.

backup config tftp <filename> <tftp server>

Creates a remote backup of the configuration file using TFTP server.

restore config ftp <filepath> <ftp server>[:port] [ftp_user] [ftp_passwd]

Restores the configuration file from an FTP server using specific details.

restore config tftp <filepath> <tftp server>

Restores the configuration file from a TFTP server.

restore image ftp <filename string> <ftp server>[:port] [ftp_user] [ftp_passwd]

Restores the firmware image from an FTP server using specific details.

restore image tftp <filename string> <tftp server>

Restores the firmware image from a TFTP server.

System Information

The following commands information related to the system configurations.

Command

Parameters

Description

get system

?

Displays the various parameters available for this command.

status

Displays system status, such as, version, serial number, BIOS details, time stamp, hostname, and so on.

admin

Displays the configuration details of the admin users.

admin <username>

Displays the configuration details of a specific admin user.

dns

Displays the DNS configuration.

global

Displays the configuration details of global attributes.

interface

Displays the interface details, status, and IP address.

interface <port>

Displays the port details, status, and IP address.

ntp

Displays the configuration details and status of NTP server.

Command Line Interface (CLI) Reference

Command Line Interface (CLI) Reference

You are required to set up a new password after logging in for the first time. The password must be 8-12 characters long. Open the CLI and log in as the admin user (admin). Change the password at the admin prompt and the CLI administration menu is displayed.

The following commands are supported for FortiGuest.

Configuration Commands

The following commands are available to configure FortiGuest.

Command

Parameters

Description

config system interface

?

Displays the various parameters available for this command.

edit <interface port>

Edit the interface port and enter the port setting mode in the CLI.

?

Displays the various parameters available for this command.

abort

Aborts the port setting mode and exits.

next

Returns to the interface configuration mode.

set mode <static|DHCP>

Configure the port IP address mode; static or DHCP.

set ip <IP/netmask>

Configure the port IP address (static).

set allowaccess <ssh|https|http|ping>

Configure the admin access type; SSH, HTTP, HTTPS, Ping, or SNMP.

unset ip

Removes the configured IP address.

unset allowaccess <ssh|https|http|ping>

Removes the specified admin access.

unset mode

Sets the port IP addressing to default mode.

unset dns-server-override

Sets the dns-server-override to default setting.

get

Obtain the system information.

show

Displays the current interface configuration details.

end

Exit the port configuration mode; the configuration changes then take effect.

config system

admin

Configures admin users.

edit admin - Edit admin user details.

set password - Set the admin user password.

dns

Configures DNS and enters the DNS configuration mode.

set primary - Configures the primary DNS server.

global

Configures global settings and enters the global configuration mode.

interface

Configures the system interface.

ntp

Configures system NTP information.

  • set ntpsync - Enable/disable the system time by synchronizing with the NTP server.

  • set ntpserver - Configure the IP address or hostname of the NTP servers (up to 10).

config route

static

Edit the IPv4 static routing tables and enter route configuration mode.

Show Commands

The following commands can be used for viewing configuration information.

Command

Parameters

Description

show

Displays bootstrap configuration.

show full-configuration

Displays all configuration (includes defaults).

Diagnostic Commands

The following commands are used to diagnose and troubleshoot issues.

Command

Parameters

Description

diagnose

?

Displays the various parameters available for this command.

hardware ?

Displays the various parameters available for this command.

hardware deviceinfo disk

Displays information of all disks.

hardware deviceinfo nic

Display the available list of NICs.

hardware deviceinfo <nic name>

Displays information of a specific NIC.

hardware lspci

Displays the PCI parameters.

hardware lspci tree

Displays PCI bus tree.

hardware lspci verbose

Displays detailed information about all devices.

hardware sysinfo ?

Displays the various parameters available for this command.

hardware sysinfo cpu

Displays detailed information for all installed CPU(s).

hardware sysinfo interrupts

Displays details of system interruptions.

hardware sysinfo iomem

Displays the memory map of I/O ports.

hardware sysinfo ioports

Display the address list of I/O ports.

hardware sysinfo memory

Displays the system memory details.

hardware sysinfo mtrr

Displays the memory type range register.

hardware sysinfo slab

Displays the memory allocation information.

diagnose service

log

Displays service logs.

start

Starts the specified service.

status

Displays the status of service.

stop

Stops the specified service.

diagnose debug cache

get

Displays the Redis cache.

hget

Displays the Redis cache.

Management Commands

The following enable some management and other operations in FortiGuest.

Command

Parameters

Description

execute

?

Displays the various parameters available for this command.

date <YYYY-MM-DD>

Set the date in the YYYY-MM-DD format.

time <HH:MM:SS>

Set the time in the HH:MM:SS format.

factoryreset

Resets all the three data disks to the factory default settings and reboots the device.

formatlogdisk

Formats the log disk and reboots the device.

ping <destination>

Ping the host name or IPv4 address.

traceroute <destination>

Traceroute of the host name or IPv4 address.

reboot

Reboot the system.

shutdown

Shut down the device.

sysctl sh

Enter shell environment.

backup config ftp <filepath> <ftp server>[:port] [ftp_user] [ftp_passwd]

Creates a remote backup of the configuration file using FTP.

backup config tftp <filename> <tftp server>

Creates a remote backup of the configuration file using TFTP server.

restore config ftp <filepath> <ftp server>[:port] [ftp_user] [ftp_passwd]

Restores the configuration file from an FTP server using specific details.

restore config tftp <filepath> <tftp server>

Restores the configuration file from a TFTP server.

restore image ftp <filename string> <ftp server>[:port] [ftp_user] [ftp_passwd]

Restores the firmware image from an FTP server using specific details.

restore image tftp <filename string> <tftp server>

Restores the firmware image from a TFTP server.

System Information

The following commands information related to the system configurations.

Command

Parameters

Description

get system

?

Displays the various parameters available for this command.

status

Displays system status, such as, version, serial number, BIOS details, time stamp, hostname, and so on.

admin

Displays the configuration details of the admin users.

admin <username>

Displays the configuration details of a specific admin user.

dns

Displays the DNS configuration.

global

Displays the configuration details of global attributes.

interface

Displays the interface details, status, and IP address.

interface <port>

Displays the port details, status, and IP address.

ntp

Displays the configuration details and status of NTP server.