Common TCP, UDP Ports, plus Tightening up Your Firewalls

Below is a list of common ports and protocols for use on your Windows and Linux firewalls, switch ACL’s, network firewalls, and of course cloud architecture like Azure Network Security Groups (NSG’s).

To add some color to what may be a boring subject, I’m very accustomed to blocking all outbound Internet traffic and then only permitting necessary outbound flows. In doing so, you will continuously need to add new ACL’s or maintain or delete existing ones as things change in the environment. Knowing the ports and protocols that common services use is key.

To elaborate on above, an example of restricting the outbound (LAN to WAN) traffic while permitting only necessary traffic (including Internet access) is below. The example gets the basics in place including time, DNS, and web traffic. Make sure your endpoint devices use internal DNS and time infrastructure only. Only permit your DNS and time sources to connect to specific external DNS and NTP services that you trust.

Action/DescProtocolSourceDestinationPorts
Permit – NTP, for authoritative time server (usually a DC)udp172.16.21.10/32pool.ntp.org123
Permit – DNS infra, like an AD DCudp172.16.21.10/32
172.16.21.11/32
208.67.222.222
208.67.220.220
53
Permit – Web, http and httpstcp172.16.21.0/24Any80, 443
Deny – AllAnyAnyAnyAny

Of course, ALL incoming traffic (WAN to LAN) should be blocked. A DMZ should be considered if you need to expose inside services to the public Internet

Below is the more comprehensive list of ports, protocol, service, and purpose.

PortProtocolServiceBrief Purpose
20/21TCPFTPFile Transfer Protocol. 21 for commands, 20 for data.
22TCPSSHSecure Shell. Encrypted remote login and file transfers (SFTP).
23TCPTelnetOld, unencrypted remote login. Avoid using on public networks.
25TCPSMTPSimple Mail Transfer Protocol. Used for server-to-server email.
53UDP/TCPDNSDomain Name System. Translates names to IP addresses.
67/68UDPDHCPAssigns IP addresses to devices on a local network.
69UDPTFTPTrivial FTP. Simple, no-auth file transfer for booting hardware.
80TCPHTTPUnencrypted web traffic.
88UDP/TCPKerberosNetwork authentication, primarily for Windows Domains.
110TCPPOP3Post Office Protocol v3. Retrieves email from a server.
123UDPNTPNetwork Time Protocol. Syncs clocks across the internet.
143TCPIMAPInternet Message Access Protocol. Synced email retrieval.
161/162UDPSNMPSimple Network Management Protocol. Monitors network health.
389TCP/UDPLDAPAccessing and maintaining distributed directory services.
443TCPHTTPSSecure, encrypted web traffic (TLS/SSL).
445TCPSMBWindows file sharing and printer access.
500UDPISAKMPUsed to set up IPsec VPN security associations.
514UDPSyslogStandard for sending system log messages to a server.
587TCPSMTP (TLS)Modern secure port for sending/submitting email.
636TCPLDAPSSecure LDAP over SSL/TLS.
993TCPIMAPSSecure IMAP over SSL/TLS.
995TCPPOP3SSecure POP3 over SSL/TLS.
1433TCPMSSQLMicrosoft SQL Server database communication.
1812/1813UDPRADIUSAuthentication (1812) and Accounting (1813) for Wi-Fi/VPN.
1900UDPUPnPDiscovery for smart devices (TVs, printers) on a LAN.
3268/3269TCPGCActive Directory Global Catalog (3269 is the SSL version).
3306TCPMySQLDefault port for MySQL and MariaDB databases.
3389TCPRDPMicrosoft Remote Desktop for graphical remote access.
5060/5061UDP/TCPSIPVoice over IP (VoIP) signaling and call setup.
5432TCPPostgresDefault port for PostgreSQL databases.
6379TCPRedisHigh-speed, in-memory data store and caching.
8080TCPHTTP-AltCommon alternative for web servers or proxy services.
8443TCPHTTPS-AltCommon alternative for secure web management consoles.
27017TCPMongoDBStandard port for MongoDB NoSQL databases.
Scroll to Top