Active Directory · Firewall Ports

Active Directory Firewall Ports — The Complete Reference

Every port a domain, its member servers, and the enterprise stack bolted on top of it actually need — what each one carries, what breaks without it, and how to prove it is open before the change window closes.

Quick idea: Active Directory is not one protocol on one port. It is roughly a dozen services that each need their own path, plus a large block of dynamically assigned RPC ports that nobody enjoys asking a security team to open. Almost every “AD works on the flat network but breaks across the firewall” ticket comes down to that last part.
Fixed ports

Kerberos, LDAP, DNS, SMB and friends. Well known, easy to justify, rarely the problem.

Dynamic RPC

49152-65535 on modern Windows. This is the range that gets refused, and the reason replication fails.

Direction

Most AD traffic is client-initiated, but DC-to-DC replication is initiated by both ends. Rules must be bidirectional.

The Minimum Viable AD Port Set

If you need a list to hand the network team this afternoon, this is it. These ports cover domain controller to domain controller replication and member server logon in a single-forest environment running currently supported versions of Windows Server. The sections that follow either explain one of these rows in depth or add an application on top.

Port Protocol Direction Service / Purpose Notes
53TCP + UDPBoth waysDNSTCP is not optional. Zone transfers and large responses use it.
88TCP + UDPTo DCKerberos authenticationLarge tickets fall back to TCP.
123UDPTo DCW32Time / NTPKerberos fails outright once clocks drift far enough.
135TCPBoth waysRPC Endpoint MapperOnly tells the caller where to go next. Useless on its own.
389TCP + UDPTo DCLDAP and CLDAPUDP 389 is the DC locator ping, not a typo.
445TCPBoth waysSMBSYSVOL, Group Policy, DFSR, Netlogon share.
464TCP + UDPTo DCKerberos password change (kpasswd)Missed constantly. Password changes fail, logon does not.
636TCPTo DCLDAP over SSL/TLSSkip only if you are certain nothing uses LDAPS.
3268TCPTo DCGlobal Catalog LDAPUniversal group membership, cross-domain lookups.
3269TCPTo DCGlobal Catalog over SSL/TLSSame caveat as 636.
9389TCPTo DCActive Directory Web ServicesThe entire ActiveDirectory PowerShell module rides on this.
49152-65535TCPBoth waysDynamic RPC (LSA, SAM, Netlogon, DRS, DFSR)The one that gets refused. Pinning it is covered below.

Think of the RPC endpoint mapper on port 135 as the switchboard in an old hotel. You ring the switchboard, ask for the replication service, and the operator tells you it is on room extension 51204. If the firewall lets you reach the switchboard but not the extension, you get a perfectly successful conversation that ends in silence — which is exactly what Error 1722: The RPC server is unavailable looks like from the other side.

Important: Opening 135 without opening the dynamic range is the single most common half-configured AD firewall rule. It looks correct on the rule sheet and fails every time.

Domain Controller to Domain Controller

Two domain controllers replicating with each other are peers, not client and server. Either one can initiate, so the rules have to work in both directions. On top of the minimum set above, DC-to-DC traffic adds the replication engines themselves.

Port Protocol Direction Service / Purpose Notes
135TCPBoth waysRPC Endpoint MapperEntry point for DRS, FRS and DFSR alike.
49152-65535TCPBoth waysRPC for LSA, SAM and NetlogonCarries the actual directory replication (DRSUAPI).
49152-65535TCPBoth waysDFSR RPCSYSVOL replication on Server 2012 and later.
5722TCPBoth waysDFSR RPC (legacy)Server 2008 and 2008 R2 only. Not used on 2012 or later.
49152-65535TCPBoth waysFRS RPCOnly if SYSVOL still replicates with FRS. It should not.
445TCPBoth waysSMBSYSVOL content, Netlogon share, DFSR file transfer.
88TCP + UDPBoth waysKerberosDCs authenticate to each other before replicating.
464TCP + UDPBoth waysKerberos password changeIncludes machine account password changes.
389 / 636TCP + UDPBoth waysLDAP and LDAPSTopology and configuration reads between partners.
3268 / 3269TCPBoth waysGlobal CatalogCross-domain and forest-wide lookups.
53TCP + UDPBoth waysDNSPartners are found by GUID-based CNAME in _msdcs.
123UDPBoth waysW32TimeFollows the domain time hierarchy from the PDC emulator.
9389TCPBoth waysActive Directory Web ServicesNeeded for remote AD PowerShell against that DC.
ICMPBoth waysLDAP keep-alive and redirector checksNot a port. The Microsoft LDAP client pings a server it is waiting on.

