Covers 80+ common ports · TCP/UDP filtering · Security recommendations

Port Number Lookup Port number query comparison table

Quickly query the usage, common services and security suggestions of TCP/UDP Port. Applicable to Network managementFirewall settingsDockerNAS with Self-service

Filter:

❓ FAQ FAQ

Frequently Asked Questions and Answers about Network Ports

What is a Port? Why is it important?

Port (port/port number) It is a digital tag used to identify a specific application or service in online communications. You can imagine that the IP address is the "building address" and the Port is the "room number in the building."

When your computer communicates with the server, in addition to knowing the other party's IP address, you also need to specify the port number so that the data can be correctly delivered to the corresponding application (for example, the browser uses Port 80 to access the web server).

Port range:

  • Well Known Ports(0–1023) — System reserved, assigned by IANA to well-known services (HTTP, SSH, FTP, etc.)
  • Registered Ports(1024–49151) — Can be registered for use by applications and databases (MySQL 3306, Redis 6379, etc.)
  • Dynamic / Private Ports(49152–65535) — Dynamic allocation for temporary connections and custom services
What is the difference between TCP and UDP?

TCP and UDP are the two core protocols of the transport layer. The biggest difference is that Reliability with efficiency

TCP (Transmission Control Protocol) — Reliable but slow

🔹 Establish connection (three-way handshake)
🔹 Guaranteed data delivery (confirmation mechanism Auto-Retry)
🔹 Guarantee the order of data (serial number)
🔹 Applicable: Web browsing (HTTP), Email (SMTP), file transfer (FTP), SSH

UDP (User Data Packet Protocol) — Fast but unreliable

🔹 No connection (send and go)
🔹 Delivery is not guaranteed (packets may be lost)
🔹 No guarantee of order
🔹Applicable to: DNS query, video streaming, online games, VoIP voice calls

💡 Selection principles: Need data integrity → TCP; need immediacy → UDP. Many services support both protocols (e.g. DNS uses UDP as the main protocol, but switches to TCP if it exceeds 512 bytes).

What is Docker Port Mapping? How does it work?

Docker Port Mapping It maps the connection port inside the Docker container to the connection port on the host (Host), so that the outside world can access the services in the container through the host IP.

Syntax:docker run -p 主機埠:容器埠

Practical example:

docker run -p 8080:80 nginx

→ Map Port 80 (Nginx) in the container to Port 8080 of the host

→ Externally permeable http://主機IP:8080 access

⚠️Safety reminder:

  • Avoid exposing database ports (such as 3306) directly to the host (unless necessary)
  • Use the Docker internal network (bridge network) to communicate between containers without exposing ports
  • Map only required ports, do not use -p 0.0.0.0:80:80 exposed to all interfaces
Which ports have the most common security risks? How to protect?

Opening unnecessary ports is one of the most common risks in network security. The following are commonly attacked targets and protection suggestions:

🔴 High Risk Port

  • Port 22 (SSH) — Disable password login, use SSH Key, and use non-standard ports instead
  • Port 23 (Telnet) — Not recommended at all, use SSH instead
  • Port 445 (SMB) — Should not be open to the public (WannaCry ransomware spread through this port)
  • Port 3306 (MySQL) — Internal network access only and should not be exposed to the Internet
  • Port 3389 (RDP) — Use a VPN connection to access, or enable NLA authentication

🛡️ General protection principles:

  • The firewall only opens necessary ports (principle of least privilege)
  • Using VPN to access internal management interface
  • Regularly scan ports open to the outside world (using tools such as nmap)
  • Enable intrusion prevention mechanisms such as Fail2Ban
  • Keep service versions updated (patch known vulnerabilities)
What is NAT/Port Forwarding? How to set it up on the router?

Port Forwarding It is a function of NAT (Network Address Translation) that allows external networks to access services in the internal LAN through the router's IP.

Typical usage scenarios:

  • Set up a web server at home (forward Port 80/443 to the internal host)
  • Remote access to NAS (forwarding specific management port)
  • Remote desktop connection to company computer (forwarding Port 3389)
  • Self-hosted Minecraft server (forwarding Port 25565)

⚠️Safety reminder:

  • Only forward necessary ports (do not forward all)
  • Try to use non-standard ports (such as setting SSH to Port 2222 instead of 22)
  • Use firewall rules to limit source IP
  • Consider using a reverse proxy (such as Nginx Proxy Manager) to uniformly manage external services
  • Regularly check router forwarding rules
Which ports are used by common NAS services?

NAS (Network Attached Storage) devices use a variety of ports to provide file sharing, media streaming and management functions:

Synology / QNAP Common Ports

  • 5000 / 5001 — DSM/QTS Web management interface (HTTP/HTTPS)
  • 21 — FTP file transfer
  • 137-139 — NetBIOS / SMB file sharing (Windows)
  • 443 — HTTPS secure connection
  • 548 — AFP (Apple File Sharing)
  • 2049 — NFS (Linux file sharing)
  • 9091 — Transmission BT download management
  • 32400 — Plex Media Server

