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/Option | Example | Description |
---|
get system status | get system status | Display system status information |
show | show | Show current configuration |
config | config | Enter global configuration mode |
end | end | Exit configuration mode |
execute reboot | execute reboot | Reboot the device |
execute backup | execute backup config | Backup the current configuration |
execute restore | execute restore config | Restore the configuration from a backup |
Interface Configuration
#
Command/Option | Example | Description |
---|
config system interface | config system interface | Enter interface configuration mode |
edit port1 | edit port1 | Edit the configuration of interface port1 |
set ip 192.168.1.1/24 | set ip 192.168.1.1/24 | Set IP address and subnet mask for the interface |
set allowaccess | set allowaccess ping http ssh | Set allowed access services |
next | next | Move to the next interface in the list |
end | end | Exit interface configuration mode |
show system interface | show system interface | Display interface configuration and status |
VLAN Configuration
#
Command/Option | Example | Description |
---|
config system interface | config system interface | Enter interface configuration mode |
edit vlan10 | edit vlan10 | Edit VLAN with ID 10 |
set vdom root | set vdom root | Assign VLAN to a virtual domain |
set interface port1 | set interface port1 | Assign the VLAN to an interface |
next | next | Move to the next VLAN in the list |
end | end | Exit VLAN configuration mode |
show vlan | show vlan | Display VLAN configuration |
Firewall Policy Configuration
#
Command/Option | Example | Description |
---|
config firewall policy | config firewall policy | Enter firewall policy configuration mode |
edit 1 | edit 1 | Edit policy with ID 1 |
set name Allow_HTTP | set name Allow_HTTP | Set policy name |
set srcintf "port1" | set srcintf "port1" | Set source interface |
set dstintf "port2" | set dstintf "port2" | Set destination interface |
set srcaddr all | set srcaddr all | Set source address |
set dstaddr all | set dstaddr all | Set destination address |
set action accept | set action accept | Set action to accept |
set schedule always | set schedule always | Set schedule for the policy |
set service HTTP | set service HTTP | Set service to HTTP |
next | next | Move to the next policy in the list |
end | end | Exit firewall policy configuration mode |
show firewall policy | show firewall policy | Display firewall policies |
VPN Configuration
#
Command/Option | Example | Description |
---|
config vpn ipsec phase1-interface | config vpn ipsec phase1-interface | Enter Phase 1 VPN configuration mode |
edit vpn1 | edit vpn1 | Edit VPN interface with ID vpn1 |
set interface port1 | set interface port1 | Set interface for the VPN |
set peertype any | set peertype any | Set peer type for VPN |
set ike-version 2 | set ike-version 2 | Set IKE version |
next | next | Move to the next VPN configuration |
end | end | Exit VPN Phase 1 configuration mode |
config vpn ipsec phase2-interface | config vpn ipsec phase2-interface | Enter Phase 2 VPN configuration mode |
edit vpn1 | edit vpn1 | Edit Phase 2 VPN settings |
set phase1-name vpn1 | set phase1-name vpn1 | Set Phase 1 interface name |
set proposal aes128-sha1 | set proposal aes128-sha1 | Set encryption and hashing algorithm |
next | next | Move to the next VPN configuration |
end | end | Exit VPN Phase 2 configuration mode |
show vpn ipsec | show vpn ipsec | Display IPsec VPN configuration |
Management
#
Command/Option | Example | Description |
---|
get system status | get system status | Display system status information |
get firewall policy | get firewall policy | Display firewall policies |
execute reboot | execute reboot | Reboot the device |
execute backup | execute backup | Backup configuration |
execute restore | execute restore | Restore configuration |
show log | show log | Display 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.