The
netbios
aliases
option can be used to give the Samba server more than one NetBIOS name. Each NetBIOS name listed as a value will be displayed in the Network Neighborhood of a browsing machine. When a connection is requested to any machine, however, it will connect to the same Samba server.
This might come in handy, for example, if you're transferring three departments' data to a single Unix server with modern large disks, and are retiring or reallocating the old NT servers. If the three servers are called
sales
,
accounting
, and
admin
, you can have Samba represent all three servers with the following options:
[global]
netbios aliases = sales accounting admin
include = /usr/local/samba/lib/smb.conf.%L
See
Figure 4.7 for what the Network Neighborhood would display from a client.When a client attempts to connect to Samba, it will specify the name of the server that it's trying to connect to, which you can access through the
%L
variable. If the requested server is
sales
, Samba will include the
/usr/local/samba/lib/smb.conf.sales file. This file might contain global and share declarations exclusively for the sales team, such as the following:
[global]
workgroup = SALES
hosts allow = 192.168.10.255
[sales1998]
path = /usr/local/samba/sales/sales1998/
...
This particular example would set the workgroup to SALES as well, and set the IP address to allow connections only from the SALES subnet (192.168.10). In addition, it would offer shares specific to the sales department.