Course menu

Module 3: NATLesson 3.1 (1 of 4 in this module)11 of 18 in the FortiGate Administrator course

Source NAT and IP pools

How a FortiGate translates outgoing traffic: the interface address, overload, one-to-one, fixed port range and port block allocation pools.

Intermediate · 11 min read

What you will learn

After this lesson, you can enable source NAT on a policy, choose and configure the right IP pool type, and confirm the translation in the session table.

  • Policy NAT
  • IP pools
  • Pool types
  • Reading NAT sessions

Source NAT (SNAT) replaces the source address (and usually the source port) of outgoing packets with an address the outside world can route back to. On a FortiGate in the default policy NAT mode, it is switched on per firewall policy and uses either the outgoing interface's address or an IP pool, a range of public addresses with a chosen translation method.

In simple terms: Inside addresses are private. On the way out, the FortiGate swaps them for its public address so replies can find their way back.

A real-life situation

FGT1's LAN users leave the Internet as 203.0.113.2, the port1 address. A payment provider now asks for FGT1's public address to whitelist, but the company wants payment traffic to use its own address, separate from everyday browsing. The ISP has routed a small extra block, 203.0.113.16/29, to FGT1. An IP pool puts those addresses to work.

NAT with the interface address

With set nat enable and no pool, the FortiGate uses the outgoing interface's address and changes the source port when needed to keep sessions apart, the same as PAT on a home router:

Arriving on port2
LAN
Source IP
10.0.1.10
Source port
51544
Destination IP
198.51.100.80
Destination port
443
Leaving port1
Internet
Source IP
203.0.113.2 (rewritten)
Source port
51544 (or another free port) (rewritten)
Destination IP
198.51.100.80
Destination port
443

Highlighted fields were rewritten by the router.

Only the source changes. The session table remembers the mapping and reverses it for the replies.

IP pool types

TypeHow it mapsUse it when
Overload (default)Many inside hosts → the pool's addresses, with port translationGeneral Internet access from a chosen address or addresses
One-to-oneEach inside host → its own pool address, no port change; new hosts fail when the pool is used upProtocols or partners that need one address per host
Fixed port rangeAn inside range → the pool, with a fixed, calculable port range per inside addressLarge networks where you must trace a public address and port back to a user without logs
Port block allocationEach inside host gets blocks of ports on a pool address, on demandCarrier-grade NAT: fewer log entries (one per block, not per session)

Configure an overload pool and use it

config firewall ippool edit Payments-Pool set type overload set startip 203.0.113.17 set endip 203.0.113.17 next end config firewall policy edit 5 set name "LAN-to-Payments" set srcintf "port2" set dstintf "port1" set srcaddr "LAN-subnet" set dstaddr "Payment-Provider" set action accept set schedule "always" set service "HTTPS" set nat enable set ippool enable set poolname "Payments-Pool" set logtraffic all next move 5 before 3 end

The policy must sit above the general LAN-to-Internet policy (3), or that one matches first. Payment-Provider is an address object for the provider's servers.

Verify the translation

Example output · based on Fortinet documentation; exact format varies by model and FortiOS version
FGT1 # diagnose sys session list
session info: proto=6 proto_state=01 ...
hook=post dir=org act=snat 10.0.1.10:51870->192.0.2.50:443(203.0.113.17:51870)
hook=pre dir=reply act=dnat 192.0.2.50:443->203.0.113.17:51870(10.0.1.10:51870)
misc=0 policy_id=5 ...
The value in brackets is the translated address and port: 203.0.113.17, from the pool, by policy 5. Sessions to other sites still show 203.0.113.2 by policy 3. (Example output, trimmed.)
diagnose firewall ippool-all list

Lists the configured pools and their ranges.

Why it works this way

Translation is part of the decision to allow traffic, so in policy NAT mode it lives on the policy: different policies can translate the same users differently depending on where they go. The pool type is a trade-off between saving public addresses (overload), keeping addresses stable per host (one-to-one), and making translations traceable with little logging (fixed port range, port block allocation).

Common mistakes

  • Creating the pool and enabling NAT, but forgetting set ippool enable: traffic uses the interface address.
  • Putting the more specific NAT policy below the general one, so it never matches.
  • Using pool addresses the ISP doesn't route to the FortiGate: replies go nowhere.
  • Choosing one-to-one for general browsing and running out of addresses.

Key takeaways

✅ Key takeaways
  • In policy NAT mode, source NAT is enabled per policy.
  • Without a pool, the outgoing interface address is used, with port translation.
  • Pools: overload (shared), one-to-one, fixed port range, port block allocation.
  • The session list shows the translated address in brackets after act=snat.

Check yourself

Predict · scenario 1

A policy has nat enable and no IP pool. Which address do LAN users appear as on the Internet?

Predict · scenario 2

200 users must share 2 public addresses. Which pool type?

Predict · scenario 3

In the session list, what does act=snat 10.0.1.10:51870->192.0.2.50:443(203.0.113.17:51870) show?

FAQ

When do I need an IP pool instead of the interface address?
When the interface address isn't the one you want traffic to come from: a partner whitelists a specific public address, mail must leave from the address in the domain's SPF record, or there are so many users that one address runs short of ports.
Does the FortiGate answer ARP for pool addresses?
Yes by default (arp-reply enable), so pool addresses in the WAN interface's own subnet work without extra routing. If the ISP routes a separate block to the FortiGate, ARP isn't needed for it.