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-configgrep -f to show the the context of the grepped
item.exec tac reportdiag debug crashlog read shows the
crashlog in a readable format.get system statusdiagnose sys tcpsockget system performance statusget 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-summarydiagnose 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 statusget system checksum statusexec ha manage 0/1diagnose sys ha hadiff statusdiagnose sys ha reset uptimediag sys checkused system.interface.name port1execute log filterexec log showconfig system interfacediagnose hardware deviceinfo nicdiagnose hardware deviceinfo nic <nic>get system arpdiag ip arp listexecute clear system arp tablediag ip arp delete <interface name> <IP address>config system arp-tableexec ping <dst>exec ping-options
exec ping-options sourceexec telnet ip:portget router info routing-table allget router info routing-table databaseget router info routing-table details <host>exec tracerouteIf 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:
icmpexecute 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 allexecute router clear ospf processget router info ospf statusdiagnose sniffer packet any 'proto 89' 4 0get router info ospf interface.get router info ospf database briefShow 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 enableLook for:
diagnose firewall ipgeo ip-listdiagnose firewall ipgeo country-listexecute update-geo-ipdiagnose sys session listdiagnose firewall statistics showget system session listIt is possible to set filters for the session list.
diagnose sys session filter cleardiagnose sys session filter ?diagnose sys session filter dst 8.8.8.8diagnose 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 0diagnose test application ssl 4diagnose test application ssl 44diag debug enable
diag debug authd fsso list
diag debug authd fsso server-status
diag debug authd fsso-summary
diagnose wad user listdiagnose 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 ratingexecute update-nowdiagnose test application ipsmonitor ? to get a
menu for the IPS monitor.diagnose ips anomaly list