Home

FortiGate DMZ Configuration Guide: Securing Public-Facing Services

.

In today's interconnected digital landscape, organizations increasingly need to expose services like websites, email servers, and remote access gateways to the internet. However, placing these services directly on your internal network creates significant security vulnerabilities. A properly configured Demilitarized Zone (DMZ) on your FortiGate firewall provides the essential balance between accessibility and security, creating an isolated network segment that acts as a buffer between your trusted internal network and the untrusted public internet.

The fundamental purpose of a DMZ is to contain potential security breaches. When a server in the DMZ becomes compromised—which security professionals emphasize is a matter of "when, not if"—the threat actor is isolated from laterally moving into the internal LAN network. This containment strategy prevents a single compromised public-facing server from jeopardizing the entire organizational network, which could contain sensitive data, financial systems, and proprietary information.

This comprehensive guide synthesizes expert knowledge from network security professionals and technical documentation to provide a complete roadmap for planning, implementing, and maintaining a secure DMZ using FortiGate firewall appliances.

Understanding FortiGate DMZ Fundamentals

What Exactly Is a DMZ Network?

In the context of FortiGate firewalls, a DMZ is an isolated network segment specifically designed to host services that need to be accessible from the internet. Unlike the LAN, which primarily handles outbound traffic from internal users to the internet, the DMZ is configured to accept inbound connections from external sources while maintaining strict isolation from internal resources.

The physical and logical design of a FortiGate DMZ provides crucial security characteristics. As noted by 0nol, "The FortiGate's DMZ port achieves isolation from the LAN because it is not an 802.1Q capable layer 2 port." Even if its role is changed from DMZ to LAN, its layer 2 domain only extends to itself, creating what he describes as "its own isolated island." This fundamental architectural feature ensures that even if an attacker gains control of a DMZ server, they cannot directly access the LAN at the network layer.

When Should You Implement a DMZ?

You should deploy a DMZ whenever you need to make services available to the public internet. Common use cases include:

  • Web servers (HTTP/HTTPS on ports 80 and 443)
  • Email servers (SMTP, IMAP, POP3)
  • File transfer servers (FTP, SFTP)
  • Remote access gateways
  • DNS servers accessible to the public
  • Application servers with public APIs

The alternative—placing these services directly on your LAN and opening ports to the internet—creates unacceptable risk. As emphasized in technical guides, "When the Server exposed to the public internet ever gets compromised, your LAN side of the network will be affected, so do not ever expose your LAN side host to the public internet permanently."

Planning Your FortiGate DMZ Implementation

Network Design Considerations

Before configuring your DMZ, careful planning is essential. You need to decide on several key architectural elements:

IP Addressing Strategy: You have two primary options for DMZ addressing:

  1. Public IP addresses directly assigned to DMZ servers
  2. Private IP addresses with Static NAT (also called one-to-one NAT) through the firewall

The first option is simpler but requires sufficient public IP addresses from your ISP. The second option, using private addresses with Static NAT, is more common and provides flexibility. This will make our lives easier when we allow LAN users access to the DMZ as it has to use only the private IP address. At the same time, any host on the public internet will be able to talk to the DMZ server using the public IP address."

Physical vs. Logical Separation: For optimal security, dedicated physical switches for the DMZ network are recommended. However, budget constraints might necessitate using VLANs on existing switches to separate DMZ traffic from LAN traffic. The critical principle is maintaining strict isolation between network segments.

Security Principles for DMZ Design

Effective DMZ implementation follows several key security principles:

  1. Minimal Access: Only necessary services should be exposed, and only through specific ports
  2. Default Deny: All traffic is blocked by default, with explicit rules created only for required communications
  3. Isolation: The DMZ cannot initiate connections to the LAN (unless specifically required and explicitly permitted)
  4. Monitoring: Comprehensive logging of all DMZ traffic for security analysis
  5. Regular Updates: DMZ servers require more frequent updates and patches due to their exposure

Step-by-Step FortiGate DMZ Configuration

Phase 1: Configuring the DMZ Interface

