This article describes how the 'FGFM' protocol is used for communication between FortiGate and FortiManager devices and how to troubleshoot issues with the protocol.
The FGFM protocol runs over SSL (Secure Sockets Layer) using TCP port 541 under IPv4.
FortiGate and FortiManager.
Check if 'FMG-Access' is enabled under the FortiGate management port.
Go to Network -> Interfaces -> Double-click the management port -> Administrative access and check 'FMG-Access' is enabled.
Failing that, check the SSL compatibility.
config sys global
sslv3 <- Set SSLv3 as the lowest version.
tlsv1.0 <- Set TLSv1.0 as the lowest version.
tlsv1.1 <- Set TLSv1.1 as the lowest version.
tlsv1.2 <- Set TLSv1.2 as the lowest version (default).
config system global
The TLS versions should match on both FortiGate and FortiManager.
default <- High strength algorithms and these medium-strength 128-bit key length algorithms: RC4-SHA, RC4-MD5, RC4-MD.
high <- 128-bit and larger key length algorithms: DHE-RSA-AES256-SHA, AES256-SHA, EDH-RSA-DES-CBC3-SHA, DES-CBC3-SHA, DES-CBC3-MD5, DHE-RSA-AES128-SHA, AES128-SHA.
low <- 64-bit or 56-bit key length algorithms without export restrictions: EDH-RSA-DES-CDBC-SHA, DES-CBC-SHA, DES-CBC-MD5.
The enc-algorithm can be same on both or can higher on FortiGate.
It can be verified on FortiManager with these commands:
get sys global
It can be verified on FortiGate with these commands:
config sys global
The 'FGFM' protocol implements a secure communication protocol with the following functions:
FortiGate reachability status (from FortiManager).
FortiManager reachability status (from FortiGate).
Configuration installation and retrieval.
JSON monitoring via RTM.
The following communications between FortiGate and FortiManager units are handled outside of the 'FGFM' protocol and are managed by the FortiGuard protocol:
The 'FGFM' protocol runs over SSL (Secure Sockets Layer) using TCP port 541 under IPv4. FortiManager 6.2 supports the use of IPv6.
Both FortiGate and FortiManager units have an 'FGFM' daemon running exclusively for FortiGate to FortiManager communication.
The FortiManager unit listens on TCP port 541 for an incoming session request. The FortiGate unit establishes an SSL session with the FortiManager.
Both units use TCP port 541 for sending and receiving messages.
The 'FGFM' daemon handles all FortiGate to FortiManager (and vice versa) authentication, keep-alive messages, and actions resulting from them (such as instructing another daemon on a FortiGate device to update its configuration or various database files).
The 'diagnose fdsm central-mgmt-status' command provides connectivity and registration status of the FortiGate with the FortiManager.
diagnose fgfm session-list
Telnet to the FortiManager IP on port 541 to ensure reachability.
execute telnet <FMG-IP> 541
Ensure proper MTU size end to end from FortiGate to FortiManager.
exe ping-options df-bit yes
exe ping-options data-size <1472>
exe ping-options source <fgt ip used in fmg-source-ip in central mgmt>
exe ping <fmg IP>
The source IP of the FortiGate can also be configured to use the respective IP of the FortiGate, which is reachable with the FortiManager. This is useful for cases such as VPN access.
config system central-management
set fmg-source-ip <FGT-IP>
If FortiGate is losing the FGFM tunnel, it may be linked to FortiManager being behind a NAT and sending the wrong IP to FortiGate. To solve this, configure the management address setting on a FortiManager that is behind a NAT device so the FortiGate can initiate a connection to the FortiManager. Configuring the management address setting in the CLI ensures FortiManager knows the public IP and can configure it on the FortiGate.
config systems admin setting
set mgmt-fqdn <IP> <FQDN>
Note, use mgmt-fqdn even if only IP addresses are used and no FQDNs.
Debug on FortiGate.
diag debug reset
diag debug application fgfm 255
diag debug console time enable
diag debug en
Debug on FortiManager.
diag debug reset
diag debug application fgfmsd 255 <deviceName>
diag debug time enable
diag debug en
To generate the output in the debugs, re-initiate the connection from the FortiGate (or) from the FortiManager:
fnsysctl killall fgfmd
exe fgfm reclaim-dev-tunnel <device_name>
devicename <- Optional device name.
Sample FortiGate output to check the registration status:
diagnose fdsm central-mgmt-status
Connection status: Up
Registration status: Registered
If it is possible to ping FortiGate from FortiManager and if FortiGate is not communicating with FortiManager, it is possible to capture the packets with the commands below.
Run sniffer on FortiGate using Putty with SSH connection and all session output logging:
diag sniff pack any "port 541 and host x.x.x.x" 6 0 a <- Where x.x.x.x is the FortiManager IP address.
At the same time, run a sniffer on FortiManager with the following syntax:
diag sniff pack any "port 541 and host y.y.y.y" 3 0 a <- Where y.y.y.y is the FortiGate IP address.