Common network ports

Quick Reference

Port Range
0 – 65535
Well-Known Ports
0 – 1023
Registered Ports
1024 – 49151
Dynamic / Ephemeral
49152 – 65535

Transport Protocols

Every port is associated with a transport layer protocol. Understanding the difference is essential for firewall rules and troubleshooting.

Protocol Full Name Connection Reliability Typical Use
TCP Transmission Control Protocol Connection-oriented (3-way handshake) Guaranteed delivery, ordered HTTP, SSH, FTP, SMTP
UDP User Datagram Protocol Connectionless No guarantee, no ordering DNS, DHCP, SNMP, VoIP
Firewall rule tip: When writing firewall rules, always specify both the port number AND the protocol (TCP/UDP). Port 53 TCP and port 53 UDP are technically different rules — DNS uses both depending on payload size.

Well-Known Ports (0–1023)

Assigned by IANA and require root/administrator privileges to bind on most operating systems. These are the ports every sysadmin must know by memory.

Port Protocol Service Full Name Notes
20TCPFTP-DATAFile Transfer Protocol (data)Active mode data channel
21TCPFTPFile Transfer Protocol (control)Control channel; use SFTP instead
22TCPSSHSecure ShellRemote access, SFTP, SCP tunnels
23TCPTelnetTelnetUnencrypted — avoid in production
25TCPSMTPSimple Mail Transfer ProtocolServer-to-server mail; often blocked by ISPs
53TCP/UDPDNSDomain Name SystemUDP for queries; TCP for zone transfers / large responses
67UDPDHCPDynamic Host Configuration ProtocolServer listens; client sends from port 68
68UDPDHCPDynamic Host Configuration ProtocolClient port
69UDPTFTPTrivial File Transfer ProtocolPXE boot, network device configs
80TCPHTTPHypertext Transfer ProtocolUnencrypted web traffic
110TCPPOP3Post Office Protocol v3Email retrieval; downloads and deletes from server
123UDPNTPNetwork Time ProtocolTime synchronization — critical for Kerberos/TLS
143TCPIMAPInternet Message Access ProtocolEmail retrieval; keeps mail on server
161UDPSNMPSimple Network Management ProtocolPolling/monitoring; port 162 for traps
162UDPSNMP TrapSNMP Trap ReceiverUnsolicited alerts from devices to manager
389TCP/UDPLDAPLightweight Directory Access ProtocolDirectory queries (AD, OpenLDAP)
443TCPHTTPSHTTP over TLS/SSLEncrypted web traffic — modern standard
445TCPSMBServer Message BlockWindows file sharing, Active Directory
465TCPSMTPSSMTP over TLS (implicit)Legacy; superseded by STARTTLS on 587
514UDPSyslogSystem Logging ProtocolLog forwarding; TCP 514 also common
587TCPSMTP (submission)Mail Submission AgentClient-to-server mail with STARTTLS
636TCPLDAPSLDAP over SSLEncrypted directory queries
993TCPIMAPSIMAP over SSLEncrypted IMAP
995TCPPOP3SPOP3 over SSLEncrypted POP3

Highlighted rows mark the most commonly encountered ports in day-to-day sysadmin work.

Common Registered Ports (1024–49151)

Assigned to specific applications by IANA. Do not require root privileges. These appear constantly in production infrastructure.

Port Protocol Service Notes
1433TCPMS SQL ServerMicrosoft SQL Server default instance
1434UDPMS SQL BrowserSQL Server Browser service for named instances
1521TCPOracle DBOracle Database listener default port
3306TCPMySQL / MariaDBDefault database port; restrict to localhost or VPN
3389TCPRDPWindows Remote Desktop Protocol; high-value attack target
4444TCPMetasploitDefault Metasploit listener — flag in traffic analysis
5432TCPPostgreSQLDefault PostgreSQL port
5900TCPVNCVirtual Network Computing remote desktop; display :0
5985TCPWinRM HTTPWindows Remote Management (PowerShell Remoting)
5986TCPWinRM HTTPSWindows Remote Management over TLS
6379TCPRedisRedis in-memory store; never expose to internet without auth
8080TCPHTTP AltCommon dev/proxy port; Tomcat, Jenkins, Squid default
8443TCPHTTPS AltAlternative HTTPS; Tomcat, management UIs
9200TCPElasticsearchElasticsearch REST API; restrict access — no auth by default
9300TCPElasticsearchElasticsearch node-to-node communication
27017TCPMongoDBMongoDB default; historically exposed without auth
Common mistake: Databases like Redis, MongoDB, and Elasticsearch ship with no authentication by default and listen on all interfaces. Exposing these ports to the internet has caused thousands of data breaches. Always bind to 127.0.0.1 or restrict access via firewall rules.

