Port 9: Discard

Port 9 (TCP/UDP) is used by Discard. Silently drops all data. Also the usual target port for Wake-on-LAN magic packets over UDP.

9Port
TCP/UDPProtocol
discardIANA service name
Legacy protocolsCategory

Port range

9 is a well-known (system) port (range 0–1023). On Linux and macOS, binding to it traditionally needs root or the CAP_NET_BIND_SERVICE capability.

Security

Port 9 should not be reachable from the public internet. Restrict it to trusted networks or a VPN, and scan your public IP to confirm it is closed.

Open port 9 in a firewall

ufw         sudo ufw allow 9/tcp
            sudo ufw allow 9/udp
iptables    sudo iptables -A INPUT -p tcp --dport 9 -j ACCEPT
            sudo iptables -A INPUT -p udp --dport 9 -j ACCEPT
firewalld   sudo firewall-cmd --permanent --add-port=9/tcp
            sudo firewall-cmd --permanent --add-port=9/udp
Windows     New-NetFirewallRule -DisplayName "Discard 9" -Direction Inbound -Protocol TCP -LocalPort 9 -Action Allow

Check if port 9 is open

nc -vz example.com 9
Test-NetConnection example.com -Port 9   # PowerShell
sudo ss -tulpn | grep ':9 '   # what is listening locally (Linux)

Other legacy protocols ports

Frequently asked questions

What is port 9 used for?
Discard. Silently drops all data. Also the usual target port for Wake-on-LAN magic packets over UDP.
Is port 9 TCP or UDP?
Both are assigned. Check which one your software actually listens on.