The content you are looking for has been archived. View related content below.
Description
This article describes how Virtual IPs (VIPs) impact outgoing Source NAT (SNAT) for traffic coming from the Mapped Address host.
Scope
FortiGate, Virtual IPs, IP Pools, Source NAT.
Solution
While VIPs are primarily used for incoming Destination NAT (e.g. translating from a public external IP address to a private mapped internal address), they can also perform outgoing Source NAT if the traffic matches the VIP's Mapped Address and port/protocol settings.
This behavior occurs even if the VIP is not placed in an outbound Firewall Policy, though it does require the VIP to be added to at least one Firewall Policy (such as a WAN-to-LAN inbound policy). If Central SNAT is being utilized then the VIP does not need to be added to any Firewall Policies to take effect.
As a quick primer for Source NAT behavior on the FortiGate:
Using Virtual IP External Addresses for Source NAT.
For the Virtual IP External Address to be used when performing outgoing Source NAT, certain conditions must be met:
Example: consider a VIP that is set with a listening Interface of wan1, an External address of 100.65.0.100, a Mapped Address of 192.168.0.100, and Optional Filters -> Services set to the 'All_TCP' Service object.
VIPs, IP Pools, and the 'nat-source-vip' Option.
When configuring Source NAT in Firewall Policies, it is possible to create and apply IP Pools instead of using the Outgoing Interface Address option. These IP Pools will override the Virtual IP Source NAT behavior described above by default, though this is configurable. Depending on the use case, it may be preferable to have the Virtual IP External address used instead of the IP Pool.
To control this behavior, modify the nat-source-vip CLI option within the Virtual IP config:
config firewall vip
edit <VIP>
set nat-source-vip [ enable | disable ] << Default: disable
end
With that in mind, the following is the order of preference that the FortiGate uses when determining which IP address (IP Pool, VIP, Outgoing Interface Address) to use when Source NAT'ing traffic. Note that this list assumes that traffic could already potentially match any three of the options:
Note:
When nat-source-vip is enabled, the VIP external address will be used for all traffic from the mapped-host that is being Source NAT'd, even if traffic is egressing from a different interface than the VIP is configured for (and even if other VIPs match that mapped-host). Use this option with caution.
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 2024 Fortinet, Inc. All Rights Reserved.