Network Ports and Firewall Architecture Matrix for Exchange Server SE, 2019 & Hybrid Deployments

Configuring firewall access control lists (ACLs) and network security groups (NSGs) for an on-premises Microsoft Exchange Server deployment has evolved dramatically. With the retirement of separate Client Access Server (CAS) roles in favor of the consolidated Mailbox role architecture in Exchange Server Subscription Edition (SE) and Exchange Server 2019, legacy port requirements have been simplified—while modern security controls like Extended Protection (EPA), MAPI over HTTP, and Inbound SMTP DANE introduce new networking imperatives.

In this updated enterprise reference, we provide the definitive network port matrix categorized by traffic zone, examine DAG and Active Directory communication paths, and share an automated PowerShell script to smoke-test all required firewall ports across your topology.


Architecture Overview: Consolidated Mailbox Server Traffic

In Exchange Server SE and 2019, the Mailbox server role handles all client connections, mail transport, database availability group replication, and directory lookups.

Network communication breaks down into four primary zones:

  1. Client to Mailbox Server (Perimeter / LAN): HTTPS (TCP 443) dominates client communications (Outlook, OWA, ActiveSync, EWS, and Autodiscover). Legacy MAPI RPC direct ports are eliminated in favor of MAPI-over-HTTP.
  2. Mail Flow & SMTP Routing (Internet / Edge / Cloud): SMTP (TCP 25) for server-to-server relay; secure client submission via Submission (TCP 587).
  3. Database Availability Group (DAG) Replication: Dedicated replication network utilizing TCP 64327 for log shipping and database seeding.
  4. Exchange to Active Directory (Intranet): Kerberos (TCP 88), LDAP (TCP 389/636), Global Catalog (TCP 3268/3269), and DNS (TCP/UDP 53).
Exchange Server SE & 2019 Firewall Traffic Zone Architecture Client & External Ingress • HTTPS Services (TCP 443) - MAPI/HTTP, OWA, ECP, EWS - Autodiscover v2, ActiveSync • SMTP Submission - TCP 587 (Client Submission) - TCP 25 (Inbound Mail Flow) - TCP 993/995 (IMAP/POP SSL) Exchange Mailbox & DAG • DAG Replication & Seeding - TCP 64327 (Log Shipping) • Mailbox Replication (MRS) - TCP 808 (Net.TCP MRS Proxy) • Hub Transport Inter-Server - TCP 2525 (Hub Relay) - TCP 135 & Dynamic RPC Active Directory (DC / GC) • Directory Services - TCP 389 / 636 (LDAP / LDAPS) - TCP 3268 / 3269 (Global Catalog) • Authentication & DNS - TCP/UDP 88 (Kerberos) - TCP/UDP 53 (DNS) - TCP 445 (SMB NetBIOS/GPO) Firewall Best Practice Rule: 1. Never place a firewall between DAG member servers performing replication unless RPC dynamic ports (49152-65535) and TCP 64327 are fully unrestricted. 2. In Hybrid Office 365 setups, only inbound TCP 25 and outbound TCP 25/443 require internet-facing firewall NAT rules.

The Complete Exchange Server SE & 2019 Port Matrix

1. Inbound Client Traffic (Firewall / Load Balancer to Exchange)

PortProtocolPurpose / Description
443TCPHTTPS: Primary channel for Outlook (MAPI/HTTP), OWA, ECP, EWS, ActiveSync, Autodiscover, and OAB.
25TCPSMTP: Inbound internet email delivery from external MTAs or Exchange Online Protection (EOP).
587TCPAuthenticated SMTP Submission: Client message submission via TLS (printers, scanners, line-of-business apps).
993TCPIMAP4 over SSL/TLS: Secure IMAP client access.
995TCPPOP3 over SSL/TLS: Secure POP3 client access.

2. Internal Server-to-Server & DAG Traffic

