• Contact
  • About Me
  • Privacy Policy
  • Disclaimer
DefenceDev
  • Home
  • Blog
  • Linux Tutorials
    • Bash Scripting Lessons
    • Commands
    • Networking
    • Bash Scripts
  • Solutions
    • Docker
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Cloud
  • Video Tutorials
    • YouTube Channel
    • MikroTik Videos
No Result
View All Result
  • Home
  • Blog
  • Linux Tutorials
    • Bash Scripting Lessons
    • Commands
    • Networking
    • Bash Scripts
  • Solutions
    • Docker
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Cloud
  • Video Tutorials
    • YouTube Channel
    • MikroTik Videos
No Result
View All Result
DefenceDev
No Result
View All Result
ADVERTISEMENT
Home Network Tutorials FortiGate

My Ultimate FortiGate Command Cheat Sheet

neo by neo
July 30, 2025
in FortiGate
0
My Ultimate FortiGate Command Cheat Sheet

My Ultimate FortiGate Command Cheat Sheet

0
SHARES
93
VIEWS
Share on FacebookShare on Twitter
Table of Contents
  • FortiGate Command Cheat Sheet
    • Device Diagnostics
    • IP Settings and Routing
    • Policy Settings
    • Packet Capture
    • VPN (Site-to-Site) Troubleshooting
    • Logging and Logs Review
    • Firmware and Updates
    • User Access and Admin
    • DNS and Connectivity
  • Conclusion

FortiGate Command Cheat Sheet

This guide covers the most important FortiGate CLI commands that every network administrator should know.

Working with FortiGate firewalls often requires diving into the CLI to get deeper insights and perform advanced troubleshooting. While the GUI is intuitive for many tasks, the command-line interface (CLI) gives you speed, precision, and access to powerful diagnostic tools.

In this article, you’ll find a categorized list of useful FortiGate CLI commands covering everything from system diagnostics to routing, firewall policies, packet capture, and VPN troubleshooting. Whether you’re maintaining a production environment or investigating a tricky issue, these commands will help you get the job done efficiently.

Device Diagnostics

Monitoring the system health and performance of a FortiGate device is essential for detecting and resolving issues early. Here are some of the most important diagnostic commands:

CommandDescription
get system statusDisplays basic system info such as hostname, firmware version, and serial number.
get system performance topSimilar to Linux’s top command – shows real-time CPU/memory usage and active sessions.
diag sys topA more detailed view of running processes, sorted by CPU usage.
diag hardware deviceinfoShows detailed hardware information.
diag debug crashlog readReads crash logs for analyzing system stability issues.
get system performance statusQuick summary of CPU, memory, sessions, and more.
diag sys flash listDisplays information about the flash memory, which can be useful when checking storage health.

Tip: Run these commands during high load or suspected slowness to identify resource bottlenecks.

IP Settings and Routing

CommandDescription
get system interfaceLists interfaces with IP addresses and statuses.
get router info routing-table allShows the complete routing table.
get router info routing-table databaseDisplays the underlying routing database.
diag ip route listShows active routes currently in use.
diag netlink interface listDisplays low-level interface info including physical links.

Useful Examples

If you’d like to dive deeper into routing-related topics, feel free to check out the following articles where I explain these features in more detail:

  • How to Check the Routing Table in FortiGate CLI – A step-by-step guide on how to display and analyze the routing table directly from the command line.
  • How to Configure a Static Route on FortiGate – Learn how to create and manage static routes for better traffic control in your FortiGate firewall.

These tutorials provide practical examples and screenshots, making it easier to apply what you learn in real environments.

Policy Settings

CommandDescription
show firewall policyLists all firewall policies.
diagnose firewall iprope listShows how policies are applied to traffic.
diag debug flowAnalyzes how traffic flows through policies (requires enabling debug).
show full-configuration firewall policyDisplays complete firewall policy configuration with comments.

Useful Examples

For a more in-depth look at configuring and optimizing firewall policies on FortiGate, make sure to check out these related posts:

  • Fortinet FortiGate Policy Implementation – This article walks you through the process of creating and managing firewall policies, with practical tips and examples.
  • Fortinet FortiGate Firewall Policies – Best Practices – Learn how to structure and organize your policies for improved security and easier maintenance.

