Created on
03-17-2024
04:18 PM
Edited on
09-16-2025
04:22 AM
By
Jean-Philippe_P
Description |
This article describes SNAT network behavior when the primary and secondary interface IP address are on the same subnet. |
Scope | FortiGate. |
Solution |
When primary or secondary interface IP addresses have different subnets, FortiOS uses the address that has the same subnet as the gateway found on the route lookup for SNAT.
Firewall Policy using 'Use Outgoing Interface Address' for SNAT (port1 is part of 'virtual-wan-link'):
Checking the IP addresses using the CLI command 'diag ip address list', the Primary IP precedes the Secondary IP.
FortiOS will use the IP address that is at the top of the list for SNAT.
Confirmation using debug flow:
Session table:
In cloud environments like AWS, Azure, etc, where only the primary IP has an associated Elastic (public) IP and the secondary IP does not, the FortiGate can unexpectedly use the secondary IP for SNAT when using ‘Use Outgoing Interface Address’ is selected. When this happens, internet-bound traffic may fail because the chosen secondary IP lacks the required public address. To resolve this and restore the expected SNAT behaviour (where the primary IP is used), remove the secondary IPs from the interface and reconfigure them. This ensures that the primary IP remains properly positioned in the SNAT selection sequence again.
Technical Note: SNAT and primary versus secondary IP address. |
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.