FortiGate
FortiGate Next Generation Firewall utilizes purpose-built security processors and threat intelligence security services from FortiGuard labs to deliver top-rated protection and high performance, including encrypted traffic.
Marit
Staff
Staff
Article Id 411974
Description

This article describes the advantages of using Visual Studio Code as a tool for reading and editing FortiOS configuration files. When reviewing the FortiOS configuration file, syntax recognition assists administrators in identifying structure, indentation, and parameter relationships more efficiently than plain-text views.

Scope FortiGate.
Solution
Two community-maintained extensions provide syntax interpretation for FortiOS configuration files:
  • FortiGate FortiOS Syntax.
  • FortiGate Language Support.
 

These extensions apply logic to FortiOS file types, including:

  • Keyword and command classification (config, edit, set, unset).

  • Parent and nested configuration blocks.

  • Color differentiation of values and attributes (IP addresses, interface names, services, boolean parameters, etc.).

 

This structured representation allows for:

  • Configuration scope boundaries.

  • Detection of syntax errors or unsupported parameters.

 

Both extensions can be installed directly from the Extensions Marketplace within Visual Studio Code, accessible through the left-hand pane of the editor. It is important to note, however, that these extensions are community-developed third-party tools and are not officially maintained or supported by Fortinet.
 
FGT Extension.png
 
When opening a FortiOS configuration file, ensure that the Language Mode (visible at the bottom-right corner of the VS Code interface) is set to FortiGate. This ensures that the syntax highlighting is applied correctly and that the editor interprets the file structure as a FortiOS configuration.
 
FGT language mode.png
 
Once the extensions are active and the correct language mode is selected, the FortiOS configuration file will display with syntax highlighting, making the structure easier to navigate. 
 
FGT VScode.png
 
Note: For Linux users using VSCodium, note that these extensions are not currently available.