How do you let the right traffic into your private network while keeping everyone else out, and how do you make sure your devices can talk to the internet without revealing their secret, internal addresses? These are the two core problems that FortiGate firewall policies and Network Address Translation (NAT) solve, and they are the foundation of every secure network you will work with. For the NSE7 exam, understanding how these two features work together is essential, because they are tested in almost every practical scenario.
Jump to a section
A simple way to picture FortiGate Firewall Policies and NAT
The airport terminal is the central checkpoint for all incoming and outgoing traffic. Every passenger, whether arriving or departing, must pass through this controlled space. In exactly the same way, every data packet entering or leaving a private network must first pass through the FortiGate firewall. Inside the terminal, the security screening lanes represent firewall policies. Each lane is configured with specific rules: only passengers with valid boarding passes for international flights can use the international lane, and only those with pre-approved visa stamps can proceed. If a passenger matches the rules, they are allowed through to the gate. If they do not match, they are turned away. This is exactly how a firewall policy decides to allow or deny traffic based on source, destination, service, and time.
Once the passenger clears security, their checked luggage enters a separate handling system. This is Network Address Translation (NAT). The passenger's real, private home address is replaced with a temporary, public airport code. When the passenger lands at a foreign airport, the system knows exactly which public address was used, and it translates it back to the original private address for the return journey. This allows many private addresses to share a single public identity, which is exactly how NAT enables hundreds of devices on a home or office network to access the internet using just one public IP address. Without this translation, the private addresses (like 192.168.1.10) are invisible to the outside world and cannot communicate.
Firewall policies and NAT are the two core mechanisms that control all traffic moving through a FortiGate device. Think of the firewall policy as the rulebook that decides what is allowed to pass, and NAT as the disguise that hides the true identity of the traffic.
A firewall policy is a set of rules applied to traffic as it moves from one interface to another. A FortiGate has multiple physical or virtual ports, each connected to a different part of the network. For example, port1 might connect to your internal office network (the LAN), and port2 might connect to the internet (the WAN). A firewall policy defines which traffic is allowed to move from port1 to port2, and which traffic is allowed to move the other way. Each policy checks five key attributes: the source address (where the traffic came from), the destination address (where it is going), the service (what kind of traffic it is, like web browsing or email), the schedule (when this rule is active), and the action (allow or deny). If a packet matches all the conditions of a policy, the FortiGate takes the action specified. If no policy matches, the packet is dropped.
Network Address Translation (NAT) is the process of changing one IP address in a packet to another. The most common type is Source NAT (SNAT), also called Dynamic NAT or IP masquerading. This is used when devices on a private network (with addresses like 10.0.0.5 or 192.168.1.10) need to access the internet. Private IP addresses are not routable on the public internet. So the FortiGate replaces the private source address in every outgoing packet with its own public IP address. When the response comes back, the FortiGate remembers which private address made the request (using a NAT table) and translates the destination address back to the private address. This is how a whole office of 100 computers, each with a private IP, can all share a single public IP address.
There is also Destination NAT (DNAT), often called port forwarding. This is used when you want traffic from the internet to reach a specific server inside your private network. For example, you might have a web server at private IP 192.168.1.50, and you want the public to access it by going to your public IP on port 80. A DNAT policy tells the FortiGate to change the destination address from the public IP to the private IP (192.168.1.50) and forward the traffic through the firewall.
A central FortiGate feature is the Central NAT table. Instead of configuring NAT directly inside each firewall policy, you can create a separate NAT rule that is automatically applied when traffic matches certain conditions. This keeps your firewall policies simpler and allows for more granular NAT control, especially when you need to handle different types of traffic differently. For example, one policy might allow web traffic, and a separate Central NAT rule might specify that only web traffic from the marketing department should use a specific public IP address.
Another important concept is NAT64. This allows devices on an IPv6-only network to communicate with an IPv4-only server. The FortiGate translates the IPv6 packet to an IPv4 packet and vice versa. This is becoming more common as organisations start to adopt IPv6 but still need to reach legacy IPv4 services.
When configuring both policies and NAT on a FortiGate, there is a specific processing order. For inbound traffic (from the internet to your network), the FortiGate first checks Destination NAT rules. If there is a match, it changes the destination IP before it then checks the firewall policy. For outbound traffic (from your network to the internet), the firewall policy is checked first, and then Source NAT is applied after the policy decision is made. This order is critical to understand because it affects how you write your rules.
You can also perform NAT without a firewall policy by using Virtual IPs (VIPs). A Virtual IP is a public IP address that is mapped to a private IP address. When you create a VIP, the FortiGate automatically creates the necessary DNAT rules behind the scenes. You can then reference that VIP in your firewall policy as the destination, making the configuration cleaner and more manageable.
Define the Traffic Scope
Identify the source interface (where traffic enters) and the destination interface (where traffic leaves). For a typical web browsing scenario, the source interface is the internal LAN (e.g., port1) and the destination interface is the external WAN (e.g., port2). This determines which firewall policy the traffic will hit.
Create the Firewall Policy
In the FortiGate GUI, navigate to Policy & Objects > Firewall Policy and click 'Create New'. Set the incoming and outgoing interfaces from step 1. Define the source address (e.g., your internal subnet), the destination address (e.g., 'all' for internet), and the service (e.g., 'web-access' for HTTP/HTTPS). Set the action to 'ACCEPT'. This policy acts as the gatekeeper, allowing permitted traffic to proceed to the NAT stage.
Configure Source NAT on the Policy
Within the same firewall policy, go to the 'NAT' tab. Check 'Enable NAT' and choose 'Use Outgoing Interface Address' if you only have one public IP. Alternatively, if you have a pool of public IPs, select a 'Dynamic IP Pool' that you have defined in advance. This step replaces the private source IP with a public IP, enabling the packet to be routable on the internet.
Configure Destination NAT (if needed for inbound traffic)
To allow internet users to reach an internal server, go to Policy & Objects > Virtual IPs and create a new VIP. Map a public IP and port (e.g., 203.0.113.5:443) to your server's private IP and port (e.g., 10.0.0.10:443). Then create a new firewall policy with the incoming interface as the WAN, the destination set to this VIP, the service set to HTTPS, and action set to ACCEPT. The VIP automatically creates the DNAT rule that runs before the policy check.
Verify and Test Connectivity
Use the FortiGate's 'Firewall Policy Monitor' to see live traffic and confirm the policy is being hit. Then use the 'NAT Session' tool (under Monitor > NAT Sessions or via CLI with 'diagnose sys session list') to see active NAT translations. For outbound traffic, you should see internal IPs mapped to the public IP. For inbound traffic, you should see the VIP mapping in action. If a user cannot connect, check the policy order and the VIP configuration carefully.
Sophie is the security administrator for a medium-sized company called GreenLeaf Ltd with 200 employees. The company has a single FortiGate firewall at the edge of its network. The internal network uses private IP addresses in the 10.10.0.0/16 range. The company has one public IP address assigned by its internet service provider (ISP). Sophie needs to ensure employees can browse the web and access public cloud services, but she must also let customers reach the company's public-facing web server, which sits on a private IP address inside the office.
Step-by-step, here is what Sophie does:
First, she creates a firewall policy to allow outbound internet access. She configures the policy to allow traffic from the internal network (source address 10.10.0.0/16) to the internet (destination address 'all'). She sets the service to 'web-access' (which covers HTTP and HTTPS). She enables Source NAT (Dynamic IP Pool) on this policy, which tells the FortiGate to replace the private source address with the company's single public IP. She does not create any additional NAT rule because the simple NAT option in the policy is sufficient. Now, every time an employee opens a browser, the FortiGate translates their private IP to the public IP before the packet leaves for the internet. When the response comes back, the FortiGate looks up the NAT table and delivers the packet back to the correct employee's computer.
Second, Sophie needs to allow customers to reach the company's web server at 10.10.10.10 on port 443 (HTTPS). She creates a Destination NAT rule using a Virtual IP. She configures the VIP with the public IP (the company's single public IP) and port 443, and maps it to the private IP 10.10.10.10 on port 443. Then she creates a firewall policy that allows traffic from the internet (source address 'all') to the VIP (the destination is now the VIP object). The action is 'allow'. Now, when a customer types the company's domain name in a browser, DNS resolves it to the public IP. The FortiGate sees the incoming packet, matches the VIP, changes the destination IP to 10.10.10.10, and then checks the firewall policy. Because the policy allows it, the packet is forwarded to the web server.
Sophie also needs to manage traffic for a second public IP she just bought. She wants traffic bound for that IP to reach a separate internal server. She creates a second VIP for that IP and a second firewall policy. She uses Central NAT to avoid cluttering her policies. She creates a Central NAT rule that says: if traffic is from the internal network, and the destination is the internet, then use a pool of two public IP addresses (the original one and the new one) to balance the load. This ensures that outbound traffic from employees uses either of the two public IPs, providing better performance and redundancy.
Finally, Sophie audits the NAT logs weekly. She looks for any traffic that is being translated unexpectedly, or any traffic that is being dropped because no NAT rule exists. She uses the FortiGate's built-in 'NAT session' diagnostic tool to view active translations and see which internal IP is currently using which translated public IP. This is how she troubleshoots connectivity problems. If a customer cannot reach the web server, she checks whether the VIP is matching, whether the firewall policy is allowing the traffic, and whether any other policy is blocking it.
The NSE7 exam tests your understanding of how firewall policies and NAT interact in a FortiGate environment. You will be asked to identify the correct sequence of operations, read configuration snippets, and spot intentional mistakes in sample policies. The exam loves to test edge cases and the exact order of processing.
Here are the specific concepts you need to master:
The order of NAT processing: Destination NAT (DNAT) is applied BEFORE the firewall policy check for inbound traffic. Source NAT (SNAT) is applied AFTER the firewall policy check for outbound traffic. This is the single most tested detail. A common exam trap is presenting a scenario where DNAT is applied after the firewall policy, which is wrong.
Central NAT versus policy NAT: Central NAT rules are processed separately from firewall policies. If Central NAT is enabled, any NAT configured directly inside a firewall policy is ignored. The exam loves to test that you know when Central NAT takes precedence. A typical question: 'An administrator has enabled Central NAT and also configured SNAT on a firewall policy. Which NAT rule will be applied?' The answer is the Central NAT rule, because it overrides policy-level NAT.
Virtual IP (VIP) and Destination NAT: The exam will ask you to identify the correct configuration for port forwarding. They might give you a scenario where you need to forward port 443 from a public IP to a private server, and they will show you four configuration snippets. One snippet will have the source and destination reversed. Another might have the wrong IP version. You need to pick the one where the VIP maps the public IP and port to the correct private IP and port.
NAT64 and NAT46 translation: The exam includes questions about translating between IPv4 and IPv6. You need to know that NAT64 allows IPv6 clients to reach IPv4 servers, and that it requires a specific prefix (64:ff9b::/96) to be used as the destination in the policy. They may ask what happens if you do not configure the correct prefix.
Policy routing and policy-based NAT: The exam tests whether you know that policy-based NAT (NAT configured directly on the policy) is the default, and that Central NAT is an advanced mode. They will ask you to identify the scenario where you MUST use Central NAT (for example, when you need to apply different NAT rules to different services on the same source-destination pair).
Multiple public IPs and NAT pools: They test your ability to configure a pool of public IPs for SNAT. A typical trap question: 'An administrator has a pool of 5 public IPs for outbound traffic. Why are some internal users still using the primary IP?' The answer is that the pool policy is configured incorrectly (for example, the pool might only be assigned to one specific source subnet, not all users).
The 'no-NAT' exemption: There are times when you do not want NAT applied (for example, traffic to a private cloud over a VPN). The exam tests that you can create a policy with NAT disabled, or that you can create a Central NAT exemption rule that matches specific traffic and sets NAT to 'disable'.
Firewall policy order: FortiGate processes firewall policies from top to bottom. The first matching policy is applied. The exam will present a long list of policies and ask you which one a specific packet will match. They often include a very general policy at the top that would inadvertently match, blocking traffic that should be allowed. The correct answer is to reorder the policies so that more specific rules are placed above general ones.
NAT session exhaustion: They may ask about the consequences of running out of NAT sessions (when the NAT table is full). The answer is that new connections from internal hosts will be dropped until existing sessions expire. They might ask how to increase the NAT session limit (by tuning the system resource allocation).
Firewall policies and NAT are separate but interacting features; NAT is applied in a specific order relative to the policy check (DNAT before the policy for inbound, SNAT after the policy for outbound).
Central NAT overrides any NAT configuration placed directly inside a firewall policy once it is enabled.
A Virtual IP (VIP) is the FortiGate's method for configuring Destination NAT (port forwarding) in a reusable and manageable way.
NAT64 uses the well-known prefix 64:ff9b::/96 to allow IPv6-only networks to reach IPv4 internet services.
The first matching firewall policy in the policy order is applied, so always place more specific policies above general ones to avoid accidental blocking.
SNAT (Source NAT) with a dynamic IP pool allows multiple internal hosts to share a pool of public IP addresses, improving scalability.
NAT is not a security mechanism — a firewall policy must explicitly block unwanted inbound traffic to provide security.
Private-to-private VPN traffic should rarely have NAT applied, as translation breaks direct routing between the networks.
These come up on the exam all the time. Here's how to tell them apart.
Policy NAT
NAT is configured directly within each firewall policy using the 'Enable NAT' option.
Each policy can have its own independent NAT rules, making it simple for small setups.
If Central NAT is enabled, policy-level NAT is completely ignored; they are mutually exclusive.
Central NAT
All NAT rules are defined in a single, separate table outside of firewall policies.
Central NAT allows for more granular control, such as applying different NAT rules to the same source-destination pair based on service.
When Central NAT is enabled, the 'Enable NAT' checkbox in firewall policies becomes inactive.
Source NAT (SNAT)
Changes the source IP address of outgoing packets (internal to public).
Allows many internal hosts to share one or more public IP addresses.
Applied after the firewall policy allows the traffic.
Destination NAT (DNAT)
Changes the destination IP address of incoming packets (public to internal).
Used to redirect external traffic to internal servers (port forwarding).
Applied before the firewall policy check for inbound traffic.
Static NAT (SNAT one-to-one)
Maps a specific internal IP to a specific public IP (e.g., 10.0.0.5 always becomes 203.0.113.5).
The mapping is permanent and does not change.
Useful for servers that need a consistent public identity for inbound and outbound traffic.
Dynamic NAT (Pool-based SNAT)
Maps multiple internal IPs to a pool of public IPs (e.g., 10.0.0.0/24 uses 203.0.113.5-203.0.113.10).
The public IP assigned to a host can change with each new connection or session.
Used for general internet access for a large number of users.
NAT64
Translates IPv6 packets to IPv4 packets (IPv6 client to IPv4 internet).
Uses the well-known prefix 64:ff9b::/96 to represent the IPv4 destination.
Requires a DNS64 to rewrite AAAA (IPv6) records to include the translation prefix.
NAT46
Translates IPv4 packets to IPv6 packets (IPv4 client to IPv6 internet).
Primarily used when an IPv4-only network needs to reach an IPv6-only server.
Less commonly deployed than NAT64, as most internet content is still IPv4-accessible.
Mistake
NAT is a security feature that protects against hackers.
Correct
NAT is not a security feature; it is an address translation mechanism that conserves public IP addresses. Security relies on firewall policies that block unwanted traffic. NAT does provide a small amount of obfuscation (by hiding internal IPs), but it is not a substitute for a firewall.
Beginners often equate 'hiding the IP' with 'security'. They think that because the internal IP is not visible, attackers cannot reach the device. In reality, NAT alone does not block traffic; a firewall policy is required to drop unsolicited inbound packets.
Mistake
If Central NAT is enabled, I can still configure NAT directly in the firewall policy and it will be applied in addition.
Correct
When Central NAT is enabled, any NAT configured directly in the firewall policy is ignored. Central NAT rules override policy-level NAT entirely. You must either use Central NAT for all translation or use policy-based NAT for all translation, but not a mix.
The FortiGate documentation is not always clear about the precedence, and beginners assume 'more granular' means both are used. In practice, they find that their policy-level NAT stops working after enabling Central NAT, leading to confusion.
Mistake
You need to configure NAT rules for traffic going to a private VPN network.
Correct
Traffic between private networks (like a branch office and headquarters over a VPN) typically does not require NAT because both sides use private IP addresses. NAT is only needed when traffic crosses from a private address space to a public one (like the internet).
Many beginners assume that all traffic leaving a firewall needs NAT. They do not distinguish between public and private destination networks. This leads them to accidentally translate traffic over a VPN, breaking connectivity because the remote network cannot route the translated address back.
Mistake
Destination NAT (DNAT) and Virtual IP (VIP) are completely different features.
Correct
A Virtual IP (VIP) is essentially a user-friendly way to configure Destination NAT. When you create a VIP, you are creating a DNAT mapping behind the scenes. They achieve the same result, but VIPs are easier to manage and can be reused in multiple firewall policies.
The exam and documentation treat them as separate concepts, but beginners see both in the interface and assume they are independent. They do not realise that a VIP creates a DNAT rule, so they try to create both a VIP and a manual DNAT rule, causing conflicts.
Reveal each answer, then mark whether you got it right. Score 60%+ to unlock the next chapter.
Policy NAT is the traditional method where you configure NAT directly inside each firewall policy using the 'Enable NAT' checkbox. Central NAT is a separate mode that centralises all NAT rules in a single table. When Central NAT is enabled, any NAT options configured in individual firewall policies are ignored.
You must create a Virtual IP (VIP) that maps your public IP address and port (e.g., 203.0.113.5:443) to the private IP of your web server (e.g., 10.0.0.10:443). Then create a firewall policy that allows traffic from the internet (WAN interface) to that VIP, with the service set to HTTPS.
This likely means you have enabled Central NAT but have not created a Central NAT rule to translate outbound traffic. With Central NAT enabled, the 'Enable NAT' checkbox in the firewall policy is ignored. You must create a Central NAT rule that specifies the source (internal subnet), destination (internet), and action (translate to the outgoing interface address).
The NAT session limit is the maximum number of simultaneous connection translations the FortiGate can track. If the limit is reached, new connections will be dropped until old sessions expire. You can increase the limit by adjusting the system resource allocation under System > Feature Visibility or via CLI with the 'config system resource-limits' command.
Yes, you can. The FortiGate distinguishes between outbound traffic (SNAT) and inbound traffic (DNAT) based on the session direction and the destination port. However, you must ensure that the Destination NAT rule (VIP) and the Source NAT rule do not conflict on the same port, or you may need to use a different public IP for the server to avoid confusion.
They are effectively the same thing. Port forwarding is a common term for Destination NAT (DNAT) used to redirect inbound traffic on a specific port to a specific internal host. On a FortiGate, you configure port forwarding by creating a Virtual IP (VIP) that maps a public port to a private port and IP.
You've finished FortiGate Firewall Policies and NAT. Continue through the NSE7 study guide to build a complete picture of the exam.
Done with this chapter?