Two rows deserve a note. DFSR on port 5722 is version-specific: Microsoft assigned it for Windows Server 2008 and 2008 R2 domain controllers and dropped it from Server 2012 onwards, where DFSR simply uses a dynamically allocated high port like everything else. If your firewall rules still carry 5722 and your DCs are 2012 or later, the rule is dead weight — harmless, but it tells you the ruleset has not been reviewed in a decade.

ICMP is the one people delete on principle. The Microsoft LDAP client uses ICMP echo to check that a server with a pending LDAP request is still on the network, and the Windows redirector uses it when locating a server through DFS. Block it entirely and you do not lose authentication, but you inherit slow, hard-to-diagnose timeouts. Allowing ICMP to domain controller addresses specifically is the usual compromise.

Key point: Microsoft’s own trust documentation flags SMB 445 as required for trust creation rather than for the ongoing operation of a trust. That footnote applies to the trust scenario only. Inside a domain, 445 carries SYSVOL and Group Policy, and closing it breaks far more than trusts.

Member Servers and Workstations to a DC

This is the direction most segmentation projects get wrong, because logon appears to work from a test machine long before Group Policy, password changes, or a management tool start failing. All of the following is client-initiated toward the domain controller.

Port Protocol Direction Service / Purpose Notes
53TCP + UDPClient → DCDNSSRV record lookup is step one of finding a DC at all.
389UDPClient → DCCLDAP (DC locator ping)How a client picks a DC in its own site. Silently critical.
389 / 636TCPClient → DCLDAP / LDAPSDirectory reads by the client and by applications on it.
88TCP + UDPClient → DCKerberosTGT and service ticket requests.
464TCP + UDPClient → DCKerberos password changeInteractive password changes and machine account rotation.
445TCPClient → DCSMBSYSVOL, so Group Policy files and login scripts.
135TCPClient → DCRPC Endpoint MapperNetlogon secure channel, RSoP, remote policy refresh.
49152-65535TCPClient → DCDynamic RPCNetlogon, SAM and LSA calls the endpoint mapper hands off.
3268 / 3269TCPClient → DCGlobal CatalogUniversal group membership at logon; UPN resolution.
123UDPClient → DCW32TimeDomain members sync from the domain hierarchy by default.
9389TCPAdmin → DCActive Directory Web ServicesOnly needed where admins run AD PowerShell cmdlets.

Group Policy is worth calling out separately because it fails so distinctively. Microsoft’s requirement is that a client reach a domain controller over Kerberos, LDAP, SMB and RPC. Miss any one of those and policy does not apply or refresh — which surfaces as a policy that worked yesterday quietly going stale rather than as an error anyone reports. Remote gpupdate initiated from a management console adds RPC and WMI inbound to the target machine on 135 and the dynamic range, which is a different rule in a different direction from everything above.

For a walk through what actually happens during a logon, and why so much of it is Kerberos, the authentication and Kerberos post covers the ticket exchange these ports carry.

Trusts, Cross-Forest, and RODCs

A trust does not introduce new protocols so much as it extends the existing ones across a boundary you were probably filtering deliberately. The port set for a trust between two Windows Server 2003-or-later domains is effectively the DC-to-DC list: DNS, Kerberos, LDAP, the Global Catalog, SMB, the endpoint mapper, and the dynamic RPC range, in both directions between the domain controllers of each side.

