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.
pdelapena
Staff
Staff
Article Id 285581
Description This article provides information about the suggested options when planning to factory reset a FortiGate KVM.
Scope FortiGate.
Solution

In FortiOS versions 6.2 and 6.4, there are three options available to factory reset FortiGate. These commands can be executed via FortiGate CLI and it will be necessary to log in with a FortiGate administrator account with super_admin profile or at least an account with Read/Write Access Permissions for 'System' in its Admin Profile.

CLI commands :

execute factoryreset --> Reset to factory default now.
execute factoryreset-shutdown --> Reset to factory default and shutdown.
execute factoryreset2 --> Reset to factory default except system.global.vdom-mode/VDOMs/system.interface/system.settings/router.static/router.static6. 


For FortiOS versions 7.0, 7.2, and 7.4+, aside from the three mentioned above another option was added which keeps central management configurations after factory-reset.

execute factoryreset-for-central-management --> Reset to factory default except system.central-management.serial-number/system.central-management.fmg.

 

Appending 'keepvmlicense' after the factory-reset commands mentioned above will keep the VM license after the factory reset.

Example: The command 'execute factoryreset2 keepvmlicense' factory resets all configurations in FortiGate except its current VDOM-mode, VDOMs, interface settings, system settings, and IPv4/IPv6 static routes. These configurations are normally necessary to keep the management access to the FortiGate.

In addition to that, since the 'keepvmlicense' command has been appended, it also saves the VM license currently loaded in the FortiGate-KVM. There will be no need to re-upload the license file and wait again for another automatic reboot.