Cheatsheet for FortiGate Command Line Interface CLI.
This article contains some useful FortiGate commands. Please note that not all commands work on all FortiGate versions. Not all commands are supported and some do change.
show full-config
grep -f
to show the the context of the grepped
item.exec tac report
diag debug crashlog read
shows the
crashlog in a readable format.get system status
diagnose sys tcpsock
get system performance status
get system performance top
, use
SHIFT+M
to sort on memory usage.diagnose sys top-summary
diagnose sys top-summary -h
to show the help
message for top-summary
diagnose hardware sysinfo shm
diagnose sys kill process_id 15
uses a
unconditional kill.diagnose sys kill process_id 15
uses a
graceful kill.diagnose debug enable
diagnose debug application fnbamd -1
get system ha status
get system checksum status
exec ha manage 0/1
diagnose sys ha hadiff status
diagnose sys ha reset uptime
diag sys checkused system.interface.name port1
execute log filter
exec log show
config system interface
diagnose hardware deviceinfo nic
diagnose hardware deviceinfo nic <nic>
get system arp
diag ip arp list
execute clear system arp table
diag ip arp delete <interface name> <IP address>
config system arp-table
exec ping <dst>
exec ping-options
exec ping-options source
exec telnet ip:port
get router info routing-table all
get router info routing-table database
get router info routing-table details <host>
exec traceroute
If you would like to test a traceroute for a different source IP than the one assigned to your outbound interface you can use poor-mans-traceroute.
Use this procedure:
icmp
execute ping-options timeout
to 1.execute ping-options source
to your source
IP.Use Fortinet’s recommended procedure to debug OSPF: http://kb.fortinet.com/kb/viewContent.do?externalId=FD31207
get router info ospf neighbor all
execute router clear ospf process
get router info ospf status
diagnose sniffer packet any 'proto 89' 4 0
get router info ospf interface
.get router info ospf database brief
Show list of IPSEC VPN tunnels:
get vpn ipsec tunnel summary
Show details for IPSEC VPN tunnel:
get vpn ipsec tunnel detail
Debug IKE:
diag debug application ike 63
diagnose vpn ike log-filter clear
diagnose vpn ike log-filter dst-addr 1.2.3.4
diagnose debug app ike 255
diagnose debug enable
Look for:
diagnose firewall ipgeo ip-list
diagnose firewall ipgeo country-list
execute update-geo-ip
diagnose sys session list
diagnose firewall statistics show
get system session list
It is possible to set filters for the session list.
diagnose sys session filter clear
diagnose sys session filter ?
diagnose sys session filter dst 8.8.8.8
diagnose sys session filter dport 53
diagnose debug enable
diagnose debug flow show console enable
Diag debug flow show function enable
diagnose debug flow filter add 10.10.0.1
diagnose debug flow trace start 100
diagnose sniffer packet <interface> '<tcpdump filter>'
Packets with TCP RST
flag set:
diagnose sniffer packet internal ‘tcp[13] & 4 != 0’
Packets with TCP SYN
flag set:
diagnose sniffer packet internal 'tcp[13] & 2 != 0'
Packets with TCP SYN ACK
flag set:
diagnose sniffer packet internal 'tcp[13]=18'
Packets with TCP SYN
and TCP ACK
diagnose sniffer packet internal 'tcp[13] = 18'
diagnose test application ssl 0
diagnose test application ssl 4
diagnose test application ssl 44
diag debug enable
diag debug authd fsso list
diag debug authd fsso server-status
diag debug authd fsso-summary
diagnose wad user list
diagnose test application http
execute log filter dump
execute log filter category 0
execute log filter field hostname www.google.ch
execute log display
diag debug rating
execute update-now
diagnose test application ipsmonitor ?
to get a
menu for the IPS monitor.diagnose ips anomaly list