ITNuvoAkademiya
Academy homePackagesPlaylistsToolsSubnet calculatorSearchGlossary
CiscoCCNA · CCNA: networking fundamentals1. Introduction2. Network Fundamentals3. Network Access4. IP Connectivity5. IP Services6. IPv67. Security Fundamentals8. AutomationCCNP: Enterprise networks · coming soon
LinuxLinux: system administrator üçün · Linux for system administrators1. Getting to know Linux2. Working with text3. Users and permissions4. Processes and packages5. Inside the system6. Monitoring and logs7. NetworkingRed Hat Enterprise Linux · Red Hat Enterprise Linux: from beginner to advanced1. Getting started2. Packages3. Users and permissions4. SELinux5. Services6. Storage7. Networking8. Building services9. Boot and recovery10. DevOps11. Security and monitoring
FortinetFortiGate Administrator · FortiGate Administrator: from first login to ZTNA1. Getting to know FortiGate2. Routing, policy and NAT3. Security profiles4. Users and logs5. Resilience, SD-WAN and automation6. VDOM7. VPN and ZTNA8. Proxy9. DMZ
MonitoringZabbix · Zabbix: from installation to alerts1. Introduction2. Installation and the database3. Basics: groups, templates, users4. Connecting devices5. Alerts, Grafana and the API
VirtualizationProxmox VE · coming soonVMware ESXi · coming soon
My account / Sign in
AZENRU
← itnuvo.com

FortiOS CLI basics: config, edit, set, end

Lesson 1.39 minBeginnerNovember 24, 2026
Open

This lesson is open to everyone. The other lessons open with a package: sign in or sign up, then choose a package.

Key points

  • FortiOS configuration is a tree: config enters a section, edit opens a table entry, set assigns a value.
  • next saves the entry and stays in the table, end saves and leaves the section, abort leaves without saving.
  • show prints only changed settings, show full-configuration prints everything including defaults; get lists settings and values.
  • execute performs an action (ping, reboot, backup) and diagnose is for troubleshooting. Neither changes the configuration.
  • In the default mode (cfg-save automatic) a change takes effect and is saved as soon as you type end. There is no separate "write memory".

The key difference if you come from Cisco

Cisco IOS has modes: enable, configure terminal, interface g0/0. A command takes effect at once, but you need a separate copy running-config startup-config to keep it.

FortiOS works differently. It has a configuration tree, and every setting has its own address. The device name lives in the system global section; the IP of port2 lives in the port2 entry of the system interface table.

Cisco IOSFortiOS
Entering configurationenable → configure terminalNot needed, type config ... directly
Assigning a valuehostname R1set hostname FGT-HQ
Removing a valueno ...unset ...
When it takes effectAs soon as it is typedOn next or end
Savingcopy run startAutomatic (on end)
Viewingshow running-configshow, get

Five core words

config system interface edit port2 set ip 10.10.10.1 255.255.255.0 next end
Figure 1 · config opens a section, edit an entry, set a value. next closes the entry, end closes the section
  • config <path>: enters a section, for example config system global.
  • edit <name>: opens a table entry. If the entry does not exist, it creates a new one.
  • set <option> <value>: assigns a value. unset <option> returns it to the default.
  • next: saves the entry and stays in the table (so you can move to another entry).
  • end: saves and leaves the section.

There are two kinds of sections. A single section (such as system global) has no edit; you type set directly. In a table (such as system interface or firewall policy) you first select an entry with edit.

Example: renaming the device

FortiGate
FortiGate-100F # config system global
FortiGate-100F (global) # set hostname FGT-HQ
FortiGate-100F (global) # end
FGT-HQ #

Notice that the prompt shows where you are in brackets, and the name changed only after end. Without end, nothing would have changed.

Example: giving an interface an IP

FGT-HQ
FGT-HQ # config system interface
FGT-HQ (interface) # edit port2
FGT-HQ (port2) # set mode static
FGT-HQ (port2) # set ip 10.10.10.1 255.255.255.0
FGT-HQ (port2) # set allowaccess ping https ssh
FGT-HQ (port2) # set alias LAN
FGT-HQ (port2) # next
FGT-HQ (interface) # end
FGT-HQ #

The mask can be written two ways: 10.10.10.1 255.255.255.0 or 10.10.10.1/24. FortiOS accepts both and stores the first form in the configuration.

Watch out on a real device: edit does not complain about a name that does not exist, it creates a new entry. If you type edit port22 (meaning port2) and the device has no such port, FortiOS will try to create a new interface. If you are in the wrong place, type abort: you leave and nothing is saved.

Viewing: show and get

  • show: prints the configuration of the current section the way it is written, only settings that differ from the default.
  • show full-configuration: everything, including defaults.
  • get: lists all settings with their values. It is also used for status: get system status.
FGT-HQ
FGT-HQ # show system interface port2
config system interface
    edit "port2"
        set vdom "root"
        set ip 10.10.10.1 255.255.255.0
        set allowaccess ping https ssh
        set type physical
        set alias "LAN"
    next
end

Use grep to filter long output: show system interface | grep -f port2. The -f switch prints the matching line together with its whole block.

execute and diagnose

These two words do not change the configuration.

  • execute: do something. execute ping 10.10.10.20, execute reboot, execute backup config ....
  • diagnose: troubleshooting. diagnose sniffer packet port2 "icmp" 4, diagnose sys session list.

Helpers

  • ?: shows the commands or values available at that point. set allowaccess ? lists every option.
  • Tab: completes the command; press again to cycle through options.
  • Abbreviations work: conf sys int, sh sys int port2, exec ping 10.10.10.20.
  • Anything typed without end or next is lost. If the session drops, a half-finished edit is not saved.

About saving

The default mode is cfg-save automatic: as soon as you type end, the change both takes effect and is written to disk. There is also a safer option for remote work: under config system global, set cfg-save revert and set cfg-revert-timeout 300. In this mode, if you do not confirm the change with execute cfg save, the device reboots when the timer expires and returns to the previous configuration. This is very useful when a change could cut off your own connection.

🧪 Hands-on lab · Device: FortiGate-VM

config, set, end: the device name

Name the device FGT-HQ and set the idle admin timeout to 10 minutes. Both live in config system global. Notice that the name changes only after you type end.

Checked:

  • hostname FGT-HQ
  • admintimeout 10

▶ Start the lab

Check yourself

5 questions · answers are shown instantly · 3 correct answers complete the lesson

1In FortiOS, which command saves a table entry and stays in the same table?

next saves the entry and keeps you in the table; end also leaves the section.

2You typed set hostname FGT-HQ under config system global but the prompt did not change. Why?

A change is applied only when you type end (or next in a table).

3You typed edit port22 but meant port2. What do you type to leave without saving anything?

abort leaves the section without saving changes.

4Which command shows the whole configuration including default values?

show prints only non-default settings; full-configuration prints everything.

5Which of these does not change the configuration but just performs an action?

execute runs actions such as ping, reboot and backup; it does not touch the configuration tree.
Was this lesson useful?

Comments

Sign in to comment.