Fortigate Commands
Fortigate Commands
get system arp Show the ARP table of the device, these are all the devices it can reach at layer 2.
get system session list Show the active sessions on the device, equivalent to netstat
get system interface physical Check the status of the hardware interfaces.
Configure system interface Enter the interface configuration section
diagnose ip arp list Know the ARP table of the device
Routing
get router info routing-table all Table of routes
diagnose ip route list detailed information of the route table
get router info routing-table details x.x.x.x Details for the IP x.x.x.
get router info kernel Complete routing/forwarding table
get router <routing-protocol> Information by routing protocol
diagnose firewall proute list PBR Information
diagnose ip rtcache list Route cache information = active sessions with routing information
VPNs
diag vpn tunnel flush <phase1 name> reset the sa session
diagnose vpn tunnel reset complete tunnel reset
Objects
Configure firewall address configure or edit an address object in the Fortigate
Configure firewall group configure or edit an address object in the Fortigate
SYSTEM/HARDWARE MANAGEMENT
(global)#set admintimeout Change the session time of the GUI interface; for telnet/ssh/console, it is in the same section.
High Availability
diagnose sys ha HA configuration context has multiple options
diagnose sys ha status Know the status of the cluster
execute ha manage? Know the ID of the cluster nodes
execute ha manage <device-index> Manage Fortigate B from A or vice versa, the device index can be 'serial' or 'device id'
diagnose system high availability show checksum
Check if the checksum matches to see if they are synchronized.
config log ? Configure the general logging options for different objects or processes GUI/memory/fortianalyzer
config log memory setting Adjust the log settings in memory, preferably disable it (uses RAM)
config log fortiguard ? Adjust the settings in FortiCloud
PERFORMANCE MANAGEMENT
DIAGNOSIS
show Show the configuration of the context in which you find yourself
get Show all available options in the context where you are.
1) Clean the Debugger Stop, clean, and reset the debug tool
diagnose debug disable
diagnose debug flow trace stop
diagnose debug flow filter clear
diagnose debug reset
2) Prepare the debug Prepare the tool by filtering the services or objects of interest, some examples:
diagnose debug flow filter addr x.x.x.x debug on a specific ip
diagnose debug flow filter saddr debug of a specific source IP
diagnose debug flow filter daddr debug of a specific destination IP
diagnose debug flow filter port x debug on a specific port
diagnose debug flow filter proto x debug proprotocol
ICMP (ping)
protocol number 6 = TCP
protocol number 17 = UDP
Complete list Unable to access external links or documents.
diagnose debug application? debug of the application or process sip/http/smtp/pop3/imap/ike/ipsmonitor/dhcpc/ddnscd
Complete list The provided link does not contain any text to translate.
diagnose debug flow trace start 50 define the number of packets to analyze
3) Run debug
Download archive
USER MANAGEMENT
SECURITY SETTINGS
Configure FailOpen
configure system globally Display the global configuration of the equipment
set av-failopen {off | pass | one-shot | idledrop}
end
Inspection with db AV Extreme Enable AV inspection with the most complete database from Fortigate.
Configure antivirus settings
set default-db normal/extended/extreme (available only on high-end devices)
Grayware scanning Run after AV, scan with your own database traffic in search of unidentified/new viruses.
configure antivirus settings
set grayware? Enable or disable grayware inspection
Configure Heuristic Inspection executes after grayware, engine executes file and tests for viruses, false positives
config antivirus heuristic ? Heuristic mode configuration options: activate/deactivate
Pass Recovery Log in with the console and restart the machine (while connected and with the session open)
config system admin
edit admin set password <newpassword>
end
global configuration If the vdoms function is enabled, use this command
configure system administrator
Backups/Restore
Execute restore <Object> Select the object to be backed up / Each object has its files