💡 Recommendation: The NAS management interface should not be directly exposed to the Internet. It is recommended to connect through a VPN before accessing. If remote access is necessary, enable HTTPS (Port 5001) and use strong passwords.

How to check if the port is open?

There are several ways to check whether a port is open, from simple to advanced:

1️⃣ Use nmap (the most powerful)

nmap -sT -p 80,443 目標IP

Scan a specific Port for a specified IP

2️⃣ Use telnet (simple test TCP)

telnet 目標IP 埠號

A successful connection means the port is open

3️⃣ Use nc (netcat)

nc -zv 目標IP 埠號

-z only scans without sending data, -v displays detailed information

4️⃣ Online tools

  • YouGetSignal — Online Port scanning tool
  • CanYouSeeMe — Check if your Port is visible to the outside world

💡 Note: Please obtain authorization before scanning a server that does not belong to you. Unauthorized scanning may violate the law.

📖 Complete Guide to Network Ports

Learn more about how network ports work, their classifications, and best practices

What is a network port?

Network Port It is a logical number used in the TCP/IP protocol to distinguish different network services. The concept is similar to the house number of an apartment building - the IP address is the "building address" and the Port is the "room number", ensuring that the data is delivered to the correct application.

The port number is a 16-bit unsigned integer ranging from 0 to 65535. The Internet Assigned Numbers Authority (IANA) divides Port into three ranges:

  • Well Known Ports(0–1023) — System reserved, requires root/admin privileges to use. Assigned to the most common web services (HTTP, FTP, SSH, DNS, etc.)
  • Registered Ports(1024–49151) — Available for application registration. Databases, game servers, enterprise software, etc. use this scope
  • Dynamic / Private Ports(49152–65535) — Used for temporary connections (such as the random port used by the browser to connect to the web server)

Differences between TCP and UDP

Before understanding ports, you must first understand TCP and UDP The differences between these two transport layer protocols:

TCP(Transmission Control Protocol)

TCP is aWire-guidedreliable transmission protocol. Before transmitting data, the client and server need to establish a connection through the "Three-Way Handshake". TCP ensures that data is delivered completely, in the correct order, and automatically retransmits packets if they are lost.

Suitable for applications requiring data integrity:Web browsing (HTTP/HTTPS)Email(SMTP、IMAP)File transfer (FTP, SFTP)Remote connection (SSH, Telnet)

UDP(User Datagram Protocol)

UDP is aNo connectionunreliable transmission protocol. It sends data packets directly without establishing a connection, confirming delivery, or guaranteeing order. But because it doesn't have this overhead, UDP has extremely low latency.

Ideal for applications requiring immediacy:DNS queryvideo streamingonline gamesVoIP voice callsDHCP

Selection principle:

Data Integrity > Speed → TCP
Immediacy > Completeness → UDP

Many services support both TCP and UDP (e.g. DNS uses UDP by default but switches to TCP when needed).

Common services and corresponding ports

Here are the most commonly used network services and their default ports:

  • 20/21 (FTP) — File Transfer Protocol (20 for data, 21 for control)
  • 22 (SSH) — Secure Shell, encrypted remote connections
  • 25 (SMTP) — Mail Transfer Protocol
  • 53 (DNS) — Domain name resolution system (mainly UDP)
  • 80 (HTTP) — Global Information Network, unencrypted web browsing
  • 443 (HTTPS) — Encrypted web browsing (TLS/SSL)
  • 3306 (MySQL) — MySQL database
  • 5432 (PostgreSQL) — PostgreSQL database
  • 6379 (Redis) — Redis cache database
  • 27017 (MongoDB) — MongoDB database

Firewall and Port Management Best Practices

Correct management of ports open to the outside world is the first line of defense for network security:

  • principle of least privilege — Only open necessary ports and close all ports not in the whitelist
  • Change default port — Move SSH, database and other services to non-standard ports (such as changing SSH to 2222)
  • Use a VPN — Management interfaces (NAS, routers, databases) accessed via VPN
  • firewall rules — Restrict specific source IP access to the management port
  • Fail2Ban — Automatically block IPs that attempt brute force attacks
  • Scan regularly — Use tools like nmap to check which ports are open to the outside world
  • Docker attention — Do not map container ports directly to host 0.0.0.0 unless necessary

Docker Port Mapping in-depth analysis

In a Docker environment, port management becomes more complex:

Each container has its own internal network, and the services within the container listen on specific port numbers. To allow external access to these services, you need to use -p Parameters for port mapping:

docker run -p 8080:80 nginx

Host Port 8080 → Container Port 80

Suggestions: When using Docker Compose, in ports: Mapping relationships are clearly defined in sections. Use 127.0.0.1:8080:80 You can allow the Port to only monitor the local machine, and then centrally manage external services through reverse proxies (such as Nginx Proxy Manager, Traefik).

Summary: Network ports are the infrastructure for network communication. Understanding the purpose of each Port, choosing the correct protocol (TCP/UDP), and implementing appropriate security measures are essential skills for every system administrator and developer. Use ToolHub's Port Number Lookup tool to check information and security recommendations for any port at any time.

Operation successful