Fortigate Commands
Fortigate Firewall Commands – Useful while troubleshooting of fortigate firewall
General Commands
- get system interface physical (overview of hardware interfaces)
- get hardware nic <nic-name> (details of a single network interface, same as: diagnose
hardware deviceinfonic [nic-name])
- fnsysctlifconfig <nic-name> (Hidden command to see more interface stats such as errors)
- get system status (show version)
- get system performance status (CPU and network usage)
- diagnose sys top (top with all forked processed)
- diagnose sys top-summary (top easier include CPU and mem bars. Forks are displayed by [x13])
- diagnoseautoupdate versions (lists the attack definition versions, last update, etc.)
- diagnose log test (generated all possible log entries)
- diagnose test application dnsproxy6 (shows the IP addresses of FQDN objects)
- diagnose debug crashlog read (shows crashlog, a status of 0 indicates a normal close of a process)
- execute dhcp lease-list
- diagnose iparp list
- diagnose ipv6 address list
- diagnose ipv6 neighbor-cache list
- diagnose sys ntp status
Firewall Routing
- get router info routing-table all
- get router <routing-protocol> (basic information about the enabled routing protocol)
- diagnose firewall proute list (policy-based routing)
- diagnose firewall proute6 list
- diagnose iprtcache list
Network Troubleshooting (Execute Commands)
- execute ping-options?
- execute ping-options source (Ip address of the interface)
- execute ping <hostname|ip>
- execute ping6-options?
- execute ping6 <hostname|ip>
- execute traceroute <hostname|ip>
- execute tracert6 <hostname|ip>
- CPU Processing Status
- diag sys top
- diag sys top-summary
- Firewall Session Table
- diagnose sys session filter clear
- diagnose sys session filter src xx.xx.xx.xx
- diagnose sys session filter dport xx
- diagnose sys session list (show the session table with the filter)
Firewall Debug
- diagnose debug reset
- diagnose debug flow filter clear
- diagnose debug flow filter saddr xx.xx.xx.xx
- diagnose debug flow filter daddr xx.xx.xx.xx
- diagnose debug flow show console enable
- diagnose debug enable
- diagnose debug flow trace start 10
- diagnose debug disable
- diagnose debug flow filter saddr
Firewall VPN
- get vpnike gateway <name>
- get vpnipsec tunnel name <name>
- get vpnipsec tunnel details
- diagnose vpn tunnel list
- diagnose vpnipsec status (shows all crypto devices with counters that are used by the VPN)
- get router info routing-table all
- get vpnike gateway <name>
VPN Debug
- diagnose debug reset
- diagnose vpnike log-filter clear
- diagnose vpnike log-filter dst-addr4 xx.xx.xx.xx
- diagnose debug app ike 255
- diagnose debug enable
- diagnose debug disable
- show vpnipsec phase2-interface | grep–f
SSL VPN
- diagnose debug reset
- diagnose debug flow filter clear
- diagnose debug application ssl -1
- diagnose debug enable
- diagnose debug flow trace start 10
- diagnose debug disable
Authentication
- diag test authserverldap LDAP-Access 123456 Customer1234$
Sniffer
- diagnose sniffer packet any “host <box1> and host <box2>”
Reset VPN Command
- diagvpn tunnel reset <phase1 name>
Firewall Failover
- diagnose sys ha reset-uptime
- get sys status (To check the firmware, Serial number)
- get sys per status
- get sys arp
- get router info vrrp
- execute ha manage (To get into secondary)
Config system settings
- set allow-subnet-overlap (enable/disable)
Firewall Disable Break
{config system console
set output standard
end}
Firewall Policy
{config firewall policy
edit 1
set status enable 1}
Firewall FSSO List
- diagnose debug authdfsso list
Total Number of Sessions
- diagnose sys session list | grep total
- diagnose sys top-summary
- dia sys kill 11 <pid>
- fortimanager output
- diagnosedvm device list
Upgrading The Firewall By CLI Mode
- Execute update-now (To update the antivirus and attack definitions)
- Make sure the TFTP server is running.
- Copy the new firmware image file to the root directory of the TFTP server
- Log into the CLI Mode
- Make sure the FortiGate unit can connect to the TFTP server.
- Execute ping xx.xx.xx.xx
- Execute restore image tftp <filename> <tftp_ipv4>
- Execute restore image tftpimage.out xx.xx.xx.xx
- This operation will replace the current firmware version)
- Do you want to continue? (yes/no)
- Execute update-now
Troubleshooting (Error After Upgrade)
- diag debug config-error-log-read