Created on
‎07-04-2023
09:33 PM
Edited on
‎10-07-2025
09:43 PM
By
Anthony_E
Description |
This article discusses troubleshooting techniques and common issues that can occur when configuring port forwarding/Virtual IPs (VIPs) in NGFW policy-based mode, including what to check for in terms of packet captures and debug flow trace output. |
Scope | FortiGate; NGFW policy-based mode; Virtual IPs |
Solution |
As a primer on NGFW policy-based mode and configuring port forwarding/VIPs, refer to the following KB article: Technical Tip: How to configure port forwarding/Virtual IPs when using NGFW policy-based mode
As discussed in the above article, NGFW policy-based mode enables Central SNAT automatically, which means that incoming connections destined for the VIP external IP address will automatically be translated to the real mapped IP address; there is no need to place the VIP object itself into any FortiGate policies.
However, it is critical during VIP setup that administrators have matching policies in both the SSL Inspection & Authentication Policy section as well as the Security Policy section. If policies are not added to each section to accept VIP traffic based on the real mapped IP address as the destination, then the traffic will not be allowed through.
NGFW policy-mode splits policy assessment into two stages that are handled by two separate modules, and this can make troubleshooting more challenging compared to NGFW profile-based mode:
Administrators who are used to troubleshooting NGFW profile-based mode may have some initial difficulty when troubleshooting policy matching in NGFW policy-based mode, as the debug flow will only ever show traffic as matching to one of the SSL Inspection & Authentication Policies. This can be even more confusing when considering that many NGFW policy-mode deployments will only ever utilize the single 'Default' SSL Inspection & Authentication policy that allows Any/Any traffic, so the debug flow will often say that many different traffic flows are all matching the same policy ID.
Note that it is possible to debug the PME to see which Security Policy is matched, though in some cases it may be faster to perform a manual review of the configured Security Policy list due to the complex and dynamic nature of how the PME matches traffic to a given policy. This article will not discuss PME debug output due to its complexity, so for more guidance on debugging Security Policy assessment by the PME, refer to the following KB article instead: Technical Tip: How to check NGFW policy matching
Troubleshooting Example: Consider the following example topology, where the FortiGate has a VIP with an external address of 100.64.0.1 and a mapped address of 192.168.189.2 (which corresponds to an on-site server). Note that in this case, there is no inbound Source NAT enabled (and therefore no Central SNAT policies to consider):
Scenario 1: There is an SSL Inspection & Authentication policy, but no Security Policy.
diagnose sniffer packet any 'host 100.64.0.100 and icmp' 4
2. A debug flow trace is started on the FortiGate while the client's pings are coming in. The output indicates that traffic should be matched to a policy and sent to IPS:
FortiGate # diagnose debug flow filter saddr 100.64.0.100
id=20085 trace_id=13 func=print_pkt_detail line=5822 msg="vd-root:0 received a packet(proto=1, 100.64.0.100:1->100.64.0.1:2048) from wan1. type=8, code=0, id=1, seq=123."
Solution: In this case, traffic is matching the first stage of policy assessment (SSL Inspection & Authentication Policy #2 is matched and allowing traffic), and traffic is being sent to the IPS Engine for Security Policy matching, but it is NOT being forwarded out via port1 as expected. In this case, check the Security Policy list and see if an appropriate policy exists that allows traffic destined for the VIP's mapped IP address (192.168.189.2 in this scenario). If an appropriate match is not present, then add a policy and re-test.
Scenario 2: There is a Security Policy, but no SSL Inspection & Authentication policy.
diagnose sniffer packet any 'host 100.64.0.100 and icmp' 4
2. Meanwhile in the debug flow trace, traffic is being dropped at this stage due to forward policy check failure:
FortiGate # diagnose debug flow filter saddr 100.64.0.100
id=20085 trace_id=17 func=print_pkt_detail line=5822 msg="vd-root:0 received a packet(proto=1, 100.64.0.100:1->100.64.0.1:2048) from wan1. type=8, code=0, id=1, seq=127."
Solution: This scenario may be more familiar to administrators who frequently troubleshoot NGFW profile-based mode FortiGates, as the forward policy check message indicates that traffic did not match a created SSL Inspection & Authentication Policy (instead, it matched to the implicit-deny policy). To solve this, check and add an appropriate SSL Inspection & Authentication Policy.
Scenario 3: There is both a Security Policy and an SSL Inspection & Authentication Policy available to match this traffic (i.e., working traffic flow).
diagnose sniffer packet any 'host 100.64.0.100 and icmp' 4
FortiGate # diagnose debug flow filter saddr 100.64.0.100
id=20085 trace_id=21 func=print_pkt_detail line=5822 msg="vd-root:0 received a packet(proto=1, 100.64.0.100:1->100.64.0.1:2048) from wan1. type=8, code=0, id=1, seq=131."
Related articles: Technical Tip: How to configure port forwarding/Virtual IPs when using NGFW policy-based mode Technical Tip: How to check NGFW policy matching FortiGate Parallal Path Processing - Packet flow ingress and egress |
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2025 Fortinet, Inc. All Rights Reserved.