Port 646: LDP

Port 646 (TCP/UDP) is used by LDP. Label Distribution Protocol in MPLS networks.

646Port
TCP/UDPProtocol
ldpIANA service name
Network infrastructureCategory

Port range

646 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

Only open port 646 to the hosts that need it. Prefer the encrypted variant of the protocol where one exists.

Open port 646 in a firewall

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

Check if port 646 is open

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

Other network infrastructure ports

Frequently asked questions

What is port 646 used for?
LDP. Label Distribution Protocol in MPLS networks.
Is port 646 TCP or UDP?
Both are assigned. Check which one your software actually listens on.