Three specifics catch people out. W32Time over UDP 123 across an external trust is only required if you have deliberately pointed the time service at a server on the other side; it is not needed for the trust itself. UDP 138 reappears when name resolution falls back to NetBIOS, which happens with legacy or Samba-based domain controllers on the far end. And Global Catalog access matters more across a forest trust than inside a domain, because universal group enumeration for a foreign principal has to happen somewhere.

Read-only domain controllers are the interesting case for a branch or DMZ. An RODC uses the same inbound port set as a writable DC for its own clients, but its outbound relationship is one-way: it pulls from a writable partner and never pushes. That gives you a rule you can actually justify to a security team — inbound AD ports from the branch subnet to the RODC, and outbound replication from the RODC to a named set of hub DCs, with no inbound replication path from the branch into the core at all. Password changes are the exception. An RODC holds a read-only copy of the database, so a change has to be made on a writable domain controller and replicated back — which means the outbound path from the branch has to be genuinely functional rather than decorative, and an account whose password is not cached on the RODC needs to reach a writable DC to authenticate at all.

When a trust looks configured but authentication across it fails, the diagnosis is usually one of these paths rather than the trust object itself — the trust relationship failed covers that specific symptom.

Pinning the Dynamic RPC Range

Sooner or later a firewall team will refuse 49152-65535, and they are not being difficult: that is sixteen thousand ports. The supported answer is to pin Active Directory’s RPC services to specific static ports, so the endpoint mapper hands out an address the firewall already allows.

This is done with two registry values, and the mistake everyone makes is setting only the first one.

# Static port for the directory service itself (NTDS): replication, DRS, SAM, LSA.
# HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Parameters
#   Value: TCP/IP Port      Type: REG_DWORD      Data: an available port
# Requires a reboot to take effect.

# Static port for the Netlogon RPC interface.
# HKLM\SYSTEM\CurrentControlSet\Services\Netlogon\Parameters
#   Value: DCTcpipPort      Type: REG_DWORD      Data: a DIFFERENT available port
# Requires only a restart of the Netlogon service.
Key rule: Set both values, to two different ports, and open both on the firewall. Clients do not use only Netlogon — they also call SamRPC, LSARPC and the replication (DRS) interface, which live behind the NTDS port. Configuring DCTcpipPort alone produces an environment where logon works and half of everything else does not.

If you set both values to the same port, Netlogon logs error event 5809 to say the port is in use, and you should pick another. Confusingly, the same event is also logged harmlessly when you restart Netlogon on a correctly configured DC, because of how the RPC runtime hands over its server ports. On a healthy DC with two distinct ports configured, that one is noise.

DFSR needs pinning separately, because SYSVOL replication does not travel over the NTDS port:

# Pin DFS Replication to a single static RPC port on a named member.
# Omit /Member and dfsrdiag targets the local computer.
dfsrdiag StaticRPC /port:nnnnn /Member:dc02.corp.example.com

On current Windows Server builds the Set-DfsrServiceConfiguration cmdlet does the same job from PowerShell, and is the better choice if you are scripting the change across a set of DCs. Check the cmdlet’s own help for the parameter name on your build rather than assuming it matches the dfsrdiag switch.

You can also move the ephemeral range itself, which changes what the operating system allocates for outbound connections generally rather than pinning a specific service:

# Show the current dynamic port range for TCP and UDP.
netsh int ipv4 show dynamicport tcp
netsh int ipv4 show dynamicport udp

# Narrow the range to 1000 ports starting at 10000 (so 10000-10999).
# Minimum range is 255 ports; minimum start port is 1025.
netsh int ipv4 set dynamicport tcp start=10000 num=1000
netsh int ipv4 set dynamicport udp start=10000 num=1000

Where this bites: pinning is a supported configuration, not a free one. Microsoft has published fixes for long logon times and for replication failing with RPC errors after a static NTDS port was set, so a domain controller that is behind on patching is a poor candidate. Restricting the range too aggressively also risks port exhaustion on a busy DC — you have taken away sixteen thousand ephemeral sources and given back a few hundred. Pin the services, and leave the general dynamic range alone unless you have a measured reason.

