FortiOS Ch. 3

Firewall Policies and NAT

The policy table is the decision engine: route lookup, interface pair, address/service/schedule/user match, first match wins, then NAT and inspection behavior.

Mental model

A FortiGate policy decision is not just a source and destination address match. The firewall considers ingress interface, route-derived egress interface, source, destination, service, schedule, users, policy order, and inspection mode. NAT then changes addressing either at the source side, destination side, or through central NAT rules.

Packet decision order

  1. Packet enters an ingress interface.
  2. FortiGate checks routing to determine the likely egress interface.
  3. Policy lookup narrows candidates by interface pair or zone.
  4. Policy table is evaluated top-down; first match wins.
  5. Security profiles, NAT, shaping, logging, and session handling are applied.
  6. If no policy matches, policy ID 0 silently drops unless logging is enabled.

Policy types

Policy typeControlsExam relevance
IPv4/IPv6 firewall policyTransit traffic passing through FortiGate.Core behavior for almost every lab.
Local-in policyTraffic destined to FortiGate itself.Protects management, BGP, OSPF, VPN negotiation, FGFM, and admin access.
DoS policyRate-based protection at interface edge.Threat mitigation and edge hardening.
Proxy policyExplicit proxy traffic.Useful when testing explicit proxy and PAC behavior.
Traffic shaping policyBandwidth and priority behavior.SD-WAN and application experience scenarios.

Security mode distinction

Profile-based mode attaches security profiles to a policy: AV, IPS, web filter, app control, SSL inspection, and so on. NGFW policy-based mode pushes application and URL category matching into the policy itself. The tradeoff matters because engineers sometimes expect profile behavior in a mode where the controls live somewhere else.

NAT patterns

NAT typeWhat changesTypical use
Interface SNATSource becomes outgoing interface IP.Simple internet access for internal clients.
IP pool SNATSource becomes an address from a pool.Predictable public source IPs, partner access, CGNAT-style planning.
VIP / DNATDestination becomes an internal server.Publishing an internal service externally.
Central NATNAT rules are separate from firewall policies.Large or complex deployments where translation policy needs its own table.

Object dependencies

CLI anchors

diagnose firewall policy-lookup

Simulate which policy should match a packet.

show firewall policy <id>

Inspect exact policy configuration.

diagnose debug flow filter addr <ip>

Constrain flow debug before tracing.

diagnose sys session list

Confirm policy ID and SNAT/DNAT behavior.

diagnose firewall ippool list

Check IP pool allocation and exhaustion.

diagnose firewall vip list

Validate VIP objects.

show firewall central-snat-map

Review central SNAT rules.

config firewall policy; move <id> before <id>

Correct policy order.

NSE 8 WATCHPOINTS

Lab exam checkpoint

Goal: prove first-match policy behavior and NAT behavior. Create overlapping policies, intentionally place one in the wrong order, validate with policy lookup, fix the order, publish a test service with a VIP, then prove DNAT/SNAT in the session table and logs.

Spare-only recommendedUse test services only