← Back to knowledge base
medium

Application traffic matches the implicit deny policy despite an allow policy

Confirmed 8/8/2026

Problem

Application traffic can fail even when a firewall policy permits the expected source and destination addresses. If the application uses a destination port that is absent from the policy's allowed services, FortiGate does not match the session to that policy and instead drops it through policy 0, the implicit deny rule. This behavior applies to IPv4 and IPv6 policies in both policy-based and zone-based deployments.

Symptoms

Traffic logs show **Action: Deny** and **Policy: 0 (Implicit Deny)**. The destination port is not present in an allow policy, and the application cannot reach its server despite an allow policy covering the source and destination addresses. Debug flow may report `no matching policy, drop`.

Environment

FortiGate; firewall policy configuration; custom service objects; IPv4 and IPv6 policies; policy-based and zone-based deployments.

FortiOS version

FortiOS v6.x/v7.x

Root Cause

FortiGate uses strict service-port matching. Applications that use non-standard, dynamic, or vendor-specific ports will not match an allow policy unless those ports are explicitly included in its services. Unmatched sessions are sent to the implicit deny rule. For example, a third-party agent using TCP port 9005 is denied if port 9005 is not included in any service or service group assigned to the relevant policy.

Solution

  1. Identify the destination port used by the application.
    • Review traffic logs for the dropped session and destination-port details.
    • Capture traffic to or from the server:
diagnose sniffer packet any 'host <server_IP>' 4
  • Review the application vendor's documentation.
  • Use debug flow to obtain the destination port and policy lookup result. A failed lookup can include no matching policy, drop.
  • Enabling logging on the implicit deny policy is an easy way to identify blocked ports or services.
  1. Create a custom service for the required port in Policy & Objects -> Services -> Create New. Configure the service name, protocol (TCP or UDP), and destination port or port range.

    CLI example for a TCP service:

config firewall service custom
    edit "<custom_service>"
        set tcp-portrange <port_number>
    next
end
  1. Add the custom service to the applicable firewall policy. In the GUI, go to Policy & Objects -> Firewall Policy -> Edit Policy -> Services, then add the new service to the allowed services list.

    CLI example:

config firewall policy
    edit <policy_id>
        append service "<custom_service>"
    next
end
  1. Generate new application traffic so that new sessions are evaluated against the updated policy. The sessions should now match the intended allow policy rather than policy 0.

Verification

Confirm that forward traffic logs show the expected firewall policy and an Accept action instead of Deny. Check active sessions with:

diagnose sys session list

Use a packet capture if additional confirmation is required. Verify that the application can communicate with its server normally.

Tags

No tags yet.

Community rating

/ 5 (0)

Discussion (0)

    No comments yet.