ITNuvoAkademiya
Academy homePackagesPlaylistsToolsSubnet calculatorSearchGlossary
CiscoCCNA · CCNA: networking fundamentals1. Introduction2. Network Fundamentals3. Network Access4. IP Connectivity5. IP Services6. IPv67. Security Fundamentals8. AutomationCCNP: Enterprise networks · coming soon
LinuxLinux: system administrator üçün · Linux for system administrators1. Getting to know Linux2. Working with text3. Users and permissions4. Processes and packages5. Inside the system6. Monitoring and logs7. NetworkingRed Hat Enterprise Linux · Red Hat Enterprise Linux: from beginner to advanced1. Getting started2. Packages3. Users and permissions4. SELinux5. Services6. Storage7. Networking8. Building services9. Boot and recovery10. DevOps11. Security and monitoring
FortinetFortiGate Administrator · FortiGate Administrator: from first login to ZTNA1. Getting to know FortiGate2. Routing, policy and NAT3. Security profiles4. Users and logs5. Resilience, SD-WAN and automation6. VDOM7. VPN and ZTNA8. Proxy9. DMZ
MonitoringZabbix · Zabbix: from installation to alerts1. Introduction2. Installation and the database3. Basics: groups, templates, users4. Connecting devices5. Alerts, Grafana and the API
VirtualizationProxmox VE · coming soonVMware ESXi · coming soon
My account / Sign in
AZENRU
← itnuvo.com

What a DMZ is and how to build one

Lesson 9.19 minIntermediateNovember 24, 2026
Open

This lesson is open to everyone. The other lessons open with a package: sign in or sign up, then choose a package.

Key points

  • A DMZ is a separate network between the internet and the internal network: servers that must be visible from the internet stand there.
  • The main idea: even if a DMZ server is compromised, there must be no way from it into the LAN. That is why DMZ → LAN is closed by default.
  • On a FortiGate a DMZ is an ordinary interface (a separate port or a VLAN) with its own subnet. Everything between the zones is decided by firewall policies.
  • role dmz affects only how the GUI looks; it gives no security. Policies give security.
  • Do not enable management access (HTTPS, SSH) on the DMZ port: a compromised server must not reach the FortiGate's login page.

The problem

A company has a web site, a mail server or a customer portal, and they must open from the internet. The easiest way would be to put the server into the office network (LAN) and forward a port. It works, but it is dangerous.

An internet-facing server is under constant attack. If one day a vulnerability is found and the server is taken over, the attacker is already inside the LAN: the file server, the accounting database and the staff computers are in the same network with it, with no firewall in between.

The solution: a middle zone

A DMZ (demilitarized zone) is a third, separate network. Servers that must be visible from the internet are moved there.

text
        Internet
            │ port1 (WAN)
       ┌────┴────┐
       │ FGT-HQ  ├── port3 (DMZ) ── web server, mail
       └────┬────┘     10.10.30.0/24
            │ port2 (LAN)
      staff, database, file server
        10.10.10.0/24

Now there are three zones and the FortiGate stands between every pair. If a DMZ server is compromised, the attacker stays inside the DMZ: to get into the LAN they must pass the firewall again, and there they have no permission.

Trust levels and the traffic table

ZoneTrustWho is there
WAN (internet)NoneEveryone
DMZLowInternet-facing servers
LANHighStaff, internal servers, data

The general rule: a higher-trust zone may go to a lower one, not the other way round.

From → ToDefaultWhy
WAN → DMZOnly the published ports (for example 443)The site must open, nothing else
WAN → LANClosedThere must be no direct way from the internet into the LAN
LAN → DMZThe services that are neededStaff open the site, an admin manages the server
DMZ → LANClosed (one or two narrow exceptions at most)This is the whole point of a DMZ
DMZ → WANLimited (updates, DNS)A compromised server must not go out freely
LAN → WANOpen (with profiles)Ordinary internet use

In the next three lessons we turn this table into policies line by line.

What goes into the DMZ and what does not

In the DMZIn the LAN
Web server, customer portalDatabase
Mail-receiving server (relay)File server
Public DNS serverActive Directory
Reverse proxyAccounting and HR systems

A typical layout: the web server is in the DMZ and the database it uses is in the LAN. The web server is allowed to reach only one port (the database port) of one address in the LAN. We write this in lesson 49.

