Edits in progress.
[Samba/ekacnet.git] / docs / docbook / projdoc / Browsing-Quickguide.sgml
blobd8df57dcb9062d0f0c5b2da2e0efed5897f74659
1 <chapter id="Browsing-Quick">
2 <chapterinfo>
3 &author.jht;
4 <pubdate>July 5, 1998</pubdate>
5 <pubdate>Updated: March 15, 2003</pubdate>
6 </chapterinfo>
8 <title>Quick Cross Subnet Browsing / Cross Workgroup Browsing guide</title>
10 <para>
11 This document should be read in conjunction with Browsing and may
12 be taken as the fast track guide to implementing browsing across subnets
13 and / or across workgroups (or domains). WINS is the best tool for resolution
14 of NetBIOS names to IP addesses. WINS is NOT involved in browse list handling
15 except by way of name to address mapping.
16 </para>
18 <note><para>
19 MS Windows 2000 and later can be configured to operate with NO NetBIOS
20 over TCP/IP. Samba-3 and later also supports this mode of operation.
21 </para></note>
24 <sect1>
25 <title>Discussion</title>
27 <para>
28 Firstly, all MS Windows networking is based on SMB (Server Message
29 Block) based messaging. SMB messaging may be implemented using NetBIOS or
30 without NetBIOS. Samba implements NetBIOS by encapsulating it over TCP/IP.
31 MS Windows products can do likewise. NetBIOS based networking uses broadcast
32 messaging to affect browse list management. When running NetBIOS over
33 TCP/IP this uses UDP based messaging. UDP messages can be broadcast or unicast.
34 </para>
36 <para>
37 Normally, only unicast UDP messaging can be forwarded by routers. The
38 <command>remote announce</command>
39 parameter to smb.conf helps to project browse announcements
40 to remote network segments via unicast UDP. Similarly, the
41 <command>remote browse sync</command> parameter of <filename>smb.conf</filename>
42 implements browse list collation using unicast UDP.
43 </para>
45 <para>
46 Secondly, in those networks where Samba is the only SMB server technology
47 wherever possible &nmbd; should be configured on one (1) machine as the WINS
48 server. This makes it easy to manage the browsing environment. If each network
49 segment is configured with it's own Samba WINS server, then the only way to
50 get cross segment browsing to work is by using the
51 <command>remote announce</command> and the <command>remote browse sync</command>
52 parameters to your <filename>smb.conf</filename> file.
53 </para>
55 <para>
56 If only one WINS server is used for an entire multi-segment network then
57 the use of the <command>remote announce</command> and the
58 <command>remote browse sync</command> parameters should NOT be necessary.
59 </para>
61 <para>
62 As of Samba 3 WINS replication is being worked on. The bulk of the code has
63 been committed, but it still needs maturation.
64 </para>
66 <para>
67 Right now samba WINS does not support MS-WINS replication. This means that
68 when setting up Samba as a WINS server there must only be one &nmbd; configured
69 as a WINS server on the network. Some sites have used multiple Samba WINS
70 servers for redundancy (one server per subnet) and then used
71 <command>remote browse sync</command> and <command>remote announce</command>
72 to affect browse list collation across all
73 segments. Note that this means clients will only resolve local names,
74 and must be configured to use DNS to resolve names on other subnets in
75 order to resolve the IP addresses of the servers they can see on other
76 subnets. This setup is not recommended, but is mentioned as a practical
77 consideration (ie: an 'if all else fails' scenario).
78 </para>
80 <para>
81 Lastly, take note that browse lists are a collection of unreliable broadcast
82 messages that are repeated at intervals of not more than 15 minutes. This means
83 that it will take time to establish a browse list and it can take up to 45
84 minutes to stabilise, particularly across network segments.
85 </para>
87 </sect1>
89 <sect1>
90 <title>How browsing functions and how to deploy stable and
91 dependable browsing using Samba</title>
94 <para>
95 As stated above, MS Windows machines register their NetBIOS names
96 (i.e.: the machine name for each service type in operation) on start
97 up. Also, as stated above, the exact method by which this name registration
98 takes place is determined by whether or not the MS Windows client/server
99 has been given a WINS server address, whether or not LMHOSTS lookup
100 is enabled, or if DNS for NetBIOS name resolution is enabled, etc.
101 </para>
103 <para>
104 In the case where there is no WINS server all name registrations as
105 well as name lookups are done by UDP broadcast. This isolates name
106 resolution to the local subnet, unless LMHOSTS is used to list all
107 names and IP addresses. In such situations Samba provides a means by
108 which the samba server name may be forcibly injected into the browse
109 list of a remote MS Windows network (using the
110 <command>remote announce</command> parameter).
111 </para>
113 <para>
114 Where a WINS server is used, the MS Windows client will use UDP
115 unicast to register with the WINS server. Such packets can be routed
116 and thus WINS allows name resolution to function across routed networks.
117 </para>
119 <para>
120 During the startup process an election will take place to create a
121 local master browser if one does not already exist. On each NetBIOS network
122 one machine will be elected to function as the domain master browser. This
123 domain browsing has nothing to do with MS security domain control.
124 Instead, the domain master browser serves the role of contacting each local
125 master browser (found by asking WINS or from LMHOSTS) and exchanging browse
126 list contents. This way every master browser will eventually obtain a complete
127 list of all machines that are on the network. Every 11-15 minutes an election
128 is held to determine which machine will be the master browser. By the nature of
129 the election criteria used, the machine with the highest uptime, or the
130 most senior protocol version, or other criteria, will win the election
131 as domain master browser.
132 </para>
134 <para>
135 Clients wishing to browse the network make use of this list, but also depend
136 on the availability of correct name resolution to the respective IP
137 address/addresses.
138 </para>
140 <para>
141 Any configuration that breaks name resolution and/or browsing intrinsics
142 will annoy users because they will have to put up with protracted
143 inability to use the network services.
144 </para>
146 <para>
147 Samba supports a feature that allows forced synchonisation
148 of browse lists across routed networks using the <command>remote
149 browse sync</command> parameter in the <filename>smb.conf</filename> file.
150 This causes Samba to contact the local master browser on a remote network and
151 to request browse list synchronisation. This effectively bridges
152 two networks that are separated by routers. The two remote
153 networks may use either broadcast based name resolution or WINS
154 based name resolution, but it should be noted that the <command>remote
155 browse sync</command> parameter provides browse list synchronisation - and
156 that is distinct from name to address resolution, in other
157 words, for cross subnet browsing to function correctly it is
158 essential that a name to address resolution mechanism be provided.
159 This mechanism could be via DNS, <filename>/etc/hosts</filename>,
160 and so on.
161 </para>
163 </sect1>
165 <sect1>
166 <title>Use of the <command>Remote Announce</command> parameter</title>
167 <para>
168 The <command>remote announce</command> parameter of
169 <filename>smb.conf</filename> can be used to forcibly ensure
170 that all the NetBIOS names on a network get announced to a remote network.
171 The syntax of the <command>remote announce</command> parameter is:
172 <programlisting>
173 remote announce = <replaceable>a.b.c.d [e.f.g.h]</replaceable> ...
174 </programlisting>
175 _or_
176 <programlisting>
177 remote announce = <replaceable>a.b.c.d/WORKGROUP [e.f.g.h/WORKGROUP]</replaceable> ...
178 </programlisting>
180 where:
181 <variablelist>
182 <varlistentry><term><replaceable>a.b.c.d</replaceable> and
183 <replaceable>e.f.g.h</replaceable></term>
184 <listitem><para>is either the LMB (Local Master Browser) IP address
185 or the broadcst address of the remote network.
186 ie: the LMB is at 192.168.1.10, or the address
187 could be given as 192.168.1.255 where the netmask
188 is assumed to be 24 bits (255.255.255.0).
189 When the remote announcement is made to the broadcast
190 address of the remote network every host will receive
191 our announcements. This is noisy and therefore
192 undesirable but may be necessary if we do NOT know
193 the IP address of the remote LMB.</para></listitem>
194 </varlistentry>
196 <varlistentry>
197 <term><replaceable>WORKGROUP</replaceable></term>
198 <listitem><para>is optional and can be either our own workgroup
199 or that of the remote network. If you use the
200 workgroup name of the remote network then our
201 NetBIOS machine names will end up looking like
202 they belong to that workgroup, this may cause
203 name resolution problems and should be avoided.
204 </para></listitem>
205 </varlistentry>
206 </variablelist>
207 </para>
209 </sect1>
211 <sect1>
212 <title>Use of the <command>Remote Browse Sync</command> parameter</title>
214 <para>
215 The <command>remote browse sync</command> parameter of
216 <filename>smb.conf</filename> is used to announce to
217 another LMB that it must synchronise it's NetBIOS name list with our
218 Samba LMB. It works ONLY if the Samba server that has this option is
219 simultaneously the LMB on it's network segment.
220 </para>
222 <para>
223 The syntax of the <command>remote browse sync</command> parameter is:
225 <programlisting>
226 remote browse sync = <replaceable>a.b.c.d</replaceable>
227 </programlisting>
229 where <replaceable>a.b.c.d</replaceable> is either the IP address of the remote LMB or else is the network broadcast address of the remote segment.
230 </para>
232 </sect1>
234 <sect1>
235 <title>Use of WINS</title>
237 <para>
238 Use of WINS (either Samba WINS _or_ MS Windows NT Server WINS) is highly
239 recommended. Every NetBIOS machine registers it's name together with a
240 name_type value for each of of several types of service it has available.
241 eg: It registers it's name directly as a unique (the type 0x03) name.
242 It also registers it's name if it is running the lanmanager compatible
243 server service (used to make shares and printers available to other users)
244 by registering the server (the type 0x20) name.
245 </para>
247 <para>
248 All NetBIOS names are up to 15 characters in length. The name_type variable
249 is added to the end of the name - thus creating a 16 character name. Any
250 name that is shorter than 15 characters is padded with spaces to the 15th
251 character. ie: All NetBIOS names are 16 characters long (including the
252 name_type information).
253 </para>
255 <para>
256 WINS can store these 16 character names as they get registered. A client
257 that wants to log onto the network can ask the WINS server for a list
258 of all names that have registered the NetLogon service name_type. This saves
259 broadcast traffic and greatly expedites logon processing. Since broadcast
260 name resolution can not be used across network segments this type of
261 information can only be provided via WINS _or_ via statically configured
262 <filename>lmhosts</filename> files that must reside on all clients in the
263 absence of WINS.
264 </para>
266 <para>
267 WINS also serves the purpose of forcing browse list synchronisation by all
268 LMB's. LMB's must synchronise their browse list with the DMB (domain master
269 browser) and WINS helps the LMB to identify it's DMB. By definition this
270 will work only within a single workgroup. Note that the domain master browser
271 has NOTHING to do with what is referred to as an MS Windows NT Domain. The
272 later is a reference to a security environment while the DMB refers to the
273 master controller for browse list information only.
274 </para>
276 <para>
277 Use of WINS will work correctly only if EVERY client TCP/IP protocol stack
278 has been configured to use the WINS server/s. Any client that has not been
279 configured to use the WINS server will continue to use only broadcast based
280 name registration so that WINS may NEVER get to know about it. In any case,
281 machines that have not registered with a WINS server will fail name to address
282 lookup attempts by other clients and will therefore cause workstation access
283 errors.
284 </para>
286 <para>
287 To configure Samba as a WINS server just add
288 <command>wins support = yes</command> to the <filename>smb.conf</filename>
289 file [globals] section.
290 </para>
292 <para>
293 To configure Samba to register with a WINS server just add
294 "wins server = a.b.c.d" to your smb.conf file [globals] section.
295 </para>
297 <important><para>
298 Never use both <command>wins support = yes</command> together
299 with <command>wins server = a.b.c.d</command>
300 particularly not using it's own IP address.
301 Specifying both will cause &nmbd; to refuse to start!
302 </para></important>
304 <sect2>
305 <title>WINS Replication</title>
307 <para>
308 Samba-3 permits WINS replication through the use of the <filename>wrepld</filename> utility.
309 This tool is not currently capable of being used as it is still in active development.
310 As soon as this tool becomes moderately functional we will prepare man pages and enhance this
311 section of the documentation to provide usage and technical details.
312 </para>
314 </sect2>
315 <sect2>
316 <title>Static WINS Entries</title>
318 <para>
319 New to Samba-3 is a tool called <filename>winsedit</filename> that may be used to add
320 static WINS entries to the WINS database. This tool can be used also to modify entries
321 existing in the WINS database.
322 </para>
324 <para>
325 The development of the winsedit tool was made necessary due to the migration
326 of the older style wins.dat file into a new tdb binary backend data store.
327 </para>
329 </sect2>
330 </sect1>
332 <sect1>
333 <title>Do NOT use more than one (1) protocol on MS Windows machines</title>
335 <para>
336 A very common cause of browsing problems results from installing more than
337 one protocol on an MS Windows machine.
338 </para>
340 <para>
341 Every NetBIOS machine takes part in a process of electing the LMB (and DMB)
342 every 15 minutes. A set of election criteria is used to determine the order
343 of precidence for winning this election process. A machine running Samba or
344 Windows NT will be biased so that the most suitable machine will predictably
345 win and thus retain it's role.
346 </para>
348 <para>
349 The election process is "fought out" so to speak over every NetBIOS network
350 interface. In the case of a Windows 9x machine that has both TCP/IP and IPX
351 installed and has NetBIOS enabled over both protocols the election will be
352 decided over both protocols. As often happens, if the Windows 9x machine is
353 the only one with both protocols then the LMB may be won on the NetBIOS
354 interface over the IPX protocol. Samba will then lose the LMB role as Windows
355 9x will insist it knows who the LMB is. Samba will then cease to function
356 as an LMB and thus browse list operation on all TCP/IP only machines will
357 fail.
358 </para>
360 <para><emphasis>
361 Windows 95, 98, 98se, Me are referred to generically as Windows 9x.
362 The Windows NT4, 2000, XP and 2003 use common protocols. These are roughly
363 referred to as the WinNT family, but it should be recognised that 2000 and
364 XP/2003 introduce new protocol extensions that cause them to behave
365 differently from MS Windows NT4. Generally, where a server does NOT support
366 the newer or extended protocol, these will fall back to the NT4 protocols.
367 </emphasis></para>
369 <para>
370 The safest rule of all to follow it this - USE ONLY ONE PROTOCOL!
371 </para>
373 </sect1>
375 <sect1>
376 <title>Name Resolution Order</title>
378 <para>
379 Resolution of NetBIOS names to IP addresses can take place using a number
380 of methods. The only ones that can provide NetBIOS name_type information
381 are:</para>
383 <simplelist>
384 <member>WINS: the best tool!</member>
385 <member>LMHOSTS: is static and hard to maintain.</member>
386 <member>Broadcast: uses UDP and can not resolve names across remote segments.</member>
387 </simplelist>
389 <para>
390 Alternative means of name resolution includes:</para>
391 <simplelist>
392 <member>/etc/hosts: is static, hard to maintain, and lacks name_type info</member>
393 <member>DNS: is a good choice but lacks essential name_type info.</member>
394 </simplelist>
396 <para>
397 Many sites want to restrict DNS lookups and want to avoid broadcast name
398 resolution traffic. The "name resolve order" parameter is of great help here.
399 The syntax of the "name resolve order" parameter is:
400 <programlisting>
401 name resolve order = wins lmhosts bcast host
402 </programlisting>
403 _or_
404 <programlisting>
405 name resolve order = wins lmhosts (eliminates bcast and host)
406 </programlisting>
407 The default is:
408 <programlisting>
409 name resolve order = host lmhost wins bcast
410 </programlisting>.
411 where "host" refers the the native methods used by the Unix system
412 to implement the gethostbyname() function call. This is normally
413 controlled by <filename>/etc/host.conf</filename>, <filename>/etc/nsswitch.conf</filename> and <filename>/etc/resolv.conf</filename>.
414 </para>
415 </sect1>
416 </chapter>