To configure SAMBA you need a bit of knowledge about Microsoft Networking. Pre-Windows 2000 systems used NetBIOS over TCP/IP to provide you with SMB (Service Message Block) connections. Windows 2000 and later systems are equiped with SMB over TCP/IP. As Microsoft states in their Direct hosting of SMB over TCP/IP document this has a couple of advantages:
With NetBIOS over TCP/IP or NBT for short the following ports are used:
NetBIOS name | UDP | 137 | |
NetBIOS name | TCP | 137 | |
NetBIOS datagram | UDP | 138 | |
NetBIOS session | TCP | 139 |
Within SAMBAs smb.conf this can be controlled by:
disable netbios = no smb ports = 139
NetBIOS on you LAN can be an annoiance due to the amount of broadcasts that it sents. However NetBIOS over the Internet is an enormous security risk. The NetBIOS protocol gives people the ability to obtain all kind of information from your systems like: your domain, workgroup and system names, as well as account information. To prevent this from happening make sure that on your border gateways you filter out all in- and outgoing traffic for ports 137, 138 and 139.
SMB of TCP/IP or CIFS (Common Internet File System) uses:
CIFS | TCP | 445 | |
CIFS | UDP | 445 |
Within SAMBAs smb.conf this can be controlled by:
disable netbios = yes smb ports = 445
If you want to support both use:
disable netbios = no smb ports = 139 445
The big question now is: How does a Microsoft Client handle all this? Windows 2000 and later systems setup two connections simultaniously to a server one on port 445 and one on port 139. If it gets a response from port 445 it will reset (RST) the port 139 connection. If it only gets a response from port 139, that one is used. If you disable NBT on your client only port 445 is being tried.
Pre-Windows 2000 clients only use port 139.
So if you do not have systems that pre-date Windows 2000 on your network I would suggest to go with SMB over TCP/IP option in your smb.conf.
For those that realy want to get into the details of NetBIOS, SMB and CIFS I suggest reading: Implementing CIFS