The DMZ port on a FortiGate

To a FortiGate a DMZ is nothing special: it is an ordinary interface that simply has its own subnet. Some models have a port labelled "DMZ", but any free port can become the DMZ.

FGT-HQ
FGT-HQ # config system interface
FGT-HQ (interface) # edit "port3"
FGT-HQ (port3) # set ip 10.10.30.1 255.255.255.0
FGT-HQ (port3) # set alias "DMZ"
FGT-HQ (port3) # set role dmz
FGT-HQ (port3) # set allowaccess ping
FGT-HQ (port3) # next
FGT-HQ (interface) # end
LineMeaning
set ipThis address will be the default gateway of the DMZ servers
set aliasThe name shown next to the port in the GUI
set role dmzTells the GUI what the port is for and hides some unneeded options. It does not affect traffic
set allowaccess pingFrom the DMZ to the FortiGate itself only ping. No HTTPS or SSH

The last line matters. On the LAN port we enabled https ssh so that an admin could manage the device (lesson 5). Do not do that in the DMZ: a compromised server must not see the FortiGate's login page.

If there is no free port, the DMZ can also be created as a VLAN (lesson 5): for example VLAN 30 on port2. The logic is the same: a separate interface, a separate subnet.

GUI: Network > Interfaces > port3, Role: DMZ.

Address objects

Let us create the network and the server as objects for use in policies:

FGT-HQ
FGT-HQ # config firewall address
FGT-HQ (address) # edit "DMZ-NET"
FGT-HQ (DMZ-NET) # set subnet 10.10.30.0 255.255.255.0
FGT-HQ (DMZ-NET) # next
FGT-HQ (address) # edit "SRV-WEB"
FGT-HQ (SRV-WEB) # set subnet 10.10.30.10 255.255.255.255
FGT-HQ (SRV-WEB) # next
FGT-HQ (address) # end

On the server side

Give a DMZ server a static address (no DHCP): IP 10.10.30.10/24, default gateway 10.10.30.1. Policies and the VIP will be tied to this address, so it must not change.

What works now?

Nothing. The port is ready, but there is no policy involving port3, so the implicit deny (lesson 8) drops everything. The DMZ is still fully isolated, and that is the right starting point: we will open only what is needed, one thing at a time.

FGT-HQ
FGT-HQ # show system interface port3
FGT-HQ # execute ping 10.10.30.10

A ping from the FortiGate itself to the server works (they are in the same network), while nothing passes yet from the LAN or from the internet.

Common mistakes

MistakeResult
A "temporary" DMZ → LAN all policyThe DMZ loses its meaning; if the server is compromised, the LAN is open
allowaccess https ssh on the DMZ portAttacks on the FortiGate's management from a compromised server
DMZ and LAN on the same switch without VLANsServers bypass the FortiGate and reach the LAN
Handing out DMZ addresses by DHCPThe server's address changes; the policy and VIP stop working
DMZ → internet open to allA compromised server freely receives commands and sends data out

🧪 Hands-on lab · Device: FortiGate-VM

The DMZ interface and addresses

Prepare port3 as the DMZ: IP 10.10.30.1/24, alias DMZ, role dmz, management access ping only. Then create two address objects: DMZ-NET (10.10.30.0/24) and SRV-WEB (10.10.30.10/32). Finally check with show system interface port3.

Checked:

  • port3: 10.10.30.1/24
  • role dmz
  • allowaccess: ping
  • DMZ-NET
  • SRV-WEB

▶ Start the lab

Check yourself

5 questions · answers are shown instantly · 3 correct answers complete the lesson

1What is the main purpose of a DMZ?

Even if a server is compromised, the attacker must pass the firewall again to reach the LAN.

2Which direction should stay closed by default?

There must be no way from a low-trust zone to a high-trust one; at most narrow exceptions are made.

3How does set role dmz affect traffic?

Security comes from firewall policies, not from the role.

4Why should you not enable allowaccess https ssh on the DMZ port?

Management access should come only from a trusted network (the LAN, a management network).

5The port is ready but no policy has been written for port3. Does traffic pass from the LAN to the DMZ server?

Without a policy the FortiGate forwards nothing between zones.
Was this lesson useful?

Comments

Sign in to comment.