A real-life situation
Harbourline Foods, a fictional company, has one FortiGate at its head office. Staff browse the Internet, and customers reach a web shop in the DMZ. The company now moves its database off the web server onto a new server, DB1. Where should DB1 go? On the staff LAN it would be one compromised laptop away from every customer record. In the DMZ it would share a segment with the Internet-facing web server. The right answer is a new segment for servers, with the FortiGate between it and everything else, and a short list of allowed connections. That is firewall placement and segmentation, and this lesson ends with that exact design.
The examples use the course lab:
- 1. North–south: PC1 (10.0.1.10) browses the Internet through port1.
- 2. East–west: PC1 reaches WEB1 (10.0.2.10) in the DMZ, through FGT1.
Why placement matters
A firewall decides only for traffic that passes through it. Two hosts in the same subnet talk to each other directly through the switch, so a firewall in another part of the network doesn't see that traffic. Placement therefore answers two questions: which boundaries need enforcement, and how traffic is forced through the firewall at each of them. In practice the answer is routing: the firewall is made the default gateway of each segment it protects, or sits in the only path between two parts of the network.
Learn more: Stateless, Stateful and Next-Generation Firewalls
North–south and east–west traffic
| North–south | East–west | |
|---|---|---|
| Between | Inside and outside (Internet, partners, cloud) | Internal segments: users, servers, OT, guests |
| Lab example | PC1 → Internet via port1 | PC1 → WEB1, or WEB1 → DB1 |
| Volume | Limited by the Internet links | Often much higher: file shares, backups, databases |
| Main risk | Attacks from outside, data leaving | Lateral movement after one host is compromised |
| Classic control | Edge firewall | Internal segmentation firewall, VLANs and policies |
Older designs protected only north–south traffic and trusted everything inside. Modern attacks rarely stop at the first host: ransomware spreads from one laptop to file servers and backups over east–west paths. Controlling east–west traffic is what limits how far one compromise can spread.
Where firewalls are placed
| Placement | What it protects | Typical concerns |
|---|---|---|
| Edge (perimeter) | The boundary to the Internet: outbound access, published servers, VPN termination | Source NAT, virtual IPs, VPNs, SD-WAN, threat inspection |
| Internal segmentation (ISFW) | Boundaries between internal segments, for example users and servers | High throughput, low latency, many internal policies, identity |
| Data centre | Server farms and application tiers (web, application, database) | Very high session counts, HA, tight server-to-server rules |
| Branch | A small site: local Internet access and the tunnel to head office | One device doing everything: routing, VPN, SD-WAN, Wi-Fi and switch control |
| Cloud | Workloads in a public cloud (a FortiGate VM) | Cloud routing tables steering traffic through the firewall |
These roles can be separate devices or one FortiGate doing several. In the course lab, FGT1 is both the edge firewall (port1 to the Internet) and an internal firewall (LAN to DMZ). That is normal in small and medium sites. Large networks usually separate the roles so each firewall can be sized and changed independently.
Deployment modes: NAT mode and transparent mode
Placement also decides how the FortiGate joins the network. FortiOS offers two operation modes, set per VDOM:
| NAT mode (route mode) | Transparent mode | |
|---|---|---|
| Behaves like | A router with a firewall built in | A bridge (Layer 2) with a firewall built in |
| Interface addresses | Each interface has its own IP subnet | Traffic interfaces have no IP; one management IP for the VDOM |
| Forwarding | Routing table | MAC address table, within a forwarding domain |
| Readdressing needed | Yes: hosts use the FortiGate as their gateway | No: it is inserted into an existing link |
| Policies and profiles | Yes | Yes |
| Typical use | Edge, branch, most ISFW designs (the default) | Adding inspection to an existing network without changing IP addressing |
In NAT mode, "NAT" names the mode, not a requirement: each policy decides whether source NAT is applied. An ISFW policy between two internal segments normally has NAT off, so servers see the real client addresses. Transparent mode keeps the existing addressing, but the FortiGate is no longer a Layer 3 hop, so features that depend on routing, such as SD-WAN and dynamic routing, don't apply. A third option sits in between: a virtual wire pair joins two ports of a NAT-mode FortiGate as a bump in the wire, without changing the whole VDOM's mode.
Checking and changing the mode
get system settings | grep opmodeShows the current mode of the VDOM you are in: nat or transparent. Read-only and safe to run.
FGT1 # get system settings | grep opmode opmode : nat
nat is the default on a new FortiGate.Switching a VDOM to transparent mode is done under config system settings, together with the management IP address and its default gateway (the FortiGate needs them to reach FortiGuard and to be managed, because the traffic interfaces no longer have addresses):
⚠ Changing the operation mode is disruptive
FortiOS refuses the change while the VDOM still has objects that depend on interface addresses or routing, such as firewall policies, static routes, virtual IPs, DHCP servers and VPNs: you must delete them first, so the change effectively starts from a near-empty configuration. Your management connection drops when the mode changes, because the interface addresses are removed. Do it only from the console or a separate management path, with a configuration backup, in a maintenance window, and check the exact procedure in the administration guide for your release.
config system settings
set opmode transparent
set manageip 10.0.1.99 255.255.255.0
set gateway 10.0.1.1
endmanageip is the address used to manage the FortiGate in transparent mode; gateway is the router it uses to reach other networks (here the existing LAN router). Field formats can differ slightly between releases; check the CLI reference.
NAT and transparent modes, per-VDOM operation modes and virtual wire pairs work the same way in FortiOS 7.4 and 7.6. Some features available in transparent mode vary by release; check the feature notes for your build before relying on one.
Zones and DMZ design
A DMZ (demilitarised zone) is a segment for servers that the Internet must reach, such as WEB1. It exists so that a compromised public server doesn't sit next to staff PCs. The rules that make a DMZ work:
- Internet → DMZ: only the published services (for WEB1, HTTPS through a virtual IP).
- DMZ → LAN: nothing by default. A web server rarely needs to open connections to staff PCs.
- LAN → DMZ: only what staff and administrators need, for example HTTPS and SSH from an admin group.
- DMZ → Internet: only what the servers need, such as operating system updates, not general browsing.
On a FortiGate, policies are written between interfaces. A zone groups several interfaces so one policy covers them all, which keeps the policy table short when segments get the same treatment. Traffic between interfaces of the same zone is controlled by the zone's intrazone setting:
config system zone
edit "DMZ-ZONE"
set interface "port3"
set intrazone deny
next
endintrazone deny (the default) blocks traffic between the zone's own interfaces unless a policy allows it; allow passes it without a policy. Add more DMZ interfaces later, for example a second DMZ VLAN, and every DMZ-ZONE policy covers them.
An interface that is already referenced directly by a policy or route can't join a zone until those references are removed. Plan zones before writing policies, and keep intrazone deny where the members should be isolated from each other, such as two DMZ servers belonging to different customers.
Learn more: Interfaces, VLANs and Zones
Segmentation by VLAN and policy
A VLAN separates a switch into separate Layer 2 networks. On its own, that only splits broadcast domains; the security comes from what connects the VLANs. If FGT1 is the default gateway of every VLAN, all traffic between them crosses FGT1, and each pair of segments needs an explicit policy.
Micro-segmentation takes the idea further: policies per workload or per application rather than per subnet, so even two servers in the same segment can only talk on the ports they need. It is usually enforced close to the workload, by host firewalls, the hypervisor or the cloud platform, because a firewall between subnets doesn't see traffic inside one subnet. A FortiGate supports the idea at the subnet level with narrow address objects and per-application policies; true per-workload enforcement is beyond this course.
Zero trust principles
Zero trust (described in NIST SP 800-207) replaces "trusted inside, untrusted outside" with three ideas:
- Don't trust by location. Being on the office LAN or on the VPN grants nothing by itself.
- Verify identity and device. Each access decision checks who the user is and whether the device is known and healthy.
- Least privilege. Grant access to specific applications, not whole networks, and only for as long as it is needed.
How a FortiGate relates to these ideas, at a concept level:
| Principle | FortiGate feature |
|---|---|
| Verify identity | Identity-based policies: a policy matches users and groups (local, LDAP, RADIUS, FSSO) as well as addresses |
| Verify the device | Device information and endpoint posture from FortiClient EMS used as policy criteria |
| Least privilege | Narrow destinations and services in each policy; segments with no policy between them |
| Per-application access | ZTNA access proxy: the FortiGate publishes individual applications and checks user and device on every session |
A ZTNA access proxy differs from a traditional VPN: instead of placing a remote device onto the internal network, it gives the user access to one application at a time, after checking identity and device posture. Configuring ZTNA and identity-based policies is beyond Fortinet Fundamentals; this lesson only places them in the design.
Learn more: Users and Firewall Authentication
A worked design: adding a server segment
Back to Harbourline Foods. The new database server DB1 (10.0.30.20) goes into a SERVERS segment, VLAN 30, carried on port2 alongside the staff LAN. FGT1 becomes its gateway, so every connection to DB1 crosses a policy.
- 1. Allowed: WEB1 queries DB1 on TCP 5432 only.
- 2. Denied: PC1 has no policy to DB1; the implicit deny drops it.
config system interface
edit "servers"
set vdom root
set interface port2
set vlanid 30
set ip 10.0.30.1 255.255.255.0
set role lan
set allowaccess ping
next
endThe switch port facing FGT1 must carry VLAN 30 tagged. Only ping is allowed to the FortiGate from this segment: servers don't need its management interface.
Then the policy table, written from the services each system actually needs:
| # | From → To | Source | Destination | Service | Action | NAT |
|---|---|---|---|---|---|---|
| 1 | port3 → servers | WEB1 | DB1 | TCP 5432 (database) | Accept, log | Off |
| 2 | port2 → servers | DBA group (identity) | DB1 | SSH, TCP 5432 | Accept, log | Off |
| 3 | servers → port1 | DB1 | Update servers (FQDN objects) | HTTPS | Accept, log | On |
| 4 | port2 → port3 | LAN | WEB1 | HTTPS | Accept | Off |
| – | Anything else between segments | any | any | any | Implicit deny | – |
Policy 1 is the ISFW rule that matters most: if WEB1 is compromised, the attacker can reach DB1 only on the database port, not with SSH or file sharing. Policy 2 uses identity rather than a whole subnet, the zero-trust habit applied to an internal policy. NAT is off on internal policies so DB1's logs show real client addresses. Here is policy 1 in the CLI, with address objects named WEB1 and DB1:
config firewall service custom
edit "DB-5432"
set tcp-portrange 5432
next
end
config firewall policy
edit 0
set name "DMZ-web-to-DB1"
set srcintf "port3"
set dstintf "servers"
set srcaddr "WEB1"
set dstaddr "DB1"
set action accept
set schedule "always"
set service "DB-5432"
set logtraffic all
set nat disable
next
endedit 0 creates the policy with the next free ID. logtraffic all logs every session, which suits a low-volume, high-value policy like this one. Add an IPS profile once the policy works.
Firewall Policy list (interface pair view)
| ID | Name | From | To | Source | Destination | Service | Action | NAT |
|---|---|---|---|---|---|---|---|---|
| 5 | DMZ-web-to-DB1 | port3 | servers | WEB1 | DB1 | DB-5432 | ACCEPT | Disabled |
| 6 | DBA-to-DB1 | port2 | servers | LAN, DBA | DB1 | SSH, DB-5432 | ACCEPT | Disabled |
| 7 | DB1-updates | servers | port1 | DB1 | Update-FQDNs | HTTPS | ACCEPT | Enabled |
| 0 | Implicit Deny | any | any | all | all | ALL | DENY |
- The ISFW policy: one source, one destination, one service. Policy IDs on a real unit depend on what already exists.
Verifying the design
Test both what should work and what shouldn't. From WEB1, connect to DB1 on TCP 5432 (it should work) and on TCP 22 (it should fail). Then confirm what FGT1 decided:
diagnose sys session filter clear
diagnose sys session filter dst 10.0.30.20
diagnose sys session listShows the sessions to DB1. Clear old filters first; a forgotten filter is a common reason for seeing nothing.
FGT1 # diagnose sys session list session info: proto=6 proto_state=01 duration=12 expire=3593 timeout=3600 ... ... hook=pre dir=org act=noop 10.0.2.10:40112->10.0.30.20:5432(0.0.0.0:0) ... misc=0 policy_id=5 ... total session 1
act=noop (no address translation, as intended for an internal policy) and policy_id naming the ISFW policy. There should be no session for the failed SSH attempt; the traffic log for the implicit deny shows it, if logging of denied traffic is enabled.The GUI's Policy Lookup (Policy & Objects › Firewall Policy) answers "which policy would match this connection?" without generating traffic, which is useful before a change goes live.
What can go wrong
Servers in the new VLAN can't reach anything
DB1 has an address in 10.0.30.0/24 but can't even ping its gateway, 10.0.30.1.
Show the fix
Check the Layer 2 path first: the switch port to FGT1 must carry VLAN 30 tagged, and DB1's access port must be in VLAN 30. Then check that ping is in the VLAN interface's allowaccess. A missing VLAN on the trunk is the most common cause.
Two hosts "in different segments" talk without a policy
The firewall logs show nothing, yet a guest device reaches a server.
Show the fix
The traffic isn't crossing the firewall: both hosts are in the same VLAN, or another device (a Layer 3 switch, a second router) routes between the segments. Make the FortiGate the only gateway between them, and remove the other routed path. A firewall can only enforce what passes through it.
An interface can't be added to a zone
The GUI or CLI rejects adding port3 to DMZ-ZONE.
Show the fix
port3 is still referenced directly by a policy, route or other object. Find the references (the GUI shows a reference count on the interface), replace them or delete them, then add the interface to the zone and use the zone in its place.
The application breaks after segmentation
The web shop shows database errors after the server move, although policy 1 exists.
Show the fix
The application needs more than one port (for example a second service or DNS), or connects from a different source address than expected. Find the denied connections in the forward traffic log for WEB1 and add only the specific missing service. Avoid widening the policy to "all" to make the error go away.
Design guidance for enterprises
- Separate roles as the network grows. An edge FortiGate for Internet, VPN and SD-WAN; an ISFW pair in the core or data centre sized for internal volumes.
- Size an ISFW for east–west volume. Internal traffic such as backups can far exceed Internet traffic; size by the inspection you will turn on.
- Plan segments by trust and function. Users, servers, management, guests, OT and IoT devices, and the DMZ each get their own segment.
- Deploy in HA. A firewall in the only path between segments is a single point of failure.
- Introduce zero trust in steps. Identity-based policies for sensitive servers first, then device posture, then per-application access for remote users.
Learn more: High Availability (FGCP)
Best practices
- Make the firewall the default gateway of every segment it must protect, and remove other routed paths.
- Start from deny between segments; add policies per service, with named address objects.
- Turn source NAT off on internal policies so logs keep real addresses.
- Put Internet-facing servers in a DMZ and give the DMZ no access to the LAN by default.
- Use zones only where segments really share the same policy; otherwise keep interfaces separate.
- Log internal policies, especially to servers; east–west logs are where lateral movement shows up.
🛠 Practical exercise: design segments for a small company
On paper, design the network for a fictional clinic with staff PCs, a patient records server, a guest Wi-Fi, network printers and a public appointment website, behind one FortiGate. Give each segment a VLAN ID and a subnet from 10.0.0.0/16, decide which segment the website belongs in, and write the policy table (from, to, source, destination, service, NAT) using least privilege. Then list every connection that the implicit deny will block, and check that none of them is needed. If you have a FortiGate VM, build two of the segments as VLAN interfaces and test one allowed and one denied connection with the session list.
Key takeaways
- A firewall controls only traffic that crosses it; routing decides what crosses it.
- North–south is in and out of the organisation; east–west is between internal segments.
- NAT mode routes between subnets; transparent mode bridges and keeps existing addressing.
- A DMZ isolates public servers; zones group interfaces that share policies.
- Zero trust means access per request, by verified identity and device, with least privilege.
Check yourself
A company must add firewall inspection between its core router and the Internet router, without changing any IP addresses. Which FortiGate mode fits?
A laptop on the staff LAN is infected and starts scanning the file server in the server segment. Which traffic direction is this, and which control limits it?
A zone contains port3 and port5 with intrazone deny, and there is no policy from the zone to itself. A server on port3 tries to reach a server on port5. What happens?
After WEB1 moved its database to DB1 in a new server VLAN, the session list shows WEB1 → DB1 sessions with act=snat to 10.0.30.1. What is wrong with the design?
Which statement best describes zero trust?
Next: The Fortinet product family and the Security Fabric. To build these policies on a FortiGate, see How firewall policies work.