Ports by Category

Remote Access

PortProtoServiceNotes
22TCPSSHSecure remote shell — industry standard
23TCPTelnetUnencrypted — legacy only
3389TCPRDPWindows Remote Desktop
5900–5909TCPVNCDisplays :0–:9 respectively
5985/5986TCPWinRMPowerShell Remoting (HTTP/HTTPS)

Web & Proxy

PortProtoServiceNotes
80TCPHTTPUnencrypted web
443TCPHTTPSTLS-encrypted web
8080TCPHTTP AltDev servers, Tomcat, proxies
8443TCPHTTPS AltAlt HTTPS for management UIs
3128TCPSquid ProxyDefault Squid HTTP proxy port

Email

PortProtoServiceDirection / Notes
25TCPSMTPServer ↔ Server; blocked by most ISPs on residential IPs
465TCPSMTPSClient → Server; implicit TLS (legacy, still widely used)
587TCPSMTP SubmissionClient → Server; STARTTLS — recommended for clients
110TCPPOP3Client retrieves mail; deletes from server
995TCPPOP3SEncrypted POP3
143TCPIMAPClient syncs mail; keeps on server
993TCPIMAPSEncrypted IMAP — preferred

Directory & Authentication

PortProtoServiceNotes
88TCP/UDPKerberosAD authentication tickets
389TCP/UDPLDAPActive Directory, OpenLDAP queries
636TCPLDAPSLDAP over TLS — use in production
1812UDPRADIUS AuthAuthentication for network access (802.1X, VPN)
1813UDPRADIUS AccountingSession accounting

File Transfer & Storage

PortProtoServiceNotes
21TCPFTPControl channel; use SFTP or FTPS instead
22TCPSFTP / SCPSecure file transfer over SSH
69UDPTFTPPXE boot, network device firmware
111TCP/UDPRPC / portmapperRequired for NFS
445TCPSMB/CIFSWindows shares; also used by AD
2049TCP/UDPNFSNetwork File System

Monitoring & Management

PortProtoServiceNotes
123UDPNTPTime sync — critical for Kerberos, TLS certs, logs
161UDPSNMPPoll device metrics; use SNMPv3 with auth
162UDPSNMP TrapDevice sends unsolicited alerts to manager
514UDP/TCPSyslogLog forwarding to SIEM / log server
2055UDPNetFlowCisco NetFlow traffic records
9100TCPPrometheus Node ExporterDefault metrics scrape endpoint

VPN & Tunneling

PortProtoServiceNotes
500UDPIKE / IPsecVPN key exchange (IKEv1/IKEv2)
1194UDP/TCPOpenVPNOpenVPN default; UDP preferred
1701UDPL2TPLayer 2 Tunneling Protocol
1723TCPPPTPObsolete VPN; avoid — broken encryption
4500UDPIPsec NAT-TIPsec through NAT devices
51820UDPWireGuardDefault WireGuard port; configurable

Active Directory Port Map

Active Directory relies on a large number of ports. This is the minimal set required for domain communication between clients, member servers, and domain controllers.