PortProtocolPurpose / Description
64327TCPDAG Replication & Log Shipping: Default port for the Exchange Replication service across DAG nodes.
808TCPMailbox Replication Service (MRS Proxy): Net.TCP service used for cross-forest and hybrid mailbox migrations.
2525TCPHub Transport Service: Internal inter-server mail delivery between Front End Transport and Mailbox Transport.
135TCPRPC Endpoint Mapper: Required for server administration, cluster service, and initial RPC handshakes.
49152–65535TCPRPC Dynamic High Ports: Allocated by RPC Endpoint Mapper for MAPI internal services and cluster heartbeats.

3. Exchange to Active Directory Domain Controllers

PortProtocolPurpose / Description
53TCP/UDPDNS: Domain name resolution for Active Directory and internal MX lookups.
88TCP/UDPKerberos: User and service ticket authentication.
389 / 636TCP/UDPLDAP / LDAPS: Directory search queries and secure directory authentication.
3268 / 3269TCPGlobal Catalog (GC / GCS): Forest-wide recipient queries and universal group resolution.
445TCPSMB: Policy propagation and Group Policy processing.
123UDPNTP: Windows Time synchronization (must be under 5 minutes variance for Kerberos).

Automated PowerShell Script: Verifying Required Ports

Run this automated PowerShell diagnostic script on your Exchange server or staging jumpbox to test end-to-end connectivity across all required ports:

POWERSHELL
# Script: Test-ExchangePortConnectivity.ps1
# Description: Verifies TCP port accessibility between Exchange, Domain Controllers, and Cloud Gateways

param (
    [string]$TargetDC = "dc01.lab365.in",
    [string]$DagPeer  = "ex02.lab365.in",
    [string]$CloudMTA = "lab365-in.mail.protection.outlook.com"
)

$Tests = @(
    @{ Name = "Active Directory LDAP"; Host = $TargetDC; Port = 389 },
    @{ Name = "Active Directory Kerberos"; Host = $TargetDC; Port = 88 },
    @{ Name = "Global Catalog"; Host = $TargetDC; Port = 3268 },
    @{ Name = "DAG Log Shipping"; Host = $DagPeer; Port = 64327 },
    @{ Name = "MRS Proxy Migration"; Host = $DagPeer; Port = 808 },
    @{ Name = "Exchange Online SMTP Relay"; Host = $CloudMTA; Port = 25 },
    @{ Name = "Microsoft 365 HTTPS Gateway"; Host = "outlook.office365.com"; Port = 443 }
)

Write-Host "`n=== TESTING EXCHANGE SERVER NETWORK PORT CONNECTIVITY ===" -ForegroundColor Cyan

$Results = foreach ($t in $Tests) {
    Write-Host "Probing $($t.Name) ($($t.Host):$($t.Port))..." -NoNewline
    $Check = Test-NetConnection -ComputerName $t.Host -Port $t.Port -WarningAction SilentlyContinue

    if ($Check.TcpTestSucceeded) {
        Write-Host " [PASS]" -ForegroundColor Green
    } else {
        Write-Host " [FAIL]" -ForegroundColor Red
    }

    [PSCustomObject]@{
        Service   = $t.Name
        Host      = $t.Host
        Port      = $t.Port
        Reachable = $Check.TcpTestSucceeded
    }
}

$Results | Format-Table -AutoSize

Summary Checklist for Network Engineers

  1. Eliminate Legacy RPC from External DMZ: Expose strictly TCP 443 to external reverse proxies/load balancers. Never publish RPC ports (135 or 49152-65535) to untrusted networks.
  2. Dedicated DAG NICs: Separate client HTTPS traffic from DAG replication traffic (TCP 64327) using isolated subnets and non-routable VLANs.
  3. Verify Hybrid SMTP: Allow bidirectional TCP 25 between Exchange on-premises and Microsoft 365 Exchange Online Protection (EOP) IP ranges.