FortiOS

FortiOS Cheatsheet #

FortiOS is the operating system used by Fortinet’s FortiGate firewall appliances. This cheatsheet provides common commands and configurations for FortiOS.

Basic Commands #

Command/OptionExampleDescription
get system statusget system statusDisplay system status information
showshowShow current configuration
configconfigEnter global configuration mode
endendExit configuration mode
execute rebootexecute rebootReboot the device
execute backupexecute backup configBackup the current configuration
execute restoreexecute restore configRestore the configuration from a backup

Interface Configuration #

Command/OptionExampleDescription
config system interfaceconfig system interfaceEnter interface configuration mode
edit port1edit port1Edit the configuration of interface port1
set ip 192.168.1.1/24set ip 192.168.1.1/24Set IP address and subnet mask for the interface
set allowaccessset allowaccess ping http sshSet allowed access services
nextnextMove to the next interface in the list
endendExit interface configuration mode
show system interfaceshow system interfaceDisplay interface configuration and status

VLAN Configuration #

Command/OptionExampleDescription
config system interfaceconfig system interfaceEnter interface configuration mode
edit vlan10edit vlan10Edit VLAN with ID 10
set vdom rootset vdom rootAssign VLAN to a virtual domain
set interface port1set interface port1Assign the VLAN to an interface
nextnextMove to the next VLAN in the list
endendExit VLAN configuration mode
show vlanshow vlanDisplay VLAN configuration

Firewall Policy Configuration #

Command/OptionExampleDescription
config firewall policyconfig firewall policyEnter firewall policy configuration mode
edit 1edit 1Edit policy with ID 1
set name Allow_HTTPset name Allow_HTTPSet policy name
set srcintf "port1"set srcintf "port1"Set source interface
set dstintf "port2"set dstintf "port2"Set destination interface
set srcaddr allset srcaddr allSet source address
set dstaddr allset dstaddr allSet destination address
set action acceptset action acceptSet action to accept
set schedule alwaysset schedule alwaysSet schedule for the policy
set service HTTPset service HTTPSet service to HTTP
nextnextMove to the next policy in the list
endendExit firewall policy configuration mode
show firewall policyshow firewall policyDisplay firewall policies

VPN Configuration #

Command/OptionExampleDescription
config vpn ipsec phase1-interfaceconfig vpn ipsec phase1-interfaceEnter Phase 1 VPN configuration mode
edit vpn1edit vpn1Edit VPN interface with ID vpn1
set interface port1set interface port1Set interface for the VPN
set peertype anyset peertype anySet peer type for VPN
set ike-version 2set ike-version 2Set IKE version
nextnextMove to the next VPN configuration
endendExit VPN Phase 1 configuration mode
config vpn ipsec phase2-interfaceconfig vpn ipsec phase2-interfaceEnter Phase 2 VPN configuration mode
edit vpn1edit vpn1Edit Phase 2 VPN settings
set phase1-name vpn1set phase1-name vpn1Set Phase 1 interface name
set proposal aes128-sha1set proposal aes128-sha1Set encryption and hashing algorithm
nextnextMove to the next VPN configuration
endendExit VPN Phase 2 configuration mode
show vpn ipsecshow vpn ipsecDisplay IPsec VPN configuration

Management #

Command/OptionExampleDescription
get system statusget system statusDisplay system status information
get firewall policyget firewall policyDisplay firewall policies
execute rebootexecute rebootReboot the device
execute backupexecute backupBackup configuration
execute restoreexecute restoreRestore configuration
show logshow logDisplay system logs

This cheatsheet covers essential FortiOS commands for configuration, management, and troubleshooting of Fortinet devices. For detailed command syntax and additional options, consult the Fortinet documentation.

FortiOS

Explore our comprehensive cheatsheets to enhance your knowledge and efficiency. Each cheatsheet provides detailed command options, examples, and descriptions to help you master various tools and technologies.