当防火墙出现系统故障,无法正常启动,也无法从Web图形界面或者命令行登录管理,又或者固件升级没有按照升级路径,固件使用中出现问题,需要重新安装特定版本的固件。这时候可以考虑格式化Flash闪存,重装新的固件,防火墙会使用新的固件和配置文件启动。

注意:通过此方式将固件刷入Flash卡后,原有已安装的系统与配置文件都会被清空,所以,建议在重装固件前,先对配置文件做好备份。

准备物品:

1.    Console线,如果电脑没有COM口,需要购买一条USB的Console线。

2.    一条网线。

3.    TFTP服务器软件。

4.    一台电脑以及Terminal客户端软件。

配置步骤:

1.      下载所需要的固件文件,文件扩展名为.out。

2.      将Console线连接防火墙的Console口。

3.      将网线连接到防火墙的MGMT(管理)口.。

4.      关闭电脑操作系统的防火墙。

5.      下载并安装TFTP服务器软件,以tftpd64为例。下载地址:https://bitbucket.org/phjounin/tftpd64/downloads/

6.      新建一个文件夹,把下载的固件文件复制或移动到该文件夹。

7.      运行TFTPD软件,设置当前目录(Current Directory)为上面新建的目录。设置监听的网卡为连接防火墙所在的网络端口。

FortiGate防火墙Flash格式化及重装固件_FortiGate

8.      使用终端软件连接防火墙的Console口,串口参数如下:

波特率:9600 baud (FortiGate-300使用115,000 baud)

数据位:8 bits

奇偶校验:

停止位:

流控制:

9.      重启FortiGate防火墙

10.   当终端显示“press any key to display configuration menu”,按任意键进入BIOS菜单(有些型号的BIOS可能需要敲入Ctrl + B进入,请根据提示信息操作)

FortiGate-100E (12:19-01.31.2017)
Ver:05000008
Serial number: FG100***********
CPU: 1000MHz
Total RAM: 4 GB
Initializing boot device... 
Initializing MAC... nplite#0
Please wait for OS to boot, or press any
key to display configuration menu..

BIOS菜单如下:

[C]: Configure TFTP parameters.
[R]: Review TFTP parameters.
[T]: Initiate TFTP firmware transfer.
[F]: Format boot device.
[I]: System information.
[B]: Boot with backup firmware and set as default.
[Q]: Quit menu and continue to boot.
[H]: Display this list of options.

Enter C,R,T,F,I,B,Q,or H: R

11. 然后按R,检查TFTP参数。

Image download port:    MGMT
DHCP status:            Disabled
Local VLAN ID:         <NULL>
Local IP address:      10.1.1.109
Local subnet mask:     <NULL>
Local gateway:         <NULL>
TFTP server IP address: 10.1.1.1
Firmware file name:     image.out

Enter C,R,T,F,I,B,Q,or H:

电脑的网线要连接到防火墙的MGMT管理口,TFTP参数中的Local IP address是防火墙管理口的IP。TFTP Server IP address即是该电脑连接防火墙对应网卡的IP,可以将电脑的IP地址更改为与菜单中的一致,两个IP地址须在同一子网。

12. 若需要修改TFTP参数,按C。比如修改固件的文件名,则再按F。

文件名可以从Tftpd64中Copy到终端软件中。

FortiGate防火墙Flash格式化及重装固件_Flash_02

[P]: Set firmware download port.
[D]: Set DHCP mode.
[I]: Set local IP address.
[S]: Set local subnet mask.
[G]: Set local gateway.
[V]: Set local VLAN ID.
[T]: Set remote TFTP server IP address.
[F]: Set firmware file name.
[E]: Reset TFTP parameters to factory defaults.
[R]: Review TFTP parameters.
[N]: Diagnose networking(ping).
[Q]: Quit this menu.
[H]: Display this list of options.

Enter P,D,I,S,G,V,T,F,E,R,N,Q,or H: F

Enter firmware file name [image.out]:FGT_100E-v7.0.12.M-build0523-FORTINET.out
.done

如果要测试网络连通,可以按N。最后按R再检查一遍TFTP参数。

13. 按Q回到上一级菜单,然后按F开始格式化Flash闪存。

[C]: Configure TFTP parameters.
[R]: Review TFTP parameters.
[T]: Initiate TFTP firmware transfer.
[F]: Format boot device.
[I]: System information.
[B]: Boot with backup firmware and set as default.
[Q]: Quit menu and continue to boot.
[H]:
Display this list of options.

Enter C,R,T,F,I,B,Q,or H: F
It will erase data in boot device. Continue? [yes/no]:yes
Formatting.......... Done.

14. 最后按T启动TFTP固件传输。接着输入D将传输的固件设置为默认启动镜像。固件传输完后,防火墙会自动重启并开始安装系统。

Connect to tftp server 10.1.1.1 ...


T T
########################################################################################################################################################
Image Received.
Checking image... OK
Uncompressed size: 268435968 = 0x10000200
Save as Default firmware/Backup firmware/Run image without
saving:[D/B/R]?d

Programming the boot device now.
The system must re-layout the boot device to install this firmware.
The default and backup firmware will be lost.
Continue:[Y/N]? Y
..

Booting OS...
Reading boot image... 2856401 bytes.
Initializing firewall...

System is starting...
Resizing shared data partition...done
Formatting shared data partition ... done!
Starting system maintenance...
Scanning /dev/mmcblk0p1... (100%) 

Scanning /dev/mmcblk0p3... (100%)

FortiGate防火墙Flash格式化及重装固件_重装_03

15. 通过TFTP方式导入固件镜像文件后,设备会加载导入的固件镜像作为主版本启动。另外请注意:若没有按任意按键,系统会在一定时间后超时并自动重启。