Prior to FortiOS 7.0, there were three commands to reset the configuration on a FortiGate, sadly, most only know the one command execute factoryreset and are not aware of the others. Since 7.0 we have some knew ones, mostly for VM based FortiGates. Let’s take a look at them.
Prior to FortiOS 7.0
execute factoryreset – This is the one everyone should be familiar with. It wipes the config completely.
execute factoryreset-shutdown – Reset to factory default and shutdown the device
execute factoryreset2 – Reset to factory default but keeps the IP addresses and the static routes. When I was an MSSP, this was the only reset we used.
After FortiOS 7.0 (VM Versions)
execute factoryreset keepvmlicense – Immediately reset to factory defaults and reboot. If keepvmlicense is specified (VM models only), the VM license is retained after reset. Great for lab environments as well.
execute factoryreset-shutdown keepvmlicense Immediately reset to factory defaults and shutdown. If keepvmlicense is specified (VM models only), the VM license is retained after reset.
execute factoryreset2 keepvmlicense. Reset to factory default, except system settings, system interfaces, VDOMs, static routes, and virtual switches. If keepvmlicense is specified (VM models only), the VM license is retained after reset.
NOTE: The previous commands are still available.
After FortiOS 7.0 (FortiManager)
execute factoryreset-for-central-management – Resets the configuration but leaves the FortiManager configuration. NOTE: It will not keep the IP address. If you do this remote, gas up the truck, cause you are doing a truck roll.