Production note: Pin ports on one domain controller first and leave it a full replication cycle before touching the rest. A misconfigured static port does not fail loudly; it fails as a replication partner that quietly stops converging.

Certificate Services (AD CS)

AD CS has two completely separate traffic patterns, and conflating them is why PKI firewall rules are so often wrong. Enrollment is RPC/DCOM. Revocation checking is plain HTTP. They travel different paths, and the second one is the one that silently destroys authentication.

Port Protocol Direction Service / Purpose Notes
135TCPClient → CARPC Endpoint MapperEntry point for the native enrollment protocol.
49152-65535TCPClient → CADynamic RPC / DCOMThe actual certificate request and issuance.
445 (and 139)TCPClient → CASMBUsed by CertSvc; 139 only where NetBIOS is still in play.
443TCPClient → web serverCA Web Enrollment (/certsrv)HTTPS is mandatory; the pages refuse to work over HTTP.
443TCPClient → CES / CEPEnrollment Web ServicesWS-Trust over HTTPS, for non-domain or off-network clients.
389 / 636TCPCEP → DCLDAP / LDAPSThe policy web service reads templates from AD.
80TCPEverything → CDP/AIACRL, delta CRL and AIA retrievalPlain HTTP by design. Do not “helpfully” force it to HTTPS.
80TCPEverything → responderOCSP (Online Responder)Same reasoning as CRL distribution.
80 / 443TCPDevice → NDESNetwork Device Enrollment ServiceSCEP enrollment for network devices and MDM.

Revocation checking is the number one silent failure in a segmented PKI, and it is worth understanding why it is silent. When a client validates a certificate, it fetches the CRL from the URL baked into the certificate’s CDP extension. If that URL is unreachable, the client does not fail fast — it waits for a timeout, then treats revocation status as unknown. Depending on what is validating, that surfaces as a login that takes ninety seconds, an LDAPS bind that intermittently fails, a smart card that works in the office and not in the DMZ, or a service that starts fine and then stalls on its first outbound TLS handshake. Nothing in that list says “CRL”.

Production note: The CRL distribution point must be reachable from everywhere a certificate is validated, which is a much larger set of networks than everywhere a certificate is issued. A DMZ host that never enrols still needs to fetch the CRL. Check the CDP URL inside an issued certificate and test it from the most isolated segment you have, not from the CA.

There is a related failure that looks like a firewall problem and is not: an expired domain controller certificate breaks LDAPS while leaving plain LDAP working, which is covered in LDAPS fails after the DC certificate expired. The broader PKI design is in the Active Directory Certificate Services post.

Configuration Manager (SCCM / MECM)

Configuration Manager has the largest port surface of anything covered here, because it is really a dozen role-to-role relationships rather than one product. The saving grace is that most client-facing traffic is HTTP or HTTPS on ports you can change.

Port Protocol Direction Service / Purpose Notes
80 / 443TCPClient → MP, DP, SMP, FSPHTTP / HTTPS site system trafficConfigurable during setup or in site properties.
10123TCPClient → MPClient notificationDefault channel before falling back to HTTP/HTTPS.
8005TCPClient → DPExpress updates (delta content)Set via client settings; alternate port available.
8530 / 8531TCPClient → SUP (WSUS)Software updatesWSUS default since Server 2012. Was 80/443 before.
3268TCPClient → GC DCGlobal Catalog LDAPSkipped by workgroup and internet-only clients.
389 / 636 / 3268TCP + UDPSite server, MP → DCLDAP, LDAPS, Global CatalogDiscovery and publishing to the AD system container.
135 + dynamicTCPSite server ↔ site systemsRPC endpoint mapper and RPCBidirectional by default unless you force server-initiated.
445TCPSite server ↔ site systemsSMBAlso site-to-site: SMB 445 is the only port between site servers.
1433TCPRoles → SQL ServerSQL over TCPAlternate port supported; named instances must be static.
4022TCPSQL → SQLSQL Server Service BrokerIntersite database replication. Alternate port available.
1434UDPSQL → SQLSQL Server BrowserRequired with a named instance on a non-default port.
67, 68UDPClient ↔ PXE DPDHCP for PXE bootPXE on a DP, with or without WDS.
69UDPClient → PXE DPTFTPListens on 69, responds from a dynamic high port.
4011UDPClient → PXE DPBINLThe PXE negotiation layer proper.
547UDPClient → PXE DPDHCPv6Only for the PXE responder without WDS.
63000-64000UDPDP → clientMulticast deploymentOnly on a DP configured for multicast.
2701TCPConsole → clientRemote ControlRemote Assistance uses 3389 instead.
9 / 25536UDPClient → clientWake On LAN / wake-up proxyWake-up proxy also needs ICMP between peers.
8003 / 8004TCP / UDPClient ↔ clientWindows PE peer cache8004 UDP broadcast, 8003 TCP download.
Practical note: Almost every HTTP-based ConfigMgr port in that table can be changed, and in many estates has been. Read the site properties and the client settings before you write the firewall request — a rule sheet built from the documented defaults will not match a site that was set up with custom ports years ago.

