How to Verify Routing Decisions and Traffic Flow on FortiGate
Description
How to troubleshoot routing issues on FortiGate by verifying the routing table and analyzing traffic flow using the built-in packet sniffer.
When multiple network paths are available, such as Internet, MPLS, or IPsec VPN connections, traffic must be forwarded through the appropriate interface based on the configured routing information.
This article demonstrates how to verify the selected route, identify the interfaces used to forward traffic, and investigate unexpected routing behavior.
Scope
FortiGate.
Solution
Verify the routing configuration
Consider a FortiGate with the following routing requirements:
Destination network | Outgoing interface |
|---|---|
0.0.0.0/0 | WAN (ISP) |
10.10.10.0/24 | MPLS |
20.20.20.0/24 | VPN1 |
30.30.30.0/24 | VPN2 |
In this example, traffic destined for 10.10.10.0/24 should be forwarded through the MPLS interface, while traffic destined for 20.20.20.0/24 and 30.30.30.0/24 should use their respective VPN tunnels.
All other destinations should use the default route through the ISP, unless a more specific route or another routing mechanism applies.
To verify the configured static routes, navigate to Network -> Static Routes in the FortiGate GUI.
Alternatively, display the active routing table using the following CLI command:
get router info routing-table allTo inspect the routing information for a particular destination, use:
get router info routing-table details 10.10.10.16
Verify that the expected route is available and that the next-hop gateway and outgoing interface are correct.
Note: Routing decisions can also be influenced by policy routes, SD-WAN rules, and other routing mechanisms. Therefore, the presence of a route in the routing table does not necessarily mean it will be used for every matching traffic flow.
Verify traffic flow using the packet sniffer
For this example, consider the following communication:
Source IP: 172.16.0.100
Destination IP: 10.10.10.16
Expected outgoing interface: MPLS
Protocol: ICMP
Start a packet capture on the FortiGate using the following command:
diagnose sniffer packet any 'host 10.10.10.16 and icmp' 4 0
From the source host (172.16.0.100), initiate a ping towards 10.10.10.16.
Example output:
interfaces=[any]
filters=[host 10.10.10.16 and icmp]
11.097441 lan in 172.16.0.100 -> 10.10.10.16: icmp: echo request
11.097557 MPLS out 192.168.244.136 -> 10.10.10.16: icmp: echo request
11.129438 MPLS in 10.10.10.16 -> 192.168.244.136: icmp: echo reply
11.129477 lan out 10.10.10.16 -> 172.16.0.100: icmp: echo replyIn this example, source NAT (SNAT) translates the original source address (172.16.0.100) to 192.168.244.136 when traffic exits through the MPLS interface.
The packet capture shows the complete ICMP exchange:
Interface | Direction | Description |
|---|---|---|
lan | in | ICMP echo request received from the source |
MPLS | out | ICMP echo request forwarded through MPLS |
MPLS | in | ICMP echo reply received through MPLS |
lan | out | ICMP echo reply forwarded to the source |
The output confirms that the FortiGate receives the ICMP request through the LAN interface and forwards it through MPLS, as expected.
The reply is subsequently received through MPLS and forwarded back to the original source through LAN.
In this scenario, the observed traffic flow is consistent with the expected routing configuration.
Note: The numerical values at the beginning of each packet capture entry are timestamps. They do not represent packet or session identifiers.
Investigate unexpected routing behavior:
If traffic is forwarded through an unexpected interface, verify the routing configuration and identify which routing mechanism is responsible for selecting that path.
Depending on the configuration, check the following:
The destination network and subnet mask.
The configured next-hop gateway and outgoing interface.
Route distance and priority when multiple routes are available.
Policy routes or SD-WAN rules that could influence the forwarding decision.
Firewall policies and any applicable NAT configuration.
If the FortiGate forwards traffic through the expected interface but no reply is received, the next step is to investigate the return path.
For example, the packet sniffer might show:
lan in 172.16.0.100 -> 10.10.10.16: icmp: echo request
MPLS out 192.168.244.136 -> 10.10.10.16: icmp: echo request
In this case, the FortiGate receives the request and forwards it through MPLS, but no reply is observed.
This may indicate a problem outside the FortiGate, such as an incorrect return route, a downstream firewall restriction, or an unreachable destination.
However, additional troubleshooting is required to determine where the traffic is being lost.
Check for asymmetric routing:
In some network topologies, return traffic might arrive through a different interface from the one used to forward the original request.
For example:
lan in -> MPLS out (Request)
VPN1 in -> lan out (Reply)
This indicates an asymmetric traffic path.
Asymmetric routing can lead to unexpected behavior on stateful firewalls, depending on the FortiGate configuration, session handling, and enabled features.
If asymmetric routing is observed, review the routing configuration on the FortiGate and the upstream or downstream network devices to determine whether the behavior is expected.
Note: Return traffic arriving through a different interface does not automatically indicate a routing problem on the remote peer. Asymmetric traffic handling depends on the network topology and FortiGate configuration.
5. Additional troubleshooting checks:
If the issue persists, perform the following checks:
Verify next-hop connectivity
Confirm that the FortiGate can reach the expected next-hop gateway.
To perform a ping using a specific source IP address:
execute ping-options source <interface-IP>
execute ping <gateway-IP>
Ensure that the selected source IP address belongs to the intended interface and that the necessary connectivity exists.
Verify the return route
Confirm that the remote network has a valid route towards the source network or the translated source IP address when SNAT is enabled.
Verify the selected forwarding path
If the routing table appears correct but traffic still follows an unexpected path, use the FortiGate debug flow functionality to investigate the forwarding decision and identify possible policy or routing-related drops.
