[wellylug] samba server and dhcp
Sam Cannell
sam at plaz.net.nz
Sat May 8 00:14:07 NZST 2004
The first thing you should do is make sure all the PCs are in the same
workgroup - it'll make things a lot easier. Now, on to the fun:
SMB uses several kinds of dark magic to maintain a list of computers on
a network. The first is through a master browser. This is the only
method you can use on a workgroup-type network with only windows 9x / nt
workstation / windows xp PCs.
With this method, all the computers in the workgroup will periodically
participate in a browser election. Whichever PC wins this election will
be responsible for holding a list of workgroup PCs. Several things
determine which PC wins the election.
First of all, the PC must be willing to be a master browser. This is
configurable through registry hackery under Windows, or in smb.conf:
# set local master to no if you don't want Samba to become a master
# browser on your network. Otherwise the normal election rules apply
local master = yes
# Domain Master specifies Samba to be the Domain Master Browser. This
# allows Samba to collate browse lists between subnets. Don't use this
# if you already have a Windows NT domain controller doing this job
domain master = yes
# Preferred Master causes Samba to force a local browser election on
startup
# and gives it a slightly higher chance of winning the election
preferred master = yes
The other major factor in winning a browser election is the OS level.
This is designed to ensure that the PC with the highest version of
Windows will win the election.
A Windows 2000 Professional PC will 'beat' NT4 Workstation, Windows 98,
etc etc.
However, an NT4 Server will beat XP Professional, 2000 Professional, etc
etc.
Likewise, Windows 2000 Advanced Server beats Windows 2000 Server, etc
etc.
To set this in Samba:
# OS Level determines the precedence of this server in master browser
# elections. The default value should be reasonable
os level = 128
I'm fairly sure that 128 beats any Windows OS out there.
The other (easier and more reliable way) is to use a WINS server. 2000
Professional, NT Workstation etc don't provide a WINS server, but
NT/2000 Server do, as does Samba.
When using a WINS server, all workstations will immediately query a
specified address for netbios name resolution, rather than asking the
browse master.
To enable Samba's WINS server, add the following to smb.conf:
# WINS Support - Tells the NMBD component of Samba to enable its WINS
Server
wins support = yes
Next, you need to tell Windows to use the WINS server at your Linux PC's
ip address. You can either assign this manually in your network
connection settings, or provide it with DHCP.
The location in the network settings differs between Windows versions,
but it's somewhere within the TCP/IP settings for the connection.
Providing it by DHCP is a bit touchy - I've had problems with some
Windows versions not picking it up. In any case, you need to add the
following to the dhcpd.conf:
option netbios-name-servers www.xxx.yyy.zzz;
Where www.xxx.yyy.zzz is the ip address of your WINS server.
In short, if both your Samba and Windows PCs have floating dhcp IP
addresses, you're better off using the browser election setup. If your
Samba server can be configured as a WINS server and has a dynamic
address, use a WINS server.
BROWSING.txt in the Samba documentation has more information. :)
Hope this helps
Sam
-----Original Message-----
From: wellylug-admin at lists.naos.co.nz
[mailto:wellylug-admin at lists.naos.co.nz] On Behalf Of Phillip Rose
Sent: Friday, 7 May 2004 10:57 p.m.
To: wellylug at lists.naos.co.nz
Subject: [wellylug] samba server and dhcp
Hello,
I have just made the break from Ye Olde fixed IP addresses on my home
LAN
to using my Smoothwall machine as a dhcp server.
I have another Linux machine (Monty), and a Windoze machine (Krusty),
each
successfully getting IP addresses from Smoothwall. When I have two
Windoze
machines running, they can still see one another by hostname, just as
before with fixed IP addresses.
More information about the wellylug
mailing list