Two PXE traps are worth naming. TFTP listens on UDP 69 but replies from a dynamically allocated high port, so a stateless rule that only permits UDP 69 lets the request out and drops every reply. And during the actual PXE boot, the port the network card selects is chosen by the card’s firmware, not by Windows — it is bounded only by RFC 1350, meaning anything from 0 to 65535. PXE across a firewalled boundary is genuinely awkward, and a local DP in the segment is usually the honest answer.

Operations Manager (SCOM)

SCOM is refreshingly compact by comparison: agents talk to a management server on one port, and almost everything else is either SQL or a console.

Port Protocol Direction Service / Purpose Notes
5723TCPAgent → MS / GWAgent to management server channelThe one port that matters. Configurable at setup.
5723TCPGateway → MSGateway to management serverGateways exist precisely to collapse DMZ rules to this.
5724TCPConsole, web, reporting → MSOperations console and SDKAlso needed MS to MS during install; can close afterwards.
1433 / 1434TCP / UDPMS → SQLOperations and data warehouse databases1434 UDP is SQL Browser. Verify the real port in SQL config.
135, 137, 445, 49152-65535TCP + UDPMS → SQLSetup-time SQL state validationOnly needed during management server installation.
53, 88, 389TCP + UDPMS / GW → DCDNS, Kerberos, LDAPPort 88 is unnecessary if you use certificate authentication only.
135, 137, 138, 139, 445, 49152-65535TCP + UDPMS / GW → targetAgent push installationPush install is why “just 5723” is not enough on day one.
161, 162UDPMS ↔ network deviceSNMPMust be bidirectional, and ICMP with it.
1270TCPMS / GW → UNIX-Linux agentCross-platform monitoringNote the direction: inbound to the monitored host.
22TCPMS / GW → UNIX-Linux hostSSH for agent install and upgradeNeeded only during agent lifecycle operations.
51909TCPACS forwarder → collectorAudit Collection ServicesConfigurable via registry.

The pattern to take away is that the steady-state agent requirement is a single outbound port, but the installation requirement is the full file-and-print and dynamic RPC set, because the management server pushes the agent using the same mechanisms as any other remote install. That is why so many DMZ SCOM deployments are described as “not working” when the agent was simply never installed. Deploy the agent manually with the MSI, and 5723 outbound is genuinely all you need afterwards.

One documented constraint to plan around: Operations Manager does not support LDAP over SSL, so do not build a rule set that assumes SCOM will reach a domain controller on 636.

CrowdStrike Falcon

Falcon is the section where the correct answer is much shorter than people expect, and getting it wrong costs you unnecessary exposure rather than a broken service.

Port Protocol Direction Service / Purpose Notes
443TCPSensor → CrowdStrike cloudSensor telemetry and policyTLS 1.2 or later. Outbound only.
InboundNothingNo inbound listener is required on a sensor host.
Key difference: The Falcon sensor requires no inbound ports at all. If a firewall request lands on your desk asking for inbound rules “for CrowdStrike”, it is a misunderstanding of the architecture. The sensor initiates every connection outbound over 443 and holds it open.

