Thursday 17 October 2024

How to configure a firewall for Active Directory domains and trusts

How to configure a firewall for Active Directory domains and trusts

 

Client Port(s)Server PortService
1024-65535/TCP135/TCPRPC Endpoint Mapper
1024-65535/TCP1024-65535/TCPRPC for LSA, SAM, NetLogon (*)
1024-65535/TCP/UDP389/TCP/UDPLDAP
1024-65535/TCP636/TCPLDAP SSL
1024-65535/TCP3268/TCPLDAP GC
1024-65535/TCP3269/TCPLDAP GC SSL
53,1024-65535/TCP/UDP53/TCP/UDPDNS
1024-65535/TCP/UDP88/TCP/UDPKerberos
1024-65535/TCP445/TCPSMB
1024-65535/TCP1024-65535/TCPFRS RPC (*)

NetBIOS ports as listed for Windows NT are also required for Windows 2000 and Windows Server 2003 when trusts to domains are configured that support only NetBIOS-based communication. Examples are Windows NT-based operating systems or third-party Domain Controllers that are based on Samba.

For more information about how to define RPC server ports that are used by the LSA RPC services, see:

Windows Server 2008 and later versions

Windows Server 2008 newer versions of Windows Server have increased the dynamic client port range for outgoing connections. The new default start port is 49152, and the default end port is 65535. Therefore, you must increase the RPC port range in your firewalls. This change was made to comply with Internet Assigned Numbers Authority (IANA) recommendations. This differs from a mixed-mode domain that consists of Windows Server 2003 domain controllers, Windows 2000 server-based domain controllers, or legacy clients, where the default dynamic port range is 1025 through 5000.

For more information about the dynamic port range change in Windows Server 2012 and Windows Server 2012 R2, see:

Client Port(s)Server PortService
49152-65535/UDP123/UDPW32Time
49152-65535/TCP135/TCPRPC Endpoint Mapper
49152-65535/TCP464/TCP/UDPKerberos password change
49152-65535/TCP49152-65535/TCPRPC for LSA, SAM, NetLogon (*)
49152-65535/TCP/UDP389/TCP/UDPLDAP
49152-65535/TCP636/TCPLDAP SSL
49152-65535/TCP3268/TCPLDAP GC
49152-65535/TCP3269/TCPLDAP GC SSL
53, 49152-65535/TCP/UDP53/TCP/UDPDNS
49152-65535/TCP49152-65535/TCPFRS RPC (*)
49152-65535/TCP/UDP88/TCP/UDPKerberos
49152-65535/TCP/UDP445/TCPSMB (**)
49152-65535/TCP49152-65535/TCPDFSR RPC (*)

NetBIOS ports as listed for Windows NT are also required for Windows 2000 and Server 2003 when trusts to domains are configured that support only NetBIOS-based communication. Examples are Windows NT-based operating systems or third-party Domain Controllers that are based on Samba.

(*) For information about how to define RPC server ports that are used by the LSA RPC services, see:

(**) For the operation of the trust this port is not required, it is used for trust creation only.

 Note

External trust 123/UDP is only needed if you have manually configured the Windows Time Service to Sync with a server across the external trust.

Active Directory

The Microsoft LDAP client uses ICMP ping when a LDAP request is pending for extended time and it waits for a response. It sends ping requests to verify the server is still on the network. If it does not receive ping responses, it fails the LDAP request with LDAP_TIMEOUT.

The Windows Redirector also uses ICMP Ping messages to verify that a server IP is resolved by the DNS service before a connection is made, and when a server is located by using DFS. If you want to minimize ICMP traffic, you can use the following sample firewall rule:

<any> ICMP -> DC IP addr = allow

Unlike the TCP protocol layer and the UDP protocol layer, ICMP does not have a port number. This is because ICMP is directly hosted by the IP layer.

By default, Windows Server 2003 and Windows 2000 Server DNS servers use ephemeral client-side ports when they query other DNS servers. However, this behavior may be changed by a specific registry setting. Or, you can establish a trust through the Point-to-Point Tunneling Protocol (PPTP) compulsory tunnel. This limits the number of ports that the firewall has to open. For PPTP, the following ports must be enabled.

Client PortsServer PortProtocol
1024-65535/TCP1723/TCPPPTP

In addition, you would have to enable IP PROTOCOL 47 (GRE).

 Note

When you add permissions to a resource on a trusting domain for users in a trusted domain, there are some differences between the Windows 2000 and Windows NT 4.0 behavior. If the computer cannot display a list of the remote domain's users, consider the following behavior:

  • Windows NT 4.0 tries to resolve manually typed names by contacting the PDC for the remote user's domain (UDP 138). If that communication fails, a Windows NT 4.0-based computer contacts its own PDC, and then asks for resolution of the name.
  • Windows 2000 and Windows Server 2003 also try to contact the remote user's PDC for resolution over UDP 138. However, they do not rely on using their own PDC. Make sure that all Windows 2000-based member servers and Windows Server 2003-based member servers that will be granting access to resources have UDP 138 connectivity to the remote PDC.


 

No comments:

Post a Comment

Note: only a member of this blog may post a comment.