FortiGate: settings for XplicitTrust
The FortiGate settings that most often break XplicitTrust connections, and how to change them. The common background is on Firewalls, Proxies and TLS Inspection.
In short
Check, in this order: Application Control (the WireGuard signature), the DoS policy (udp_flood), SSL Deep Inspection (exempt *.xplicittrust.com), source port preservation on the NAT policy, and optionally UDP port forwarding for direct connections.
Steps below assume FortiOS 7.2 or later. Earlier versions use slightly different menu paths but expose the same settings.
If the FortiGate also sits between a gateway asset and the virtual assets or subnets behind it, the asset can maintain the FortiGate's rules for those destinations itself; see Firewall Sync.
1. Application Control blocks WireGuard
The FortiGuard application signature WireGuard (ID 46495, category
Proxy) is classified as high-risk and is blocked by default in many
FortiGate profiles.
Symptoms
- XplicitTrust agent operates via the TCP relay instead of the preferred UDP relay path.
- UDP relay sessions are blocked or torn down shortly after establishment.
- Application Control log contains entries with appname "WireGuard" and action "block".
- Changing the UDP port on the agent does not resolve the issue.
Verify (CLI)
execute log filter category 10
execute log display
Filter the output for "WireGuard". If matching block entries are present, Application Control is the cause.
Resolution via GUI
- Open Security Profiles → Application Control and edit the application profile attached to the firewall policy used for client traffic.
- In the Application and Filter Overrides section, click Create New.
- Type: Application. In the search field enter WireGuard and select the signature.
- Set the action to Allow (or Monitor if logging is required) and save.
- Confirm that no broader category filter (for example Proxy or VPN.Tunnel) still blocks the traffic. If it does, set those filters to Monitor or move the WireGuard override above them in the evaluation order.
Resolution via CLI
config application list
edit "default" # or the name of the profile in use
config entries
edit 0
set application 46495
set action pass
next
end
next
end
2. DoS policy drops UDP traffic
The udp_flood, udp_src_session and udp_dst_session anomalies in a
DoS policy drop sustained UDP traffic once a packets-per-second threshold
is exceeded.
Symptoms
- UDP relay traffic is interrupted under load (file transfer, VoIP, screen sharing, backup); the agent fails over to the TCP relay.
- Anomaly log contains entries with attack
udp_floodand actionclear_sessionfor the UDP relay session. - The issue correlates with throughput, not idle time, and recurs each time the agent attempts to switch back to the UDP relay.
Verify (CLI)
execute log filter category 7
execute log display
Category 7 is the anomaly log. Look for udp_flood, udp_src_session or
udp_dst_session entries on the interface that carries XplicitTrust
traffic.
Recommended resolution
Disable the udp_flood anomaly on the DoS policy that covers the
XplicitTrust traffic. The same behaviour is documented for FortiGate's
own SSL-VPN DTLS tunnels. Disabling udp_flood does not weaken the rest
of the DoS policy; SYN flood, ICMP flood, port scan and other anomalies
remain active.
Recommendation
Disable udp_flood (and, if present, udp_src_session /
udp_dst_session) on the DoS policy that applies to the interface or
zone used by XplicitTrust clients. Leave the remaining anomalies
(SYN flood, ICMP flood, scan detection, etc.) enabled.
GUI path
- Open Policy & Objects → DoS Policy and edit the relevant IPv4 (or IPv6) DoS policy.
- Under L4 Anomaly, locate
udp_floodand set the status to Disable. - Apply the same change to
udp_src_sessionandudp_dst_sessionif they are enabled. - Save the policy.
CLI
config firewall DoS-policy
edit <policy-id>
config anomaly
edit "udp_flood"
set status disable
next
edit "udp_src_session"
set status disable
next
edit "udp_dst_session"
set status disable
next
end
next
end
Alternative: keep UDP flood protection, exempt XplicitTrust
If policy requires that UDP flood protection remain enabled, two alternatives preserve the protection while allowing XplicitTrust to operate:
- Exempt the XplicitTrust traffic: create a dedicated DoS policy above the generic one, scoped to the XplicitTrust relay address(es) as destination and the internal client subnets as source, with the UDP anomalies set to Disable. The generic policy continues to protect all other traffic.
- Raise the threshold: first set the
udp_floodaction to Pass with logging for one to two business days to establish a peak-traffic baseline, then set the threshold to roughly twice the observed peak (in packets per second). Defaults are typically 2000 pps, which is easily exceeded by a single sustained file transfer through the tunnel.
3. SSL Deep Inspection breaks the TCP relay
Symptoms
- The TCP relay path fails to establish or is repeatedly torn down.
- The agent log shows TLS handshake or certificate validation errors against the XplicitTrust relay endpoints.
Verify
From a client machine behind the FortiGate:
xtna-util --connectivity
If SSL termination is reported, SSL Deep Inspection on the FortiGate is the cause.
Recommended resolution
Exempt the XplicitTrust endpoints from SSL Deep Inspection. This keeps full inspection active for all other traffic and only excludes the XplicitTrust control plane and relays from TLS termination.
Recommendation
Add the XplicitTrust endpoint FQDNs (or wildcard
*.xplicittrust.com for standard SaaS deployments; adjust to your
tenant) to the SSL Exempt list of the SSL/SSH Inspection profile
attached to the policy that carries XplicitTrust client traffic.
GUI path
- Open Security Profiles → SSL/SSH Inspection and edit the profile attached to the relevant firewall policy.
- In the Exempt from SSL Inspection section, click Create New.
- Type: Wildcard FQDN. Enter the XplicitTrust relay FQDNs or a wildcard such as
*.xplicittrust.com. - Save the profile and confirm it is applied to the policy that carries client traffic.
CLI
config firewall ssl-ssh-profile
edit <profile-name>
config ssl-exempt
edit 0
set type wildcard-fqdn
set wildcard-fqdn "*.xplicittrust.com"
next
end
next
end
Alternative: certificate-inspection mode
If exempting specific endpoints is not desired, switch the SSL/SSH Inspection profile applied to the relevant policy from deep-inspection to certificate-inspection mode. Certificate inspection examines TLS metadata only and does not terminate the session, so the TCP relay continues to work. Note that this lowers visibility into encrypted traffic for the policy as a whole.
4. Source port preservation for direct connections
XplicitTrust agents establish direct peer-to-peer UDP connections
whenever possible, falling back to a relay only if a direct path cannot
be negotiated. The direct path is set up by UDP hole punching
coordinated by the XplicitTrust broker: for each pair of agents the
broker assigns a fixed UDP peering port on each side and instructs both
agents to send their hole-punching packets from that local port to the
other agent's <public IP>:<peering port> tuple. The receiving peer is
told in advance which source port to expect. For this to work the
FortiGate's source-NAT must preserve the agent's UDP source port.
FortiOS Static SNAT – the default mode when NAT is enabled on a firewall policy and Use Outgoing Interface Address is selected – preserves the original source port whenever possible. The Source Port Translation option defaults to When Port Conflicts, which leaves the source port untouched unless another active session is already using the same external IP and port. This is the configuration XplicitTrust direct connections need. The two configurations that override this default and force source-port randomisation are dynamic IP pools (in either policy-based NAT or Central NAT) and Source Port Translation: Always.
Symptoms
- XplicitTrust agents behind the FortiGate consistently end up on a UDP or TCP relay, even when direct connectivity should be possible based on the network topology.
xtna-util --statuson an affected client reports the local NAT type as Non-Collaborative NAT.- The same agents successfully establish direct connections from other networks (mobile hotspot, residential connection, a different site).
Verify
Run xtna-util --status on a client behind the FortiGate. To confirm,
take a brief packet capture on the FortiGate WAN interface filtered on
the agent's UDP traffic: the source port observed on the outside should
equal the agent's peering port shown in the Admin Console under
Assets → [select asset] → Edit → Advanced → Port. If it differs,
the FortiGate is rewriting it.
Recommendation
On the firewall policy that handles outbound XplicitTrust traffic, enable NAT with Use Outgoing Interface Address (Static SNAT) and leave Source Port Translation at its default When Port Conflicts setting. The original source port is then preserved whenever possible, enabling direct peer-to-peer connections without per-asset port forwarding.
GUI path
- Open Policy & Objects → Firewall Policy and edit the policy that handles outbound XplicitTrust traffic (typically client subnets → WAN).
- Enable NAT and select Use Outgoing Interface Address.
- Confirm Source Port Translation is set to When Port Conflicts (the default). Do not select Always unless the deployment specifically requires it.
- Save the policy.
Note on Central NAT
If Central NAT is enabled, source port behaviour is controlled by the
IP pool type and the central-snat-map entry. To preserve the source
port in Central NAT mode, either use an Overload-type IP pool with port
preservation enabled (FortiOS 7.4.4 introduced an explicit
set port-preserve enable option in the central-snat-map), or exclude
the XplicitTrust traffic from Central NAT and let it use the standard
per-policy Static SNAT. The standard per-policy approach is
significantly simpler and is the recommended path.
5. Direct connections via UDP port forwarding
If source-port preservation is not achievable, an asset that should accept direct inbound connections from peers can be made reachable by forwarding its tenant-specific UDP listening port on the FortiGate.
Step 1: Look up the agent UDP port
- Sign in to the XplicitTrust Admin Console.
- Open Assets, select the relevant asset and click Edit.
- Switch to the Advanced tab. The UDP listening port is shown in the Port field.
Step 2: Create a Virtual IP
- Open Policy & Objects → Virtual IPs and click Create New → Virtual IP.
- Name:
xtna-<hostname>(or any descriptive name). - External interface: WAN. External IP: the public WAN address of the FortiGate.
- Map to IPv4 address: the internal IP of the XplicitTrust asset.
- Enable Port Forwarding. Protocol: UDP. External and Mapped port: the port value from the Admin Console. Save.
Step 3: Create an inbound firewall policy
- Open Policy & Objects → Firewall Policy and click Create New.
- Incoming interface: WAN. Outgoing interface: the internal interface or zone where the asset resides.
- Source: all (or a geographic restriction if desired). Destination: the Virtual IP from Step 2. Service: ALL or a UDP service object matching the port.
- NAT: Disabled (the Virtual IP already performs the destination NAT).
- Attach the Application Control profile from section 1 so that the WireGuard signature is allowed on this inbound path as well, and save.
CLI
config firewall vip
edit "xtna-<hostname>"
set extip <wan-ip>
set extintf "wan1"
set portforward enable
set protocol udp
set extport <port>
set mappedport <port>
set mappedip "<internal-ip>"
next
end
config firewall policy
edit 0
set name "xtna-direct-<hostname>"
set srcintf "wan1"
set dstintf "<internal-intf>"
set srcaddr "all"
set dstaddr "xtna-<hostname>"
set action accept
set schedule "always"
set service "ALL"
set application-list "<profile-with-wireguard-allow>"
next
end
Step 4: Fixate the port in the Admin Console
Return to the Admin Console: Assets → [select asset] → Edit → Advanced → Port and enable Fixate Port. This locks the agent to the configured UDP port, so it does not renegotiate to a different port that the FortiGate is not forwarding.
Order matters
Enable Fixate Port only after Steps 2 and 3 are complete. Enabling it before the FortiGate is forwarding the port will lock the agent to a port that is not yet permitted, breaking direct connectivity until the FortiGate side is configured.
One Virtual IP plus one firewall policy is required per asset that should be directly reachable. If the FortiGate WAN IP is dynamic, configure DDNS so the public hostname remains stable.
Managed service providers
If the FortiGate is operated by a managed service provider, the relevant change requests are:
- Application Control override allowing application ID 46495 (WireGuard).
- Disabling the
udp_floodanomaly on the DoS policy covering the client interface. - Exempting the XplicitTrust relay endpoints from SSL Deep Inspection.
- Using Static SNAT with default Source Port Translation: When Port Conflicts on the firewall policy that handles outbound XplicitTrust traffic.
In HA or cluster setups, apply the changes on the primary unit only. They are synchronised to the secondary automatically.
See also
- Concept: Connection Paths and NAT
- Guide: Firewalls, Proxies and TLS Inspection, Logs and Diagnostics
- Reference: Network requirements, xtna-util