固件自动升级
固件自动升级
重要
自动升级功能的初衷是为了规避已经发现的系统漏洞,防止黑客利用漏洞攻击。但在一些重要的生产环境中,不在维护时间内的更新和重启会造成严重的生产事故,所以在大部分生产环境下,建议关闭自动升级功能。
功能介绍
从 FortiOS 7.2.1 开始,FortiGate 支持在线自动升级功能。
- 只能升级相同的次要版本(x.y.z 中的 y)的小版本(x.y.z 中的 z),不能在大版本之间自动升级。例如,7.2.5 版本只能自动升级到 7.2.X,不能自动升级到 7.4.X。
- 如果存在 Mature 类型的新版本,自动升级会按照升级路径的版本顺序进行。
- 如果不存在 Mature 类型的新版本,则会参考
diagnose fdsm image-upgrade-matrix中的升级路径。 - 每次自动升级只会升级一个版本,如果升级路径中存在多个版本,会产生多次重启。
- 命令
diagnose test application forticldd 13可以查看自动升级的开启状态以及将要自动升级的版本和具体时间。
功能配置
GUI 配置
进入设备的管理页面,访问“系统管理 → Firmware & Registration”,右上角显示“自动升级补丁启用”,点击该按钮。

在弹出的“自动补丁升级”窗口中,可以禁用补丁自动升级或配置自动升级的相关参数,完成配置后点击“OK”按钮下发配置。
- 升级时间表:
- 延迟:当检测到新版本后,延迟升级的时间(默认 3 天)。
- Specify days:当检测到新版本后,特定一周中的某一天或几天升级,如果选了多天,则会在最近一天的可用时间升级。
- Install during specified time:升级当天执行升级动作具体的时间段,会在选定的时间内的随机时间安排升级。

- 升级时间表:
CLI 配置
config system fortiguard
set auto-firmware-upgrade { enable | disable* }
set auto-firmware-upgrade-day {sunday monday tuesday wednesday thursday friday saturday}
set auto-firmware-upgrade-start-hour <integer>
set auto-firmware-upgrade-end-hour <integer>
set auto-firmware-upgrade-delay <integer>
endauto-firmware-upgrade-day:指定某一天或某几天才能执行自动升级,比如只能周末升级版本,缺省是每周 7 天全选。auto-firmware-upgrade-start-hour/auto-firmware-upgrade-end-hour:指定升级时间点,缺省是 2:00~4:00 的随机时间点。auto-firmware-upgrade-delay(7.2.6 新增功能):发现有新版本后延迟多少天再升级(0~14 天,缺省 3 天)。当set auto-firmware-upgrade-delay配置为 0 时,auto-firmware-upgrade-day配置才会生效。
自动升级默认状态
在不同的版本/FortiGate 型号条件下,自动升级功能的默认开启状态如下所示:
| 设备版本 | FortiGate 型号 | 自动升级默认状态 |
|---|---|---|
| 7.2.1~7.2.5/7.4.0~7.4.4/7.6.0 | 所有 | 关闭 |
| 7.2.6~7.2.X | <100 | 开启 |
| ≥100 | 关闭 | |
| 7.4.5~7.4.X/7.6.1~7.6.X | 所有 | 开启 |
查看自动升级状态
通过diagnose test application forticldd 13命令可以看到当前设备自动升级的相关状态,常见状态有如下几种。
FortiGate 当前没有检测到新版本,没有升级计划,计划了下次检测新版本的时间为
Wed Jun 4 03:07:58 2025(计划检查时间也遵从已配置的自动更新时间范围)。FortiGate # diagnose test application forticldd 13 Scheduled push image upgrade: no Scheduled Config Restore: no Scheduled Script Restore: no Automatic image upgrade: Enabled. Next upgrade check scheduled at (local time) Wed Jun 4 03:07:58 2025FortiGate 检测到新版本 7.4.8,并计划了升级时间为
Thu Jun 5 05:13:10 2025。FortiGate # diagnose test application forticldd 13 Scheduled push image upgrade: no Scheduled Config Restore: no Scheduled Script Restore: no Automatic image upgrade: Enabled. Next upgrade check scheduled at (local time) Thu Jun 5 02:13:51 2025 New image 7.4.8b2795(07004000FIMG0023904008) installation is scheduled to start at Thu Jun 5 05:13:10 2025 end by Thu Jun 5 07:00:00 2025 Last upgrade check executed at (local time) Wed Jun 4 03:07:58 2025当 FortiGate 检测到新版本并计划升级时间后,会向设备注册的邮箱发送一封通知邮件,包含系统计划自动升级的事件日志。
date=2025-06-04 time=11:07:58 devid="FG101FTK20007637" devname="FW1_FGT101F" eventtime=1749006478360626440 tz="+0800" logid="0100032263" type="event" subtype="system" level="notice" vd="root" logdesc="Automatic firmware upgrade schedule changed" user="system" msg="System patch-level auto-upgrade new image installation (re)scheduled to between local time Thu Jun 5 12:13:10 2025 and local time Thu Jun 5 14:00:00 2025."设备关闭了自动升级功能。
重要
如果 FortiGate 被 FortiCloud 管理,即使这里的状态为
Disabled,仍然可能通过 FortiCloud 自动升级,详见下方的“关闭自动升级 → 设备被 FortiCloud 管理”章节。FortiGate # diagnose test application forticldd 13 Scheduled push image upgrade: no Scheduled Config Restore: no Scheduled Script Restore: no Automatic image upgrade: Disabled.
关闭自动升级
自动升级功能的初衷是为了规避已经发现的系统漏洞,防止黑客利用漏洞攻击。但在一些重要的生产环境中,不在维护时间内的更新和重启会造成严重的生产事故,所以在大部分生产环境下,需要关闭自动升级功能。
如果在自动升级开启的状态下,已经计划了升级时间,用如下方式关闭后,已有的升级计划也会终止。
设备被 FortiGate Cloud 管理
重要
如果设备加入了 FortiGate Cloud,即使设备自身关闭了自动升级,仍然会通过 FortiGate Cloud 进行自动升级。
检查设备是否被 FortiGate Cloud 管理。

