Description | This article describes a scenario where the firewall performs SNAT even though no NAT is configured in the firewall policy. |
Scope | All FortiGate. |
Solution |
Setup: source: 10.64.56.147 --- Core interface --- Virtual server profile 'LoadBalance-HTTPS-4444' 10.64.9.11:4444 ===> 10.64.10.68:4444, 10.64.10.87:4444 --- Traffic exiting to the actual server via Core interface.
In this setup, the firewall is receiving the traffic via the Core interface from the source 10.64.56.147, and after performing DNAT, the route for the DNAT IP is also via the same Core interface.
Route details:
Core # get router info routing-table details 10.64.56.147
Debug logs:
2025-04-17 08:59:48 id=65308 trace_id=3231 func=print_pkt_detail line=5862 msg="vd-root:0 received a packet(proto=6, 10.64.56.147:51952->10.64.9.11:4444) tun_id=0.0.0.0 from Core. flag [S], seq 4263811835, ack 0, win 64260"
2025-04-17 08:59:48 id=65308 trace_id=3231 func=iprope_shaping_check line=914 msg="in-[Core], out-[Core], skb_flags-020004c0, vid-8"
Reason: In this scenario, traffic enters and exits the FortiGate through the same interface. As a result, FortiOS automatically applies Source NAT (SNAT), even though NAT is not explicitly configured in the firewall policy.
This behavior ensures that the router forwards return traffic through the FortiGate, as the source IP address is replaced with one that belongs to the FortiGate. Without SNAT, the original source IP would be preserved, which might trigger anti-spoofing mechanisms on the router.
Additionally, bypassing SNAT could cause reply traffic from the server to be sent directly to the client, bypassing both the router and FortiGate, which could lead to asymmetric routing or security policy violations.
If needed, the automatic application of source NAT by the hairpin policy can be disabled using the following per-VDOM setting:
config system setting set snat-hairpin-traffic disable end |
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.