The first configuration step involves setting up the physical or logical interface that will serve as the DMZ gateway:

  1. Navigate to Network → Interfaces in your FortiGate management interface
  2. Select an unused port (commonly port3) and edit its configuration
  3. Set the following parameters:
    • Alias: "DMZ" (for easy identification)
    • Role: "DMZ"
    • Addressing Mode: "Manual"
    • IP/Netmask: Choose your DMZ subnet (e.g., 10.100.0.1/255.255.255.0)
  4. For administrative access, you may enable ping on the interface
  5. Connect the port to your DMZ switch or VLAN

Once configured and connected, the interface should show as online (typically indicated by a green status indicator).

Phase 2: Creating Virtual IPs for NAT (If Using Private Addressing)

If you're using private IP addresses in your DMZ with NAT to public IPs, you'll need to configure Virtual IPs:

  1. Navigate to Policy & Objects → Virtual IPs → Create New
  2. Configure the Virtual IP with:
    • Name: Descriptive name (e.g., "HTTPS Web Server 1")
    • Interface: Your WAN interface
    • Type: "Static NAT"
    • External IP: Your public IP address
    • Map to IPv4 Address: The private IP of your DMZ server
  3. Repeat for each server requiring public access

As noted in configuration guides, "When you add your firewall outside IP, you need to ensure that none of the other services are pointed to the outside IP" to avoid conflicts.

Phase 3: Configuring Firewall Policies

Firewall policies control what traffic is permitted to, from, and through your DMZ. You'll typically need several policies:

Policy 1: DMZ to Internet (Outbound Access for Updates)

  • Incoming Interface: DMZ
  • Source: DMZ servers requiring internet access
  • Destination: All
  • Service: Required services (HTTPS for updates, DNS, NTP)
  • Action: ACCEPT
  • NAT: Enabled (using outgoing interface address)

This policy allows DMZ servers to reach the internet for essential functions like security updates and time synchronization. Interestingly, experts note that "FortiNet likely predefines a security trust going from 'trustworthy' to 'untrustworthy' in the order of: LAN, DMZ, WAN," which explains why explicit source definitions aren't always needed for outbound DMZ policies.

Policy 2: Internet to DMZ (Inbound Public Access)

  • Incoming Interface: WAN
  • Source: All (or restricted IP ranges for sensitive services)
  • Destination: Virtual IP object for your server
  • Service: Specific service (e.g., HTTPS, SMTP)
  • Action: ACCEPT
  • NAT: Disabled (handled by Virtual IP)

For sensitive services like RDP, experts strongly recommend against opening access to "all" sources. Instead, create an address object containing trusted IP addresses and use it as the source in your policy. As emphasized in technical guides, "This is for lab testing and do not open RDP services to the untrusted public network with the source 'all'. To access the RDP, it is recommended to use VPN instead."

Policy 3: LAN to DMZ (Internal Access to DMZ Services)

  • Incoming Interface: LAN
  • Source: LAN networks or specific hosts
  • Destination: DMZ servers (by private IP)
  • Service: Required services
  • Action: ACCEPT
  • NAT: Disabled

Internal users typically access DMZ servers using their private IP addresses rather than going through the public IP/NAT. This approach reduces complexity and avoids what experts describe as "double NATing," which adds unnecessary complexity without security benefits.

Advanced DMZ Configuration Considerations

Service-Specific Security Measures

Different services require tailored security approaches:

For Web Servers (HTTPS):

  • Restrict to ports 80 and 443 only
  • Consider implementing a Web Application Firewall (WAF) policy
  • Enable logging of all traffic for security monitoring

For Email Servers:

  • Configure strict rate limiting to prevent abuse
  • Implement anti-spam and anti-malware scanning
  • Consider requiring authentication for outbound SMTP

For File Transfer Services:

  • Prefer SFTP over FTP for encryption
  • Implement strong authentication mechanisms
  • Consider time-based access restrictions

Monitoring and Maintenance

Once your DMZ is operational, ongoing maintenance is crucial:

  1. Regular Review: Periodically audit firewall policies to remove unnecessary rules
  2. Log Analysis: Regularly review traffic logs for suspicious patterns
  3. Patch Management: Ensure DMZ servers receive timely security updates
  4. Backup: Maintain regular backups of both server data and firewall configurations
  5. Testing: Periodically test your DMZ isolation by attempting (legitimate) lateral movement tests

