FortiGate Debug Flow: Why Doesn't the Packet Pass?


“The firewall is blocking it” is the most common ticket a firewall admin gets. Sometimes it’s true. Often it’s routing, NAT, an asymmetric path, or the application itself.

The GUI logs only show you what was logged. diagnose debug flow shows you what the FortiGate decided for a specific packet and why. It’s the single most useful command on the box, and this is the sequence I run every time.

1. Start clean

Leftover filters from the last session are the classic way to waste ten minutes looking at nothing.

diagnose debug reset
diagnose debug flow filter clear
diagnose debug disable

2. Filter tightly

Never run debug flow without a filter on a production box. Filter on what you know about the failing connection:

diagnose debug flow filter addr 10.0.10.25
diagnose debug flow filter dport 443
diagnose debug flow filter proto 6

On newer builds you can be more specific with saddr / daddr. Use diagnose debug flow filter without arguments to print the current filter and check it before starting.

3. Run the trace

diagnose debug flow show function-name enable
diagnose debug console timestamp enable
diagnose debug flow trace start 50
diagnose debug enable

Now reproduce the problem – open the page, start the ping, whatever fails. When you’re done:

diagnose debug disable

trace start 50 limits the output to 50 packets, so even if you forget to stop it, it won’t flood the console.

4. Read the output

A trace walks through the packet’s life: received → session lookup → route lookup → policy check → NAT → sent. These are the lines that matter:

MessageWhat it means
received a packet(proto=6, 10.0.10.25:51544->203.0.113.10:443) from port2Packet arrived – check the ingress interface is the one you expect
allocate a new session-0001a2b3No existing session, new one created
find a route: flag=04000000 gw-198.51.100.1 via wan1Route lookup result – egress interface and next hop
Allowed by Policy-12: SNATMatched policy 12, source NAT applied
SNAT 10.0.10.25->198.51.100.50:62011Translated source – verify the public IP
Denied by forward policy check (policy 0)No policy matched → implicit deny
reverse path check fail, dropRPF failed – no route back to the source via the ingress interface
iprope_in_check() check failed on policy 0, dropTraffic to the FortiGate dropped – local-in policy or admin access

Typical root causes behind those lines

policy 0 – nothing matched. Check interface pair, source/destination objects, service, schedule, and in particular users/groups on the policy: a policy with a group won’t match an unauthenticated user.

reverse path check fail – almost always routing asymmetry. Traffic comes in via wan2 but the route back to the source points to wan1. Fix the routing (or SD-WAN rules), don’t reach for set asymroute enable unless you understand the consequences – it disables stateful inspection for the VDOM.

iprope_in_check() check failed – something is trying to reach the FortiGate itself and is blocked. If you just deployed a local-in policy, this is your confirmation it works – or that you forgot to add the monitoring server.

No output at all – the packet never reached the FortiGate (upstream problem), or your filter is wrong, or the session is already established and offloaded to the NPU. More on that below.

5. Sniffer – see the actual packets

Debug flow tells you the decision. The sniffer tells you whether packets arrive and leave at all.

diagnose sniffer packet any 'host 10.0.10.25 and port 443' 4 0 l
  • any – all interfaces
  • 4 – verbosity: headers plus interface name (the most useful level)
  • 0 – unlimited count (stop with Ctrl+C)
  • l – local timestamps

The interface name in the output is what you really want. If you see the SYN go in on port2 and out on wan1, but no SYN-ACK coming back, the problem is upstream – not the FortiGate.

The NPU offload trap

On models with NP/SoC processors, established sessions are offloaded to hardware. Offloaded packets don’t show up in the sniffer or debug flow – only the first few packets of a session do. If a long-running session misbehaves, temporarily disable offload on the policy:

config firewall policy
    edit 12
        set auto-asic-offload disable
    next
end

Turn it back on when you’re done. Forgetting this is a good way to cut the throughput of a busy policy.

6. Session table

diagnose sys session filter clear
diagnose sys session filter dst 203.0.113.10
diagnose sys session filter dport 443
diagnose sys session list

Useful fields in the output: policy_id, proto_state, expire, and the hook=post / hook=pre lines showing the NAT translation. npu_state tells you whether the session is offloaded.

To force a new session after a policy change:

diagnose sys session clear

Always set a filter first. Without a filter this clears every session on the box, including yours.

7. IPsec – when the tunnel won’t come up

diagnose vpn ike gateway list name <phase1>
diagnose vpn tunnel list name <phase1>

diagnose debug reset
diagnose vpn ike log filter rem-addr4 198.51.100.77
diagnose debug application ike -1
diagnose debug enable

Things to look for in the IKE debug:

  • no proposal chosen – encryption/DH mismatch in phase 1 or 2
  • peer SA proposal not match local policy / selector errors – phase 2 subnets don’t match (common against Cisco ASA or Palo Alto, which are strict about selectors)
  • negotiation timeout – packets don’t arrive; check UDP 500/4500 upstream and NAT-T
  • tunnel up but no traffic – missing static route or firewall policy towards the tunnel interface

8. Other one-liners I use weekly

get system status                          # version, serial, HA mode
get system performance status              # CPU, memory, sessions
diagnose sys top 2 20                      # top processes
get router info routing-table all
get router info bgp summary
get system ha status
diagnose sys ha checksum cluster           # HA config in sync?
diagnose debug crashlog read
diagnose debug config-error-log read       # config lines rejected after upgrade

The workflow in one paragraph

Reset, filter on the exact flow, trace 50 packets, reproduce, disable. Read the route lookup and the policy line first. If debug flow is empty, sniff to see if the packet arrives at all. If it’s an established session, check offload. And clean up after yourself – diagnose debug reset costs nothing and saves the next person from confusion.