GUI/CLI 连接问题
2026/1/4管理方式7.X.X大约 2 分钟
GUI/CLI 连接问题
说明
当 FortiGate 出现 Web GUI(HTTP/HTTPS)或 CLI(SSH/Telnet)无法登录/连接时,可按本文进行基础的检查与抓包定位。
排查步骤
确认管理 IP/接口是否正确:先通过 Console 登录 FortiGate,确认你访问的管理 IP 属于哪个接口、接口当前地址是否正确。
show system interface mgmt config system interface edit "mgmt" set vdom "root" set ip 11.10.10.253 255.255.255.0 set allowaccess ping https ssh set type physical set dedicated-to management set role lan set snmp-index 2 next end确认管理服务端口是否被改过:很多“连不上”的问题其实是端口不对(例如 HTTPS 不再是 443)。常见默认值示例:
set admin-port 80(HTTP)set admin-sport 443(HTTPS)set admin-ssh-port 22(SSH)set admin-telnet-port 23(Telnet)
show full-configuration system global | grep 'set admin-\(port\|sport\|ssh-port\|telnet-port\)' set admin-port 8081 set admin-sport 4443 set admin-ssh-port 2222 set admin-telnet-port 2323确认接口层是否放行管理访问(
allowaccess):即使端口正确,如果接口没开启 HTTPS/SSH,也会无法访问。show system interface mgmt | grep allowaccess set allowaccess ping https ssh检查是否配置了管理员可信主机(trusthost):如果管理员账号设置了可信主机,只有在可信名单内的源 IP 才能登录(详情参考:系统管理 → 管理员配置 → 管理员设置章节。
- 客户端到 FortiGate 的路径上是否发生 SNAT。
- 若发生 SNAT,需要把 NAT 后的源 IP 加入 trusthost,否则会被拒绝。
show system admin config system admin edit "admin" set vdom "root" set trusthost1 192.168.100.178 255.255.255.255 set accprofile "super_admin" set password ENC PB2BUdKgOSS1ILNihB8s0TQOeY3mp/Pny1J0j6eQhSx1xODelJYY7SJv8b7pnZ0v9wUGUgXlSx7m1GkNttonTpQjUQQ6g4JqkjJoWuw6ynGKow= next end检查是否有 Local-in Policy 限制管理访问:如果配置了 Local-in Policy,可能会把管理流量挡掉(详情参考:策略与对象 → 本地流量策略 → Local-in 策略章节。
show firewall local-in-policy config firewall local-in-policy edit 1 set uuid 6f31b814-e943-51f0-e47b-b2c1eb16e4ad set intf "mgmt" set srcaddr "192.168.100.0/24" set dstaddr "all" set action accept set service "ALL" set schedule "always" next edit 2 set uuid 056c756c-e944-51f0-318c-5c49729dd5e3 set intf "mgmt" set srcaddr "all" set dstaddr "all" set service "ALL" set schedule "always" next end若仍无法解决:用 Debug Flow/Sniffer 定位:用于判断:流量是否到达、防火墙是否丢弃、服务进程是否报错等:
Debug 与 Debug Flow:
diagnose debug reset diagnose debug console timestamp enable diagnose debug app httpsd -1 <---- Debug GUI diagnose debug app sshd -1 <---- Debug SSH diagnose debug flow filter addr <Client_Source_IP> diagnose debug flow show function-name enable diagnose debug flow trace start 100 diagnose debug enable Debug结束后执行: diagnose debug disable diagnose debug resetSniffer(抓包确认是否有回包/是否到达):
diagnose sniffer packet any "host <Client_Source_IP>" 6 0 a
尝试重启
httpsd进程。fnsysctl killall -11 httpsd若怀疑 443 端口冲突,可将 管理员 HTTPS 端口改为自定义端口进行验证与规避。
config system global set admin-sport 8443 endGUI 异常,可按 Fortinet 建议收集浏览器调试信息(使用 Fortinet Support Tool 插件,详情参考:故障排查 → FortiGate Support Tool 章节)。