Skip to main content

Port

rangefornotes
0-1023Systemby IANA
1024-49151Userby IANA
49152-65535Dynamic & Privateby IANA
32768–60999Linux ip_local_port_range
32768–65535Solaris OS, AIX OS
1024–65535RFC 6056
30000–32767Kubernetes NodePort

如果自己需要定义固定端口,建议控制在 10000-30000 以内

# https://www.kernel.org/doc/html/latest//networking/ip-sysctl.html#ip-variables
cat /proc/sys/net/ipv4/ip_local_port_range
cat /proc/sys/net/ipv4/ip_local_reserved_ports
plainsecureprotocol
25465SMTP
53853DNS over QUIC/TLS/DTLS
80443HTTP,HTTPS
110995POP3S,POP3S
220993IMAP,IMAPS
389636LDAP,LDAPS
34785349TURN/STURN
3306MySQL
5432PostgreSQL
6379Redis
80808443HTTP Alt
27017Mongo
  • over TLS/SSL/DTLS/QUIC
  • Cloudflare’s proxy Network ports
    • Cloudflare Access 不支持自定义端口
    • 前端请求也得用这些端口,而不能 80-> 8080
    • HTTP
      • 80
      • 8080
      • 8880
      • 2052
      • 2082
      • 2086
      • 2095
    • HTTPS
      • 443
      • 2053
      • 2083
      • 2087
      • 2096
      • 8443
    • Cache Disabled
      • 2052
      • 2053
      • 2082
      • 2083
      • 2086
      • 2087
      • 2095
      • 2096
      • 8880
      • 8443

Well-known ports

  • Well-known 端口
    • 端口号 < 1024
Portfor
9Discard Protocol
Wake on LAN
22SSH
23Telnet
25SMTP
43WHOIS
53DNS
67/UDPBOOTP Server
68/UDPBOOTP Client
69/UDPTFTP
70Gopher
80HTTP, QUIC
88Kerberos
123NTP
137NetBIOS Name Service
138NetBIOS Datagram Service
139NetBIOS Session Service
179BGP
194IRC
220IMAPv3
264BGMP
389LDAP
443HTTPS
514syslog
546DHCPv6 Client
547DHCPv6 Server
548AFP
554RTSP
873rsync

Registered ports

官方注册端口,既定事实端口。

Portfor
1080SOCKS/HTTP Proxy
3306MySQL
5432PostgreSQL
6379Redis
32274FabricRPC
5900RFB
VNC
3478STUN
TURN
STUN Behavior Discovery
5349STUN over TLS/DTLS
TURN over TLS/DTLS
STUN Behavior Discovery over TLS
6000-6063X11 Client/Server

Application ports

非官方,但实际使用常见的端口

Portfor
2197APNS HTTP/2 JSON API
3000Node.js Web
6443Kubernetes API
8080HTTL Alt
4222NATS 客户端
8222NATS HTTP 管理和信息上报
6222NATS 集群路由
7422NATS Leaf Node
21115-21117/TCPRustDesk Server
21116/UDPRustDesk Server
21119/TCPRustDesk Server for Web Client
21118/TCPRustDesk Server for Web Client