What does need care is the destination set. Falcon sensors connect to region-specific cloud endpoints — the ts01-*.cloudsink.net hosts and associated *.crowdstrike.com API endpoints — and the exact hostnames differ between US-1, US-2, EU-1 and GovCloud tenancies. Do not copy an allowlist from a blog post, including this one: the authoritative list lives in the CrowdStrike support portal for your tenant, and it changes. Take the hostnames from there.

On proxies: the sensor supports proxying, but if the proxy performs TLS inspection you need to exclude the CrowdStrike destinations from interception. The sensor validates the certificate chain it expects, and an inspecting proxy substitutes its own — which produces a sensor that installs cleanly, reports as installed locally, and never appears in the console. That specific failure mode is worth checking before anyone starts examining firewall logs.

Internal Web Applications and AD

An internal web application that uses Windows Authentication is not just an HTTP service. It is a Kerberos participant, and it needs a path to the directory that has nothing to do with the port users connect on.

Port Protocol Direction Service / Purpose Notes
80 / 443TCPUser → web serverHTTP / HTTPSThe only port most people think about.
88TCP + UDPUser → DCKerberos service ticketThe client gets the ticket, not the server. Easy to miss.
88, 389, 135 + dynamicTCP + UDPWeb server → DCDelegation and identity lookupsNeeded for constrained delegation and group checks.
389 / 636 / 3268 / 3269TCPApp → DCLDAP bind and directory queriesLDAP-bound apps; use the GC ports for forest-wide reads.
443TCPClient → WAP → AD FSAD FS authenticationRequired inbound on both firewall layers.
49443TCPClient → WAPAD FS client certificate authenticationOnly client-to-WAP, not WAP-to-federation-server.
App portTCPLoad balancer → web serverHealth probeFrequently forgotten in a new segment.

The row that catches people is Kerberos from the user to the domain controller. When a browser hits an intranet site configured for Windows Authentication, the client requests a service ticket for that site’s SPN from a DC and presents it to the web server. Put the users in a segment that cannot reach a DC on 88, and the site does not fail with an authentication error — it falls back to NTLM, or prompts for credentials repeatedly, which sends everyone hunting through IIS configuration for a problem that is on the network.

Constrained delegation adds a second hop with its own requirements. The web server itself must reach a domain controller to request a ticket on the user’s behalf, so the server segment needs Kerberos and LDAP outbound to a DC even though no user traffic goes that way. When delegation is configured correctly and still fails, the causes are usually SPN registration rather than ports — Kerberos constrained delegation not working works through that case in detail.

For AD FS, note the asymmetry in the 49443 rule. Client certificate authentication needs TCP 49443 inbound on the firewall between clients and the Web Application Proxy, but not on the firewall between the proxy and the federation servers. Microsoft also warns that no other service on those servers should be using 49443, which is worth checking on a shared host.

The Ports Everyone Forgets

These are the rules that get discovered three weeks after a segmentation project is declared complete, usually by someone who cannot print.

Port Protocol Direction Service / Purpose Notes
67 / 68UDPClient ↔ DHCP serverDHCPAcross subnets this is an IP helper, not a firewall rule.
647TCPServer ↔ ServerDHCP failoverBetween the two partners in a failover relationship.
2535UDPClient → DHCP serverMADCAPMulticast address allocation. Rare, but documented.
8530 / 8531TCPClient → WSUSWindows UpdateServer 2012 defaults. Both must be open when using HTTPS.
5985 / 5986TCPAdmin → targetWinRM 2.0 (HTTP / HTTPS)PowerShell Remoting and Windows Event Forwarding.
3389TCP + UDPAdmin → serverRemote DesktopUDP is used for transport optimisation, not just TCP.
137, 138, 139, 445TCP + UDPConsole → targetClassic remote Event ViewerThe Event Log service uses RPC over named pipes.
135 + dynamic, 445TCPClient → print serverPrint SpoolerSpooler is RPC over named pipes plus RPC.
515TCPClient → print serverLPDOnly for the TCP/IP Print Server role.
9100TCPPrint server → printerRaw / JetDirect printingDevice convention, not a Windows service port.
161 / 162UDPMonitoring ↔ deviceSNMP and SNMP traps161 queries in, 162 traps out.
80 / 443TCPEntra Connect → Entra IDDirectory synchronisation80 is for CRL retrieval, 443 for the sync itself.
53, 88, 135, 389, 445, 636, 3268, 49152-65535TCP + UDPEntra Connect → DCOn-premises AD read and password syncEffectively a member server’s full port set.
5985, 9389TCPEntra Connect → DCWinRM and AD Web ServicesOnly when installing AD FS with a gMSA via the wizard.

