Why Isn't Traffic Passing Through My FortiGate?
Policy 0, a deny, a reverse path drop, no route or no NAT? Five ways traffic fails through a FortiGate, and how diagnose debug flow tells them apart.

Traffic isn't getting through the firewall. It's one of the vaguest tickets an MSP gets. The cause could be a policy, a route, NAT, or something upstream of the firewall altogether, and the first thing most people do is open the policy list and start reading.
That's often the wrong place to start. While building this lab I broke traffic through a FortiGate five different ways. Only two of them were policy problems, one of them looked exactly like a policy problem when it wasn't, and in one the FortiGate allowed every packet and the traffic still failed.
In this post I'll break the same small lab five ways and show the one tool that tells them apart: diagnose debug flow. It traces a packet through the FortiGate's decisions, step by step, and shows you exactly where it stopped.
Lab setup
One FortiGate in Cisco Modeling Labs (CML), with a client, a server and an internet connection:
- fgt02 is a FortiGate-VM running FortiOS 7.4.13 on Fortinet's free permanent trial licence. It kept its default hostname, its serial number, so that's the prompt you'll see in the output.
- client01 is a small Linux node on the LAN, 198.51.100.10, using the FortiGate as its gateway.
- srv01 is a Linux node on the server network, 203.0.113.10, running a tiny web server on port 80 that answers
hello from srv01. - port3 connects to CML's NAT connector, which gives the FortiGate a DHCP address (192.168.255.166) and a way out to the internet.
| FortiGate port | Alias | Address | Connects to |
|---|---|---|---|
| port2 | LAN | 198.51.100.1/24 | client01 |
| port1 | SERVERS | 203.0.113.1/24 | srv01 |
| port3 | (internet) | DHCP | CML NAT connector |
Two firewall policies carry the traffic:
- Policy 1
LAN-to-SERVERS: port2 to port1, all services, accept, no NAT. - Policy 2
LAN-to-Internet: port2 to port3, all services, accept, NAT enabled.
The LAN and server addresses come from the ranges reserved for documentation, so nothing clashes with a real network.
One thing to know about the trial licence: CML gave the VM four network interfaces, but FortiOS only showed port1 to port3. The trial licence appears to cap the number of interfaces, which is why the servers are on port1 rather than port4. It also limits you to a handful of policies and routes, but this lab fits comfortably.
Grab the lab from GitHub. Fortinet doesn't ship FortiGate with CML, so you'll need to add a FortiGate-VM image as a node definition called fortigate first, and license it with the free permanent trial. Then in CML, choose Import, select fortigate-traffic-not-passing.yaml and start the lab. client01 and srv01 boot with their addresses already set. Once fgt02 is licensed, paste in configs/fgt02.txt. The faults.md file has the commands to break and fix each fault in this post.
What healthy looks like
Once the lab is up, test from client01:
client01$ ping -c 3 203.0.113.10
PING 203.0.113.10 (203.0.113.10) 56(84) bytes of data.
64 bytes from 203.0.113.10: icmp_seq=1 ttl=63 time=0.527 ms
64 bytes from 203.0.113.10: icmp_seq=2 ttl=63 time=0.599 ms
64 bytes from 203.0.113.10: icmp_seq=3 ttl=63 time=0.600 ms
--- 203.0.113.10 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2047ms
client01$ curl http://203.0.113.10
hello from srv01
client01$ ping -c 3 1.1.1.1
64 bytes from 1.1.1.1: icmp_seq=1 ttl=54 time=12.3 ms
...
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
The TTL of 63 on the replies from srv01 confirms the traffic is being routed through the FortiGate, not around it.
Now the tool for the rest of the post. On the FortiGate, filter on the address you're troubleshooting, limit the trace to 10 packets, and turn it on:
FGVMEVHYJJGYQA5A # diagnose debug reset
FGVMEVHYJJGYQA5A # diagnose debug flow filter addr 203.0.113.10
FGVMEVHYJJGYQA5A # diagnose debug flow show function-name enable
FGVMEVHYJJGYQA5A # diagnose debug flow trace start 10
FGVMEVHYJJGYQA5A # diagnose debug enable
The filter matters. Without it, a busy firewall prints every packet it sees and the output is unreadable. Reproduce the problem from the client, then run diagnose debug disable.
Here's a healthy ping, the first packet and its reply:
id=65308 trace_id=4 func=print_pkt_detail line=6019 msg="vd-root:0 received a packet(proto=1, 198.51.100.10:6->203.0.113.10:2048) tun_id=0.0.0.0 from port2. type=8, code=0, id=6, seq=1."
id=65308 trace_id=4 func=init_ip_session_common line=6220 msg="allocate a new session-0000007a"
id=65308 trace_id=4 func=__vf_ip_route_input_rcu line=1989 msg="find a route: flag=00000000 gw-0.0.0.0 via port1"
id=65308 trace_id=4 func=__iprope_tree_check line=535 msg="gnum-100004, use addr/intf hash, len=2"
id=65308 trace_id=4 func=fw_forward_handler line=1002 msg="Allowed by Policy-1:"
id=65308 trace_id=4 func=ip_session_confirm_final line=3193 msg="npu_state=0x100, hook=4"
id=65308 trace_id=5 func=print_pkt_detail line=6019 msg="vd-root:0 received a packet(proto=1, 203.0.113.10:6->198.51.100.10:0) tun_id=0.0.0.0 from port1. type=0, code=0, id=6, seq=1."
id=65308 trace_id=5 func=resolve_ip_tuple_fast line=6121 msg="Find an existing session, id-0000007a, reply direction"
id=65308 trace_id=5 func=__vf_ip_route_input_rcu line=1989 msg="find a route: flag=00000000 gw-0.0.0.0 via port2"
The first packet answers four questions, in order:
- Where did it arrive?
received a packet ... from port2 - Is it new?
allocate a new session - Where does it go?
find a route ... via port1 - Is it allowed?
Allowed by Policy-1
The reply skips the policy question entirely. It matches the session the first packet created (Find an existing session ... reply direction), and so does every later packet in either direction. Only the first packet of a session is checked against the policies. When traffic fails, the trace stops at one of those four questions, and which one tells you what kind of fault you've got.
Fault 1: no policy matches
The simplest way traffic stops is that no policy allows it. To simulate it, disable policy 1:
FGVMEVHYJJGYQA5A # config firewall policy
FGVMEVHYJJGYQA5A (policy) # edit 1
FGVMEVHYJJGYQA5A (1) # set status disable
FGVMEVHYJJGYQA5A (1) # next
FGVMEVHYJJGYQA5A (policy) # end
A ping from client01 to srv01 now gets no reply. Here's the debug flow:
id=65308 trace_id=1 func=print_pkt_detail line=6019 msg="vd-root:0 received a packet(proto=1, 198.51.100.10:5->203.0.113.10:2048) tun_id=0.0.0.0 from port2. type=8, code=0, id=5, seq=1."
id=65308 trace_id=1 func=init_ip_session_common line=6220 msg="allocate a new session-00000073"
id=65308 trace_id=1 func=__vf_ip_route_input_rcu line=1989 msg="find a route: flag=00000000 gw-0.0.0.0 via port1"
id=65308 trace_id=1 func=__iprope_tree_check line=535 msg="gnum-100004, use addr/intf hash, len=1"
id=65308 trace_id=1 func=fw_forward_handler line=839 msg="Denied by forward policy check (policy 0)"
It arrived on the right interface, and the route lookup found port1, so this isn't a routing problem. It failed at the fourth question. Policy 0 is the implicit deny at the bottom of every policy list, so policy 0 means nothing matched at all.
The reason is in the config, but it's easy to miss among the other lines:
FGVMEVHYJJGYQA5A # show firewall policy
config firewall policy
edit 1
set status disable
set name "LAN-to-SERVERS"
set uuid 081747a4-d7cf-51f1-b68f-377b62a3d4a5
set srcintf "port2"
set dstintf "port1"
set action accept
...
The trace mentions gnum-100004. That's the forward policy table the FortiGate actually checks traffic against, and you can list it:
FGVMEVHYJJGYQA5A # diagnose firewall iprope list 100004
policy index=0 uuid_idx=1 action=drop
flag (8010800): d_rm master pol_stats
flag2 (4000): resolve_sso
flag3 (100): last-deny
...
source(1): 0.0.0.0-255.255.255.255, uuid_idx=0,
dest(1): 0.0.0.0-255.255.255.255, uuid_idx=0,
Only the implicit deny is there. Policy 1 is still in the config, but a disabled policy isn't loaded into the table at all.
Fix: enable the policy again with set status enable. Then check it's back in the table, above the implicit deny:
FGVMEVHYJJGYQA5A # diagnose firewall iprope list 100004 | grep "policy index"
policy index=1 uuid_idx=15848 action=accept
policy index=0 uuid_idx=1 action=drop
The FortiOS grep is more limited than the Linux one. It only takes -i -n -v -f -c -A -B -C, so there's no -E.
Fault 2: a deny above the allow
"Some things work and some don't" usually points at the policy order. Someone adds a block for web traffic, puts it above the allow, and forgets about it:
FGVMEVHYJJGYQA5A # config firewall policy
FGVMEVHYJJGYQA5A (policy) # edit 2
FGVMEVHYJJGYQA5A (2) # set name "Block-Web-Temp"
FGVMEVHYJJGYQA5A (2) # set srcintf "port2"
FGVMEVHYJJGYQA5A (2) # set dstintf "port1"
FGVMEVHYJJGYQA5A (2) # set srcaddr "all"
FGVMEVHYJJGYQA5A (2) # set dstaddr "all"
FGVMEVHYJJGYQA5A (2) # set action deny
FGVMEVHYJJGYQA5A (2) # set schedule "always"
FGVMEVHYJJGYQA5A (2) # set service "HTTP"
FGVMEVHYJJGYQA5A (2) # next
FGVMEVHYJJGYQA5A (policy) # move 2 before 1
FGVMEVHYJJGYQA5A (policy) # end
Now ping to srv01 still works, but the website doesn't load. Run the debug flow while you do both, and the two traces split. The ping:
id=65308 trace_id=14 func=__iprope_tree_check line=535 msg="gnum-100004, use addr/intf hash, len=2"
id=65308 trace_id=14 func=fw_forward_handler line=1002 msg="Allowed by Policy-1:"
The curl:
id=65308 trace_id=20 func=print_pkt_detail line=6019 msg="vd-root:0 received a packet(proto=6, 198.51.100.10:39396->203.0.113.10:80) tun_id=0.0.0.0 from port2. flag [S], seq 4184582137, ack 0, win 64240"
id=65308 trace_id=20 func=init_ip_session_common line=6220 msg="allocate a new session-0000007d"
id=65308 trace_id=20 func=__vf_ip_route_input_rcu line=1989 msg="find a route: flag=00000000 gw-0.0.0.0 via port1"
id=65308 trace_id=20 func=__iprope_tree_check line=535 msg="gnum-100004, use addr/intf hash, len=3"
id=65308 trace_id=20 func=fw_forward_handler line=839 msg="Denied by forward policy check (policy 2)"
I ran this fault before adding the internet policy, so the block got ID 2. If you're following along with the lab files, policy 2 is already the internet policy, so faults.md uses ID 3 and your trace will say policy 3.
Compare that with fault 1. policy 0 means nothing matched. policy 2 means a real policy matched and denied it. That one number tells you whether to look for a missing policy or an unwanted one.
The SYN was sent three more times as the client retried. Each attempt got a brand new session and the same deny, because nothing is kept for a denied packet.
You can also ask the FortiGate which policy a flow would hit, without sending any traffic at all:
FGVMEVHYJJGYQA5A # diagnose firewall iprope lookup 198.51.100.10 40000 203.0.113.10 80 6 port2
<src [198.51.100.10-40000] dst [203.0.113.10-80] proto 6 dev port2> matches policy id: 2
The arguments are the source IP and port, the destination IP and port, the protocol number (6 is TCP) and the incoming interface. I couldn't get it to work for ICMP: both ways I tried returned Command fail. Return code -16. So stick to TCP or UDP with this one.
Now look at the policy itself:
FGVMEVHYJJGYQA5A # show firewall policy
config firewall policy
edit 2
set name "Block-Web-Temp"
set uuid 6e4df832-d7d0-51f1-69c9-1dd7cc2fdd74
set srcintf "port2"
set dstintf "port1"
set srcaddr "all"
set dstaddr "all"
set schedule "always"
set service "HTTP"
set logtraffic disable
next
edit 1
set name "LAN-to-SERVERS"
...
There's no set action line. Deny is the default action, and show hides anything that's at its default, so a deny policy never says "deny". If you skim the config looking for the word, you won't find it. Compare it with policy 1, which does have set action accept.
Fix: a "temporary" block that was never removed should be deleted with delete 2. Moving it below policy 1 would only leave a rule that can never match.
One warning before you test your fix. Straight after end, the lookup still said matches policy id: 2, and the table still listed policy 2. About 10 seconds later, it had caught up:
FGVMEVHYJJGYQA5A # diagnose firewall iprope lookup 198.51.100.10 40000 203.0.113.10 80 6 port2
<src [198.51.100.10-40000] dst [203.0.113.10-80] proto 6 dev port2> matches policy id: 1
The same delay happened when I added the policy. If you test the instant you've typed end, a correct fix can look like it didn't work.
Fault 3: the reverse path check
This one usually arrives as "we've added a new subnet behind the LAN, and those users can't get to the server, but everyone else is fine". Nothing on the FortiGate has changed. The fault is a route that nobody added.
To simulate a user on a new subnet, 10.99.0.0/24, give client01 a second address and send traffic from it:
client01$ ip addr add 10.99.0.10/32 dev eth1
client01$ ping -c 3 -I 10.99.0.10 203.0.113.10
client01$ curl --max-time 5 --interface 10.99.0.10 http://203.0.113.10
The debug flow:
id=65308 trace_id=24 func=print_pkt_detail line=6019 msg="vd-root:0 received a packet(proto=1, 10.99.0.10:8->203.0.113.10:2048) tun_id=0.0.0.0 from port2. type=8, code=0, id=8, seq=1."
id=65308 trace_id=24 func=init_ip_session_common line=6220 msg="allocate a new session-00000088"
id=65308 trace_id=24 func=ip_route_input_slow line=1696 msg="reverse path check fail, drop"
id=65308 trace_id=24 func=ip_session_handle_no_dst line=6306 msg="trace"
Look at what's missing: there's no find a route line and no policy line. The packet is dropped in the routing stage, before any policy is checked, so there's no "Denied by policy" to find. Every ping and every retried SYN from the curl was dropped the same way.
The reverse path check asks one question: "If I had to reply to this source address, would the reply go back out the interface this packet came in on?" Here's the routing table:
FGVMEVHYJJGYQA5A # get router info routing-table all
...
S* 0.0.0.0/0 [5/0] via 192.168.255.1, port3, [1/0]
C 192.168.255.0/24 is directly connected, port3
C 198.51.100.0/24 is directly connected, port2
C 203.0.113.0/24 is directly connected, port1
The only route that covers 10.99.0.10 is the default route, and that points out port3, to the internet. The packet came in on port2, so the check fails.
This surprised me a little. FortiOS has a strict and a loose reverse path check, and this FortiGate is using the loose one:
FGVMEVHYJJGYQA5A # get system settings | grep strict-src-check
strict-src-check : disable
Even so, it dropped the packet. A default route out a different interface doesn't count as a way back.
Fix: tell the FortiGate where the new subnet lives. In real life, the gateway would be the router the new subnet sits behind. In the lab, client01 plays that role:
FGVMEVHYJJGYQA5A # config router static
FGVMEVHYJJGYQA5A (static) # edit 1
FGVMEVHYJJGYQA5A (1) # set dst 10.99.0.0 255.255.255.0
FGVMEVHYJJGYQA5A (1) # set gateway 198.51.100.10
FGVMEVHYJJGYQA5A (1) # set device "port2"
FGVMEVHYJJGYQA5A (1) # next
FGVMEVHYJJGYQA5A (static) # end
FGVMEVHYJJGYQA5A # get router info routing-table details 10.99.0.10
Routing table for VRF=0
Routing entry for 10.99.0.0/24
Known via "static", distance 10, metric 0, best
* vrf 0 198.51.100.10, via port2
Now the trace goes through all four questions, and the reply goes back out port2 using the new route:
id=65308 trace_id=32 func=__vf_ip_route_input_rcu line=1989 msg="find a route: flag=00000000 gw-0.0.0.0 via port1"
id=65308 trace_id=32 func=__iprope_tree_check line=535 msg="gnum-100004, use addr/intf hash, len=2"
id=65308 trace_id=32 func=fw_forward_handler line=1002 msg="Allowed by Policy-1:"
...
id=65308 trace_id=33 func=resolve_ip_tuple_fast line=6121 msg="Find an existing session, id-00000090, reply direction"
id=65308 trace_id=33 func=__vf_ip_route_input_rcu line=1989 msg="find a route: flag=00000000 gw-198.51.100.10 via port2"
client01$ curl --max-time 5 --interface 10.99.0.10 http://203.0.113.10
hello from srv01
Fault 4: no route to the destination
"Nobody can get to the internet, but internal stuff still works." To simulate losing the default route, stop port3 taking one from DHCP:
FGVMEVHYJJGYQA5A # config system interface
FGVMEVHYJJGYQA5A (interface) # edit port3
FGVMEVHYJJGYQA5A (port3) # set defaultgw disable
FGVMEVHYJJGYQA5A (port3) # next
FGVMEVHYJJGYQA5A (interface) # end
This time the client gets a clue straight away:
client01$ ping -c 3 1.1.1.1
PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data.
From 198.51.100.1 icmp_seq=1 Destination Net Unreachable
From 198.51.100.1 icmp_seq=2 Destination Net Unreachable
From 198.51.100.1 icmp_seq=3 Destination Net Unreachable
--- 1.1.1.1 ping statistics ---
3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2028ms
client01$ curl --max-time 5 http://203.0.113.10
hello from srv01
Destination Net Unreachable from the gateway means the gateway has no route. It's worth asking a user for the exact error before you log in to anything. The debug flow, filtered on 1.1.1.1:
id=65308 trace_id=34 func=print_pkt_detail line=6019 msg="vd-root:0 received a packet(proto=1, 198.51.100.10:12->1.1.1.1:2048) tun_id=0.0.0.0 from port2. type=8, code=0, id=12, seq=1."
id=65308 trace_id=34 func=init_ip_session_common line=6220 msg="allocate a new session-00000098"
id=65308 trace_id=34 func=__vf_ip_route_input_rcu line=1989 msg="find a route: flag=00000000 gw-0.0.0.0 via root"
There's no "no route" message anywhere. The tell is via root: instead of an interface, the route lookup came back with root, the name of the VDOM itself, and the trace stops there. The routing table confirms it:
FGVMEVHYJJGYQA5A # get router info routing-table details 1.1.1.1
% Network not in table
Here's the trap. If you go straight to the policy lookup from fault 2, this is what you get:
FGVMEVHYJJGYQA5A # diagnose firewall iprope lookup 198.51.100.10 40000 1.1.1.1 443 6 port2
<src [198.51.100.10-40000] dst [1.1.1.1-443] proto 6 dev port2> matches policy id: 0
Policy 0, exactly like fault 1, even though policy 2 is fine. The FortiGate has to work out the outgoing interface from the route before it can match a policy, and policy 2 only matches traffic leaving port3. With no route, there's no outgoing interface, so nothing matches. Check the route before you blame the policy.
Fix: set defaultgw enable on port3. A few seconds later the default route is back:
FGVMEVHYJJGYQA5A # get router info routing-table details 1.1.1.1
Routing table for VRF=0
Routing entry for 0.0.0.0/0
Known via "static", distance 5, metric 0, best
* vrf 0 192.168.255.1, via port3, origin 1
The DHCP default route shows as "static", with a distance of 5.
Fault 5: no NAT
This fault had the biggest surprise of the five: the FortiGate allows every packet, and the traffic still fails. To simulate it, turn NAT off on the internet policy, then clear any existing sessions so ones made before the change can't skew the test:
FGVMEVHYJJGYQA5A # config firewall policy
FGVMEVHYJJGYQA5A (policy) # edit 2
FGVMEVHYJJGYQA5A (2) # set nat disable
FGVMEVHYJJGYQA5A (2) # next
FGVMEVHYJJGYQA5A (policy) # end
FGVMEVHYJJGYQA5A # diagnose sys session filter clear
FGVMEVHYJJGYQA5A # diagnose sys session filter dst 1.1.1.1
FGVMEVHYJJGYQA5A # diagnose sys session clear
FGVMEVHYJJGYQA5A # diagnose sys session filter clear
From the client, it fails differently from fault 4. There's no error, just silence:
client01$ ping -c 3 1.1.1.1
PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data.
--- 1.1.1.1 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 2073ms
And the debug flow looks healthy:
id=65308 trace_id=44 func=print_pkt_detail line=6019 msg="vd-root:0 received a packet(proto=1, 198.51.100.10:14->1.1.1.1:2048) tun_id=0.0.0.0 from port2. type=8, code=0, id=14, seq=1."
id=65308 trace_id=44 func=init_ip_session_common line=6220 msg="allocate a new session-000000a3"
id=65308 trace_id=44 func=__vf_ip_route_input_rcu line=1989 msg="find a route: flag=00000000 gw-192.168.255.1 via port3"
id=65308 trace_id=44 func=__iprope_tree_check line=524 msg="gnum-100004, use int hash, slot=37, len=2"
id=65308 trace_id=44 func=fw_forward_handler line=1002 msg="Allowed by Policy-2:"
id=65308 trace_id=44 func=ip_session_confirm_final line=3193 msg="npu_state=0x100, hook=4"
It arrived, a route was found, the policy allowed it, and it was sent. All four questions answered. The clue is what never appears: in fault 3's fixed trace, the reply showed up straight after (reply direction). Here, the second and third pings matched the session going out, and no reply ever came back.
When the FortiGate has done its job and the traffic still fails, look at what actually left the firewall. The packet sniffer shows it:
FGVMEVHYJJGYQA5A # diagnose sniffer packet port3 'host 1.1.1.1' 4 6
Using Original Sniffing Mode
interfaces=[port3]
filters=[host 1.1.1.1]
15.144896 port3 -- 198.51.100.10 -> 1.1.1.1: icmp: echo request
16.167638 port3 -- 198.51.100.10 -> 1.1.1.1: icmp: echo request
17.191562 port3 -- 198.51.100.10 -> 1.1.1.1: icmp: echo request
The packets are leaving with the internal LAN address as their source. Nothing upstream knows how to route back to 198.51.100.10, so the replies never arrive.
The last number in that command, 6, is how many packets to capture. With no replies, it never gets to 6, so it keeps hold of the console until you press Ctrl+C.
The policy has the same trap as fault 2:
FGVMEVHYJJGYQA5A # show firewall policy 2
config firewall policy
edit 2
set name "LAN-to-Internet"
set uuid a36f1e78-d7d1-51f1-9d77-d344012a1382
set srcintf "port2"
set dstintf "port3"
set action accept
set srcaddr "all"
set dstaddr "all"
set schedule "always"
set service "ALL"
next
end
There's no set nat line at all, because disabled is the default. The clue is a line that isn't there.
Fix: set nat enable on policy 2, and clear the sessions again. Now the trace shows the translation, both ways:
id=65308 trace_id=50 func=get_new_addr line=1280 msg="find SNAT: IP-192.168.255.166(from IPPOOL), port-60433"
id=65308 trace_id=50 func=fw_forward_handler line=1002 msg="Allowed by Policy-2: SNAT"
id=65308 trace_id=50 func=ip_session_confirm_final line=3193 msg="npu_state=0x100, hook=4"
id=65308 trace_id=50 func=__ip_session_run_tuple line=3526 msg="SNAT 198.51.100.10->192.168.255.166:60433"
id=65308 trace_id=51 func=print_pkt_detail line=6019 msg="vd-root:0 received a packet(proto=1, 1.1.1.1:60433->192.168.255.166:0) tun_id=0.0.0.0 from port3. type=0, code=0, id=60433, seq=1."
id=65308 trace_id=51 func=resolve_ip_tuple_fast line=6121 msg="Find an existing session, id-000000a6, reply direction"
id=65308 trace_id=51 func=__ip_session_run_tuple line=3539 msg="DNAT 192.168.255.166:0->198.51.100.10:16"
Allowed by Policy-2: has become Allowed by Policy-2: SNAT, the source is rewritten to port3's address, and the reply is translated back to the client. It says "from IPPOOL" even though there's no IP pool configured: the policy is using the outgoing interface's address. The sniffer agrees:
7.310559 port3 -- 192.168.255.166 -> 1.1.1.1: icmp: echo request
7.324477 port3 -- 1.1.1.1 -> 192.168.255.166: icmp: echo reply
8.312125 port3 -- 192.168.255.166 -> 1.1.1.1: icmp: echo request
8.326271 port3 -- 1.1.1.1 -> 192.168.255.166: icmp: echo reply
9.313790 port3 -- 192.168.255.166 -> 1.1.1.1: icmp: echo request
9.330407 port3 -- 1.1.1.1 -> 192.168.255.166: icmp: echo reply
Quick reference
| Where the trace stops | What the client sees | What else you see | Likely cause |
|---|---|---|---|
Denied by forward policy check (policy 0) |
Timeout | iprope list 100004 shows only policy 0 |
No policy matches, often a disabled one (set status disable) |
Denied by forward policy check (policy N) |
Some traffic works, some doesn't | iprope lookup names the same policy |
A deny policy above the allow. Look for a policy with no set action line |
reverse path check fail, drop, with no route or policy lines |
Timeout, only from the new subnet | The only route back to the source points out another interface | Missing route for a subnet behind the LAN |
find a route ... via root, then nothing |
Destination Net Unreachable from the gateway |
% Network not in table, and iprope lookup misleadingly says policy 0 |
No route to the destination |
Allowed by Policy-N: with no SNAT, and no reply direction |
Timeout | Sniffer shows the internal source address leaving | NAT off on the policy. Look for a missing set nat enable |
And the commands that told them apart:
diagnose debug flow filter addr <ip>andtrace start 10, to see which of the four questions a packet fails ondiagnose firewall iprope lookup <src> <sport> <dst> <dport> <proto> <in-port>, to see which policy a TCP or UDP flow would match without sending any trafficdiagnose firewall iprope list 100004 | grep "policy index", to see which policies are actually loadedget router info routing-table details <ip>, for the route to a destination or back to a sourcediagnose sniffer packet <port> 'host <ip>' 4 <count>, to see what actually leaves the firewall
Wrapping up
Only two of these five faults were policy problems, and a third looked exactly like one: with no route, the policy lookup said policy 0, the same answer as a missing policy. In the other two, the FortiGate either dropped the packet before it reached a policy, or allowed it and let it fail further on. So when a ticket says "traffic isn't passing", don't start by reading the policy list. Run the debug flow, see which of the four questions the packet fails on, and start there.
Two of the faults were hiding in lines that weren't there. show leaves out default values, so a deny policy has no set action line, and a policy with NAT off has no set nat line. When a config looks fine, check what's missing as well as what's there.
And give policy changes a few seconds before you test them. Twice in this lab, the FortiGate was still using the old policy straight after end.
When you're done, run execute shutdown on the FortiGate before you stop the lab in CML.
About the author
- Network engineer at an MSP, after starting out in the core network team at a small ISP. I lab things at home, break them, and write up what I learn, from packet captures and firewalls to routing and troubleshooting.
Comments
Join the discussionNo comments yet. Be the first to comment.





