Wait—, not 170. So where does 170 come from? 2.2 The Mystery of Port 170 Port 170 is not a standard IANA-assigned NetBIOS port. In fact, the IANA registry lists port 170 as “Network PostScript” (a relic of printer sharing). However, within the context of SMBd and legacy Windows networking , port 170 appears as a historical or vendor-specific extension for certain NetBIOS datagram variations.
UNCONN 0 0 0.0.0.0:170 0.0.0.0:* users:(("nmbd",pid=1234,fd=7)) | Error | Likely Cause | Solution | |-------|--------------|----------| | bind failed on port 170: Address already in use | Another process (e.g., a second nmbd) owns the port | sudo lsof -i :170 to find and stop the conflict | | Clients cannot browse but can connect to shares | Datagram port mismatch or firewall blocking UDP 170 | Check iptables -L and client config | | smbd logs: Can't become connected master browser | Election packets lost on non-standard port | Ensure all potential master browsers use the same datagram port | 6.3 Firewall Rules for Port 170 If you intentionally use port 170, open it in your firewall: smbd 170
sudo systemctl restart nmbd sudo systemctl restart smbd After this change, nmbd will send and receive datagram packets on UDP 170 instead of UDP 138. Clients must be configured to match, making this a purely internal or testing configuration. A tcpdump capture on a Samba server using port 170 would show: Wait—, not 170
| Service | Port | Protocol | Purpose | |---------|------|----------|---------| | Name Service | 137 | UDP/TCP | Register/resolve NetBIOS names | | Datagram Service | | UDP | Connectionless broadcast/multicast messages | | Session Service | 139 | TCP | Connection-oriented file/print sharing | In fact, the IANA registry lists port 170