Two honest caveats. Syslog is conventionally UDP 514, and TCP 514 or 6514 for TLS, but that is a protocol convention rather than a Microsoft service port — take the real value from your collector’s configuration. Backup agents are entirely vendor-specific and frequently use a control port plus a dynamically negotiated data channel; there is no useful generic answer, and guessing produces a rule that passes a firewall review and fails a restore. Get the port list from the vendor for the version you are running.

Windows Event Forwarding deserves a specific mention because its direction surprises people. In the common source-initiated setup, the forwarding computers connect outbound to the collector over WinRM, so the rule you need is from the monitored estate to the collector, not the reverse. If you have modelled it as a management tool reaching in, the rules will be backwards.

“Just Open Everything Between the DCs”

This request appears in every AD firewall project, usually from the AD team, and it is worth understanding why it is both reasonable and wrong.

It is reasonable because the dynamic RPC range genuinely is enormous, the interactions genuinely are complex, and a permit-any rule between two domain controllers does eliminate an entire class of tickets. Nobody asking for it is being lazy.

It is wrong because domain controllers are the highest-value target in the estate, and a permit-any rule between them means that an attacker who compromises one has unrestricted lateral movement to every other. It also destroys your ability to answer the question “what does this DC actually talk to?”, which you will want during an incident. And in practice it papers over the real problem: nobody documented what the environment needs, so the ruleset can never be reviewed or reduced.

What to offer instead, in the order network teams tend to accept it. Start with the fixed-port set — twelve well-known ports with a clear justification each, which is a rule sheet a security team can actually approve. Then handle the dynamic range by pinning NTDS, Netlogon and DFSR to specific static ports, which converts “sixteen thousand ports” into “three more ports”. Where the boundary is genuinely hostile, encapsulate the whole conversation: Microsoft’s documented alternative is IPsec, which reduces the firewall rule to ESP (IP protocol 50), ISAKMP on UDP 500, and NAT-T on UDP 4500 regardless of what is inside the tunnel.

Better approach: Bring a specific list, not a range. “These twelve ports plus three pinned RPC ports, between these named hosts” gets approved. “49152-65535 any-to-any” gets escalated, delayed, and eventually approved anyway in a worse form than you would have designed.

Proving a Port Is Actually Open

A firewall rule existing and a port being reachable are different claims. These are the tools, roughly in order of how much they tell you.

# Cheapest check: is this single TCP port reachable from here?
Test-NetConnection -ComputerName dc02.corp.example.com -Port 389

# Ask the RPC endpoint mapper what it is actually advertising.
# Querying 135 with -e returns every endpoint currently registered.
portqry -n dc02.corp.example.com -e 135 -p tcp

# Probe a range. Note the separator is a colon, not a hyphen.
portqry -n dc02.corp.example.com -r 49152:49200 -p tcp

# Query several specific ports in one pass, in the order given.
portqry -n dc02.corp.example.com -p both -o 88,135,389,445,464

# Confirm the local dynamic port range matches what the firewall allows.
netsh int ipv4 show dynamicport tcp

# Is replication actually succeeding, and with which partners?
repadmin /showrepl
repadmin /replsummary

# Microsoft's own replication and connectivity tests.
dcdiag /test:replications
dcdiag /test:connectivity

