UDP port 137 is the NetBIOS Name Service, a legacy Windows mechanism for finding machines by name on a local network. UDP 138 carries NetBIOS datagrams and TCP 139 carries NetBIOS sessions. It should not be reachable from the public internet.
- Port
- 137
- Protocol
- UDP
- Service
- NetBIOS Name Service
- Expose to internet?
- No
- Also used by
- Windows file sharing, Samba (nmbd)
Is port 137 safe to open?
NetBIOS name queries reveal the computer name, workgroup or domain and sometimes the logged-in user. It is a local-network protocol with no use on the internet. Exposed NetBIOS has also been abused for small-scale reflection attacks.
How to secure NetBIOS Name Service
- Block UDP 137–138 and TCP 139 at the network edge.
- Disable NetBIOS over TCP/IP in the adapter’s IPv4 WINS settings if nothing on the network needs it.
- On Samba servers that do not need browsing, disable nmbd with
disable netbios = yes.
Check if port 137 is open
Linux: what is listening on this port
sudo ss -ulpn | grep ':137 'Windows (PowerShell): what is listening
Get-NetUDPEndpoint -LocalPort 137From another machine: is it reachable
sudo nmap -sU -p 137 HOSTRestrict port 137 in the firewall
Replace 10.0.0.0/8 with the network or address that needs access. Docker publishes container ports through its own iptables rules, which bypass ufw; bind published ports to 127.0.0.1 (-p 127.0.0.1:137:137) instead of relying on the host firewall.
ufw: allow only your private network, deny everyone else
sudo ufw allow from 10.0.0.0/8 to any port 137 proto udp
sudo ufw deny 137/udpfirewalld: allow one source network only
sudo firewall-cmd --permanent --remove-port=137/udp
sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="10.0.0.0/8" port port="137" protocol="udp" accept'
sudo firewall-cmd --reloadiptables
sudo iptables -A INPUT -p udp --dport 137 -s 10.0.0.0/8 -j ACCEPT
sudo iptables -A INPUT -p udp --dport 137 -j DROPWindows Firewall (PowerShell, as Administrator)
New-NetFirewallRule -DisplayName "Block 137 from internet" -Direction Inbound -Protocol UDP -LocalPort 137 -RemoteAddress Internet -Action BlockMonitor port 137
Run a TCP port monitor against your public IP on port 137: here, a failed connection is the healthy result, so you know the firewall is still doing its job. On Linux, the Statance agent also reports every listening port on the server. TCP port monitoring.
Related ports
| Port 139 | NetBIOS Session Service (SMB over NetBIOS) | High risk |
| Port 445 | SMB | Critical risk |
| Port 135 | Microsoft RPC endpoint mapper | High risk |
FAQ
What is port 137 used for?
UDP port 137 is the NetBIOS Name Service, a legacy Windows mechanism for finding machines by name on a local network. UDP 138 carries NetBIOS datagrams and TCP 139 carries NetBIOS sessions. It is also used by Windows file sharing, Samba (nmbd).
Is it safe to open port 137?
Not to the public internet. NetBIOS name queries reveal the computer name, workgroup or domain and sometimes the logged-in user. It is a local-network protocol with no use on the internet. Exposed NetBIOS has also been abused for small-scale reflection attacks.
Is port 137 TCP or UDP?
NetBIOS Name Service uses UDP on port 137.
How do I check if port 137 is open?
On the server, run sudo ss -tulpn | grep ':137 ' (Linux) or Get-NetTCPConnection -LocalPort 137 (Windows) to see what is listening. From another machine, run nc -zv HOST 137 or Test-NetConnection HOST -Port 137.
Know the moment a port stops answering.
TCP, HTTP, DNS and SSL checks from six regions, plus server metrics from a one-line agent.