Common Configuration Challenges and Solutions

Limited Public IP Addresses

Many organizations face limitations in available public IP addresses. The Virtual IP with port forwarding configuration allows multiple services to share a single public IP. However, as experts note, this requires careful management: "You need to ensure that none of the other services are pointed to the outside IP" when using the firewall's external interface IP for DMZ services.

Inter-DMZ Communication Requirements

Occasionally, servers within the DMZ need to communicate with each other. This requires explicit firewall policies with:

  • Source and Destination both within the DMZ
  • Services limited to only required protocols
  • NAT disabled (since both endpoints are within the same routing domain)

Performance Considerations

DMZ configurations can impact firewall performance, particularly when handling high volumes of traffic or performing deep inspection. Consider:

  • Security Profile Balance: Applying appropriate security profiles without overwhelming CPU
  • Hardware Offloading: Utilizing FortiGate hardware acceleration features where available
  • Traffic Shaping: Implementing QoS policies for critical DMZ services

Conclusion: The Strategic Value of Proper DMZ Implementation

A well-configured DMZ is not merely a technical requirement but a strategic security investment. By properly isolating public-facing services, organizations significantly reduce their attack surface and limit potential damage from security incidents. The FortiGate firewall provides robust, flexible tools for implementing DMZ architectures that balance accessibility with security.

As network security expert 0nol summarizes, "The above configuration is pretty basic but I hope I have illustrated an important concept: a DMZ port is not the same thing as a firewalled LAN port because when a server on the DMZ becomes compromised, the threat actor is isolated from laterally moving and infiltrating into the LAN (i.e. internal network). On the other hand, when a server on the LAN gets compromised, the entire network becomes jeopardized."

Remember that DMZ configuration is not a "set and forget" operation. Regular reviews, updates, and testing are essential to maintain security as your network evolves and new threats emerge. By following the principles and procedures outlined in this guide, you can implement a FortiGate DMZ that provides both the accessibility your services require and the security your organization deserves.


Frequently Asked Questions (FAQ)

Do I need a dedicated physical port for my DMZ on FortiGate?

While FortiGate appliances often have ports specifically labeled "DMZ," you can configure any port for this purpose. The critical factor is logical isolation rather than physical labeling. You can also implement a DMZ using VLANs on shared physical connections, though dedicated ports provide additional separation.

How do I handle DMZ servers that need to initiate outbound connections?

Create an explicit firewall policy with:

  • Incoming Interface: DMZ
  • Source: The specific DMZ servers requiring outbound access
  • Destination: All (or specific external resources)
  • Service: Required protocols (HTTPS for updates, DNS, NTP)
  • Action: ACCEPT
  • NAT: Enabled (using the outgoing interface IP)

Can LAN users access DMZ servers directly without going through public IPs?

Yes, you can create a policy allowing LAN to DMZ communication using private IP addresses. This is generally recommended over having internal users traverse the public IP/NAT path, as it reduces complexity and potential points of failure.

What's the difference between Static NAT and Port Forwarding in FortiGate DMZ config?

Static NAT (one-to-one NAT) maps an entire public IP to a private IP, allowing all ports (unless restricted by firewall policies). Port Forwarding maps specific ports from a public IP to a private IP. For DMZ configurations with limited public IPs, port forwarding is more common as it allows multiple services to share a single public IP through different ports.

How do I troubleshoot connectivity issues to my DMZ servers?

Follow this systematic approach:

  1. Verify the DMZ server can ping its default gateway (the FortiGate DMZ interface)
  2. Check that Virtual IP configurations are correct
  3. Verify firewall policies are in the correct order and not being overridden
  4. Ensure services are running on the DMZ servers
  5. Check security profiles aren't blocking legitimate traffic
  6. Review firewall logs for denied sessions

Should I enable security profiles on DMZ traffic?

Yes, but selectively. Apply antivirus, intrusion prevention, and other security profiles to traffic between the internet and DMZ. However, you may use less restrictive profiles for LAN-to-DMZ traffic or internal DMZ communications, balancing security with performance requirements.