# Which DC does this machine believe it should be using, and is the channel healthy?
nltest /dsgetdc:corp.example.com
nltest /sc_query:corp.example.com
Troubleshooting note: PortQry’s three answers mean different things. LISTENING is a clean success. NOT LISTENING means the packet reached the host and was actively refused — the path is open, the service is not running. FILTERED means no answer came back at all, which is what a firewall drop looks like. Confusing the last two sends you to the wrong team.

The order matters. Test-NetConnection proves a single TCP path and nothing else. PortQry against 135 is the one that earns its keep on RPC problems, because it does not just test the port — it enumerates what the endpoint mapper is handing out, so you see the dynamic ports the service is genuinely using and can test those specifically. Then repadmin /showrepl tells you whether the directory agrees that any of it is working.

One documented quirk: a PortQry query to UDP 389 may not work correctly against modern domain controllers. Use nltest to check the DC locator service on UDP 389 rather than concluding the port is blocked.

When these tests point at RPC specifically, replication error 1722 walks through the full diagnosis, and Windows Firewall with Advanced Security covers the host-based half of the problem.

Gotchas That Cost You a Change Window

Gotcha What Happens What To Do
Mixed OS versions Server 2003-era hosts use ephemeral range 1025-5000; Server 2008 and later use 49152-65535. A rule for one breaks the other. Where both eras coexist, open both ranges until the legacy hosts are gone.
Stale 5722 rules DFSR used TCP 5722 on Server 2008 and 2008 R2 only. On 2012 and later it uses the dynamic range instead. Remove the 5722 rule and confirm the dynamic range is genuinely permitted.
Host firewall vs network firewall The network rule is approved, Windows Firewall still drops it, and the network team is blamed. Test from the host with Test-NetConnection, then check the inbound rule on the destination.
NAT in the path Kerberos tickets are bound to service principal names and addresses. Translating addresses between client and DC breaks authentication in ways that look like credential problems. Do not NAT domain traffic. Route it, or tunnel it with IPsec.
Asymmetric routing Request goes out one path, reply returns another. A stateful firewall sees a reply with no session and drops it. Confirm both directions traverse the same firewall pair before blaming the port list.
Stateless UDP rules TFTP listens on 69 and replies from a dynamic high port. A permit for UDP 69 alone silently drops every response. Use a stateful rule, or place a distribution point inside the segment.
IPsec expected but not negotiated Traffic encapsulated in ESP needs IP protocol 50, UDP 500 and UDP 4500. Miss those and nothing passes, whatever the inner ports say. Permit the tunnel protocols explicitly. Packet filters for L2TP are not needed when ESP protects it.
Only 135 opened The endpoint mapper answers, hands out a dynamic port, and the connection to that port is dropped. Looks like a working rule. Open the dynamic range, or pin NTDS, Netlogon and DFSR to static ports.

Final Thoughts

The reason AD firewall work is unpleasant is not that the port list is long. It is that the failures are asymmetric: nearly every missing rule produces a delayed, partial, or intermittent symptom rather than a clean error. Group Policy goes stale. Password changes fail while logon works. A certificate validates in one segment and hangs in another. By the time anyone reports it, the change that caused it is weeks old and off the suspect list.

The defence is to treat the port list as documentation of what the environment actually does, rather than as a request form. Write down which host needs to reach which host and why. Pin the RPC services so the dynamic range stops being the whole conversation. Prove reachability with PortQry and repadmin rather than trusting the rule sheet. Then the next segmentation project starts from a list instead of an argument.

Key takeaway: Open the twelve fixed ports — 53, 88, 123, 135, 389, 445, 464, 636, 3268, 3269, 9389 and the dynamic RPC range — then pin NTDS, Netlogon and DFSR to static ports so the dynamic range shrinks to three. Verify with portqry -n <dc> -e 135 to see what the endpoint mapper is really advertising, and confirm with repadmin /showrepl that the directory agrees.
Next in this series

Next, we can cover the other half of this problem: designing AD Sites and Services so that replication traffic follows the links you intended, and clients pick a domain controller in their own site rather than one across a WAN.