These resources complement the CLI commands by showing how to apply policy settings effectively in both the GUI and CLI environments.

Packet Capture

CommandDescription
diag sniffer packet any 'host x.x.x.x' 4Captures packets for a specific host.
diag sniffer packet any 'port 443' 6Filters capture to HTTPS traffic.
diag debug flowEnables flow debugging for traffic analysis.
diag debug enable / disableStarts or stops debug mode (needed for flow analysis).
GUI Packet CaptureAvailable under Network > Packet Capture, useful for visual analysis.

Useful Examples

If you’re interested in a step-by-step walkthrough of capturing packets using both the CLI and GUI, take a look at this detailed guide:

  • FortiGate Packet Capture from CLI and GUI – Learn how to perform packet captures efficiently, filter traffic, and analyze results using built-in FortiGate tools.

This article is perfect if you want to visualize traffic flow or troubleshoot specific communication issues between devices.

VPN (Site-to-Site) Troubleshooting

CommandDescription
diag vpn tunnel listLists all active VPN tunnels.
get vpn ipsec tunnel summaryShows tunnel status and stats.
diag debug application ike -1Enables IKE debugging (for IPSec VPN).
diag debug enable / disableStarts/stops general debug logging.
get vpn ssl monitorMonitors SSL VPN sessions.

Useful Examples

For a practical guide on identifying and resolving VPN tunnel issues, check out the article below:

  • Fortinet FortiGate Site-to-Site VPN Troubleshooting – This post explains how to verify tunnel status, read debug output, and solve common configuration problems using FortiGate CLI tools.

It’s especially helpful when your VPN tunnels are not coming up or experiencing intermittent drops.

Logging and Logs Review

CommandDescription
execute log displayDisplays log entries in the CLI.
execute log filter category eventFilters logs by category.
diagnose debug application logd -1Enables debug for the logging daemon.

Useful Examples

Understanding how to properly manage and analyze logs is crucial for detecting issues and auditing network activity. For a complete overview, check out the following article:

ADVERTISEMENT
  • Fortinet FortiGate Log Management – Learn how to view, filter, and interpret FortiGate logs using both the CLI and GUI. This guide also covers log categories and best practices for retaining critical data.

Whether you’re troubleshooting or reviewing events for compliance, effective log management is essential.

ADVERTISEMENT

Firmware and Updates

CommandDescription
get system firmwareShows current firmware version.
execute update-nowManually trigger a system update.
diagnose autoupdate versionDisplays update version info.

Useful Examples

Upgrading FortiGate firmware is a key part of keeping your system secure and stable. If you’re unsure about the correct upgrade steps or need guidance on version compatibility, the following resources will help:

  • Fortinet FortiGate Upgrade Path Tool – Learn how to use Fortinet’s official upgrade path tool to avoid skipping critical firmware versions.
  • Fortinet FortiGate Firmware Upgrade – A complete guide on preparing for, executing, and verifying a firmware upgrade on your FortiGate device.

Following best practices during upgrades minimizes downtime and ensures system integrity.

User Access and Admin

CommandDescription
get system adminShows admin users and their roles.
show system adminDisplays configuration of admin accounts.
diagnose test authserverTest external authentication (LDAP/RADIUS).

Useful Examples

Managing administrator profiles and permissions properly is essential for maintaining a secure and well-organized FortiGate environment. If you’re interested in learning more about default admin roles, permission levels, and how to manage them effectively, check out this article:

  • FortiGate Default Admin Profiles and Permissions – This guide explains the different built-in admin profiles, how to customize them, and how to assign appropriate access rights based on user roles.

Use this as a reference when you’re setting up user access or applying the principle of least privilege in your firewall administration.

DNS and Connectivity

CommandDescription
diagnose test application dnsproxy 6Tests DNS resolution.
execute ping 8.8.8.8Pings a public IP to test internet connectivity.
execute traceroute google.comTraces the route to a domain.

Useful Examples