如果设备已配置 FortiGate Cloud 管理,不仅要关闭设备自身的自动升级功能,还需要同时关闭 FortiGate Cloud 下的自动升级功能。
config system fortiguard set auto-firmware-upgrade disable end config system central-management set allow-push-firmware disable set allow-remote-firmware-upgrade disable end
设备被 FMG/Security Fabric 管理
只需要关闭设备自身的自动升级功能。
config system fortiguard
set auto-firmware-upgrade disable
end强制升级
触发条件
在 7.4.8、7.6.4、8.0.0 及以后版本,以下情况会触发强制自动升级(FortiGate 所有型号),不受以上自动升级设置的影响:
1.固件版本支持周期终止:当设备固件达到官方 工程支持终止日期(End of Engineering Support,简称 EOES,该时间可以登录 https://support.fortinet.com/support/#/lifecycle 查询)时,系统将强制升级至最新版本(主次版本号保持不变,例如 7.2.X 会升级到 7.2 最新的版本,而不会升级到 7.4.X)。
重要
注意 EOES 时间并非 EOS(End of Support)时间,通常比 EOS 时间要早:
- EOES 指 Fortinet 不再对该版本做代码更新(除非是 critical 级别的问题)。
- EOS 指 Fortinet 不再对该版本提供技术支持。
- 关于产品生命周期的更多信息请参考 系统管理 → 固件与配置管理 → 固件版本管理 → 产品生命周期章节。
2.无有效 FMGR 合同:若设备未绑定有效的 FMGR 合同(Firmware & General Updates),系统将强制升级至最新补丁版本(主次版本号保持不变,例如 7.2.X 会升级到 7.2 最新的版本,而不会升级到 7.4.X)。
例外情况
- 设备被 FortiManager 管理。
- 设备属于 Security Fabric 中。
延迟强制自动升级
强制自动升级可以手动延迟(一周),但无法取消。
execute auto-upgrade delay-installation查看当前强制自动升级的状态。
execute auto-upgrade statusGUI 的升级页面会显示与常规自动升级相似但不同的提示信息,以便用户明确识别当前为强制自动升级。