PortProtoServiceRequired For
53TCP/UDPDNSDomain name resolution — critical
88TCP/UDPKerberosAuthentication
123UDPNTPTime sync (Kerberos fails if clock skew > 5 min)
135TCPRPC Endpoint MapperDynamic RPC port assignment
137–139UDP/TCPNetBIOSLegacy name resolution (optional in modern AD)
389TCP/UDPLDAPDirectory queries and updates
445TCPSMBGPO, SYSVOL replication, logon scripts
464TCP/UDPKerberos passwordPassword changes via Kerberos
636TCPLDAPSEncrypted directory queries
3268TCPGlobal CatalogForest-wide LDAP queries
3269TCPGlobal Catalog SSLEncrypted Global Catalog
49152–65535TCPRPC DynamicAD replication, NETLOGON, remote management
RPC dynamic ports: Active Directory uses random ports in the 49152–65535 range for replication and remote procedure calls. If you have a firewall between domain controllers, you must either allow this entire range or configure a static RPC port range via Group Policy.

Security Notes

Ports to Always Restrict or Disable

PortServiceRiskRecommendation
21FTPCredentials in plaintextReplace with SFTP (port 22) or FTPS
23TelnetAll traffic in plaintextReplace with SSH
1723PPTP VPNBroken encryption (MS-CHAP)Replace with WireGuard or OpenVPN
3389RDPBrute force, BlueKeep CVERestrict to VPN; enable NLA; use non-standard port
6379RedisNo auth by defaultBind to 127.0.0.1; require password
27017MongoDBNo auth by defaultEnable auth; firewall from public internet
9200ElasticsearchNo auth in older versionsEnable security; restrict with firewall
Common mistake: Changing a service to a non-standard port (e.g., SSH to port 2222) is NOT a security measure — it only reduces noise in logs. Security comes from strong authentication, firewall rules, and keeping software patched.

Scanning & Verification

Use these commands to quickly check which ports are open and what is listening.

CommandPlatformPurpose
ss -tlnpLinuxList all listening TCP ports with process names
netstat -tlnpLinuxSame as above (older systems)
netstat -anoWindowsAll connections with PID
Get-NetTCPConnectionPowerShellList TCP connections and listeners
nmap -sV 192.168.1.1AnyScan host for open ports and service versions
telnet host portAnyQuick TCP connectivity test
nc -zv host portLinux/macOSTest TCP/UDP port reachability

FAQ

What is the difference between well-known, registered, and dynamic ports?
Well-known ports (0–1023) are assigned by IANA to core protocols and require root/admin privileges to bind. Registered ports (1024–49151) are assigned to specific applications but don’t require elevated privileges. Dynamic (ephemeral) ports (49152–65535) are assigned by the OS to client applications for outbound connections and are released when the connection closes.
Why does DNS use both TCP and UDP on port 53?
DNS uses UDP by default for standard queries because it’s faster — no connection setup, small packets. TCP is used when the response exceeds 512 bytes (e.g., large TXT records, DNSSEC responses) or for zone transfers between DNS servers. Modern DNS implementations (RFC 7766) also use TCP more broadly. Your firewall must allow both protocols on port 53.
Which SMTP port should I use for sending email?
For mail clients sending to a mail server (submission): use port 587 with STARTTLS — this is the current standard. Port 465 (implicit TLS) is also widely supported and still used by many providers. Port 25 is for server-to-server relay and is typically blocked by ISPs on residential connections to prevent spam.
How do I find what process is using a specific port?
On Linux: ss -tlnp | grep :80 or lsof -i :80. On Windows: netstat -ano | findstr :80 — note the PID, then tasklist | findstr <PID>. On PowerShell: Get-NetTCPConnection -LocalPort 80 | Select-Object State, OwningProcess.
Is it safe to expose port 22 (SSH) to the internet?
With proper hardening, yes. Best practices: disable password authentication (use SSH keys only), disable root login (PermitRootLogin no), use AllowUsers to restrict which accounts can log in, and consider fail2ban or similar to block brute-force attempts. For high-security environments, restrict SSH access to specific IP ranges or put it behind a VPN.
What are ephemeral ports and why do they matter for firewalls?
When your system initiates an outbound connection, the OS assigns a random source port from the ephemeral range (49152–65535 on modern systems; 1024–65535 on older Linux). Stateful firewalls track these automatically. If you have a stateless packet filter, you must explicitly allow return traffic to the ephemeral range, or outbound connections will work but replies will be dropped.