Proper DNS configuration is crucial for name resolution, connectivity, and overall network performance. If you want to configure or troubleshoot DNS on your FortiGate device, this article will help:

  • FortiGate DNS Server Configuration – A detailed guide on setting up DNS servers, configuring FortiGate as a DNS forwarder, and verifying DNS behavior using CLI tools.

This tutorial is especially useful when diagnosing issues like slow browsing or failed domain lookups.

Conclusion

Mastering the FortiGate CLI can significantly enhance your ability to manage and troubleshoot your network infrastructure. While the GUI provides many useful tools, the CLI gives you precise control and faster access to critical system data. Whether you’re dealing with VPN issues, traffic bottlenecks, or just doing routine checks, these commands will save you time and help maintain a healthy FortiGate environment. Bookmark this guide and refer to it whenever you need quick, reliable CLI solutions.

About The Author

neo

See author's posts

Tags: fortigate
ADVERTISEMENT
Previous Post

Nextcloud: My Top 5 Must-Have Apps

Next Post

My Ultimate Docker Commands Cheat Sheet (2025 Edition)

neo

neo

Related Posts

Home Lab with Fortinet FortiGate 60D Firewall
FortiGate

Home Lab with Fortinet FortiGate 60D Firewall

Setting Up IPS (Intrusion Detection System) Profiles on FortiGate to Detect Web Attacks
FortiGate

Setting Up IPS (Intrusion Detection System) Profiles on FortiGate to Detect Web Attacks

Protect a Self-Hosted Application from Brute Force Attacks with FortiGate
FortiGate

How to Protect a Self-Hosted Application from Brute Force Attacks with FortiGate

FortiGate DDoS Protection: Configure DoS Policies to Secure Self-Hosted Applications
FortiGate

FortiGate DDoS Protection: Configure DoS Policies to Secure Self-Hosted Applications

Fortinet FortiGate Site-to-Site IPsec VPN Troubleshooting
FortiGate

Fortinet FortiGate Site-to-Site IPsec VPN Troubleshooting

Why Upgrade to a FortiGate Firewall? Enhanced Security, Visibility & Performance for Businesses
FortiGate

Why Upgrade to a FortiGate Firewall? Enhanced Security, Visibility & Performance for Businesses

Next Post
My Ultimate Docker Command Cheat Sheet (2025 Edition)

My Ultimate Docker Commands Cheat Sheet (2025 Edition)

Leave a Reply

Your email address will not be published. Required fields are marked *


Recommended

Remote Desktop Access to Ubuntu 24.04 from Windows

Remote Desktop Access to Ubuntu 24.04 from Windows

Linux Files Operation: wc (Word Count) Usage Examples

Linux Files Operation: wc (Word Count) Usage Examples

Automatic Windows Service Monitoring and Restart Script

Automatic Windows Service Monitoring and Restart Script

10+ Useful Linux find Command Examples You Should Know

10+ Useful Linux find Command Examples You Should Know

Host a Website on Raspberry Pi – Real Benchmark Tests

Host a Website on Raspberry Pi – Real Benchmark Tests

Categories

  • Blog
  • Cloud
    • Private
  • Linux Tutorials
    • Bash Scripting Tutorials
    • Commands
    • Networking
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Solutions
    • Docker
  • Video Tutorials
    • MikroTik Videos
ADVERTISEMENT

DefenceDev Tutorials

defencedev Logo

Whether you’re just starting or looking to expand your skills, I hope you find useful information and engaging discussions here. Let me take you through my journey and the goals behind this space!

Follow Us

Recent News

Automatic Windows Service Monitoring and Restart Script

Automatic Windows Service Monitoring and Restart Script

10+ Useful Linux find Command Examples You Should Know

10+ Useful Linux find Command Examples You Should Know

  • Site Map
  • Privacy Policy
  • Facebook Page
  • Disclaimer
  • Contact
  • About Me

© 2025 defencedev.com - All rights reserved.

No Result
View All Result
  • Home
  • Blog
  • Linux Tutorials
    • Bash Scripting Lessons
    • Commands
    • Networking
    • Bash Scripts
  • Solutions
    • Docker
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Cloud
  • Video Tutorials
    • YouTube Channel
    • MikroTik Videos

© 2025 defencedev.com - All rights reserved.