飞塔防火墙作为企业级网络安全设备,其命令行界面(CLI)提供了灵活且强大的配置管理能力,掌握常用命令对于管理员高效运维至关重要,以下从基础操作、网络配置、安全策略、系统维护等方面详细介绍核心命令。

基础操作与文件管理
登录CLI后,首先需熟悉基本操作。admin为默认管理员账户,通过config system global可修改登录密码,set admin-password <新密码>命令用于设置,文件管理方面,execute backup config <文件名>备份当前配置,execute restore config <文件名>恢复配置,diagnose debug enable开启调试模式,diagnose debug reset关闭调试,查看系统资源使用情况可用get system performance status,监控日志则通过show log system-filter <过滤条件>实现。
网络接口与路由配置
接口配置是网络部署的基础,进入接口配置模式config system interface,edit <接口名>如edit internal,set ip <IP地址>/<子网掩码>设置IP,set allowaccess ping https snmp开启管理访问协议,VLAN配置需在接口下config system vlan,create <VLAN ID> <接口名>创建,set interface <成员接口>绑定成员,路由配置通过config router static实现,edit <序列号>,set dst <目标网段>,set gateway <下一跳IP>添加静态路由;动态路由如OSPF需config router ospf,set router-id <Router-ID>,config area <区域ID>,set network <网段> <子网掩码>宣告网段。
防火墙策略与用户认证
安全策略是防火墙核心。config firewall policy进入策略配置,edit <策略ID>,set name <策略名>,set srcintf <源接口> set dstintf <目标接口>,set srcaddr <源地址对象> set dstaddr <目标地址对象>,set action accept/deny,set schedule <时间对象>设置生效时间,set service <服务对象>如HTTP HTTPS,set utm-status enable开启UTM功能,用户认证方面,config user firewall配置本地用户,create <用户名> set password <密码> set role <角色如super_admin>;config user local-group管理用户组,edit <组名> set member <用户名>添加成员。
NAT与VPN配置
NAT解决IP地址复用问题。config firewall policy中set nat enable开启源NAT,或单独配置config firewall snat edit <规则ID> set srcintf <出接口> set srcaddr <内网网段> set dstaddr <不转换地址> set outbound <出接口IP>,VPN配置包括IPSec和SSL VPN,IPSec需config vpn ipsec phase1 set name <隧道名> set interface <公网接口> set peertype any set proposal aes256-sha256-modp2048设置加密算法,config phase2 set name <子名> set proposal aes256-sha256设置P2算法;SSL VPN通过config vpn ssl web-host添加资源,config user local-ssl创建SSL VPN用户。

系统维护与监控
日常维护需定期检查。execute reboot重启设备,execute factoryreset恢复出厂设置(谨慎使用),监控命令中,get system status查看系统状态,diagnose sys top实时监控进程资源,get vpn ipsec remote-status查看IPSec隧道状态,get firewall session list查看当前会话表,日志导出使用execute log filter <过滤条件> | export,保存至TFTP服务器可通过execute backup config ftp <服务器IP> <用户名> <密码> <路径>。
相关问答FAQs
-
问:如何批量导入防火墙策略?
答:可通过CLI导出配置文件中的策略部分,使用config firewall policy | show查看所有策略,将结果保存为文本文件后,在FortiManager中批量导入,或通过FortiCLI的脚本功能批量执行命令,需注意导入前备份原配置,避免冲突。 -
问:防火墙CPU占用率过高时如何排查?
答:首先执行diagnose sys top查看占用资源最高的进程,常见原因包括策略匹配效率低(检查策略顺序、优化地址对象)、病毒扫描开启(调整UTM扫描范围)、DDoS攻击(通过get system session-status查看异常流量),可临时关闭非必要功能定位问题,或升级固件修复已知bug。
(图片来源网络,侵删)
