1 | <html>
|
---|
2 | <body bgcolor="#ffffff">
|
---|
3 |
|
---|
4 | <img src="samba2_xs.gif" border="0" alt=" " height="100" width="76"
|
---|
5 | hspace="10" align="left" />
|
---|
6 |
|
---|
7 | <h1 class="head0">Chapter 7. Name Resolution and Browsing</h1>
|
---|
8 |
|
---|
9 |
|
---|
10 |
|
---|
11 |
|
---|
12 | <p><a name="INDEX-1"/><em class="firstterm">Name
|
---|
13 | resolution</em> is critical to Samba's
|
---|
14 | operation because names are used to find the servers that share files
|
---|
15 | or printers. <em class="firstterm">Browsing</em> takes the task of
|
---|
16 | finding servers to a new level of sophistication by allowing a user
|
---|
17 | to delve down into a hierarchy of networks, domains, hosts, and
|
---|
18 | services offered by each server.</p>
|
---|
19 |
|
---|
20 | <p>While name resolution and
|
---|
21 | <a name="INDEX-2"/>browsing are not
|
---|
22 | difficult to configure, some complexity is introduced by the variety
|
---|
23 | of available name-resolution systems. Historically, Unix and other
|
---|
24 | TCP/IP users have moved from a flat hosts file to the Domain Name
|
---|
25 | System, with the Network Information System being another popular
|
---|
26 | choice. Meanwhile, Microsoft has moved from a broadcasting system to
|
---|
27 | a simple, LAN-only name server called WINS and ultimately to DNS.</p>
|
---|
28 |
|
---|
29 | <p>The reason for going over that history is that all previous systems
|
---|
30 | of name resolution are still in use today! Finding a host is so
|
---|
31 | crucial to networking that sites want robust (if limited)
|
---|
32 | name-resolution systems to fall back on in case the main system
|
---|
33 | fails. Browsing is also complicated by the frequent need to show
|
---|
34 | hosts in other subnets. This chapter shows you how to configure your
|
---|
35 | network to handle name resolution and browsing any way you want.</p>
|
---|
36 |
|
---|
37 | <p>Some of the differences between Unix and Microsoft networking
|
---|
38 | implementations are the result of fundamental design goals. Unix
|
---|
39 | networking was originally designed largely to implement a relatively
|
---|
40 | formal group of systems that were assumed to be small in number,
|
---|
41 | well-maintained, and highly available, that have static IP addresses,
|
---|
42 | and that wouldn't physically move around from place
|
---|
43 | to place. Bringing a new server online was a labor-intensive task,
|
---|
44 | but it did not have to be performed frequently. In contrast, Windows
|
---|
45 | networking was originally developed as a peer-to-peer collection of
|
---|
46 | small personal computers on a single subnet, having no centrally or
|
---|
47 | hierarchically organized structure.</p>
|
---|
48 |
|
---|
49 | <p>SMB networking is dynamic. Computers are allowed to leave the network
|
---|
50 | at any time, sometimes without warning, and also to join or rejoin
|
---|
51 | the network at any time. Furthermore, any user in a Windows network
|
---|
52 | can add a new shared resource to the network or remove a resource
|
---|
53 | that he had previously added. The change in the
|
---|
54 | network's configuration is handled automatically by
|
---|
55 | the rest of the network without requiring a system administrator to
|
---|
56 | take any action.</p>
|
---|
57 |
|
---|
58 |
|
---|
59 |
|
---|
60 | <div class="sect1"><a name="samba2-CHP-7-SECT-1"/>
|
---|
61 |
|
---|
62 | <h2 class="head1">Name Resolution</h2>
|
---|
63 |
|
---|
64 | <p>TCP/IP networks identify systems by IP addresses and always associate
|
---|
65 | these addresses with more human-readable text names. In
|
---|
66 | Microsoft's earliest networking implementations (for
|
---|
67 | MS-DOS and Windows for Workgroups), the translation of names to
|
---|
68 | network addresses was carried out in a manner that was very simple,
|
---|
69 | yet very inefficient. When a system on the network needed an IP
|
---|
70 | address corresponding to a name, it broadcasted the name to every
|
---|
71 | other system on the network and waited for the system that owned the
|
---|
72 | name to respond with its IP address.</p>
|
---|
73 |
|
---|
74 | <p>The main problem with performing <a name="INDEX-3"/>name resolution using broadcast
|
---|
75 | packets is poor performance of the network as a whole, including CPU
|
---|
76 | time consumed by each host on the network, which has to accept every
|
---|
77 | broadcast packet and decide whether to respond to it. Also, broadcast
|
---|
78 | packets usually aren't forwarded by routers,
|
---|
79 | limiting name resolution to the local subnet.
|
---|
80 | Microsoft's solution was to add WINS (Windows
|
---|
81 | Internet Name Service) support to Windows NT so that the computers on
|
---|
82 | the network can perform a direct query of the WINS server instead of
|
---|
83 | using broadcast packets.</p>
|
---|
84 |
|
---|
85 | <p>Modern Windows clients use a variety of methods for translating
|
---|
86 | hostnames into IP addresses. The exact method varies depending on the
|
---|
87 | version of Windows the client is running, how the client is
|
---|
88 | configured (i.e., whether DNS server and/or WINS server IP addresses
|
---|
89 | are provided), and whether the application software is accessing the
|
---|
90 | network through Microsoft's Winsock or TCP/IP API.
|
---|
91 | In general, Windows uses some combination of the following
|
---|
92 | methods:<a name="INDEX-4"/></p>
|
---|
93 |
|
---|
94 | <ul><li>
|
---|
95 | <p>Looking up the name in its cache of recently resolved names</p>
|
---|
96 | </li><li>
|
---|
97 | <p>Querying DNS servers</p>
|
---|
98 | </li><li>
|
---|
99 | <p>Using the DNS <em class="filename">Hosts</em> file</p>
|
---|
100 | </li><li>
|
---|
101 | <p>Querying WINS servers</p>
|
---|
102 | </li><li>
|
---|
103 | <p>Using the WINS <em class="filename">LMHOSTS</em> file</p>
|
---|
104 | </li><li>
|
---|
105 | <p>Performing broadcast name resolution</p>
|
---|
106 | </li></ul>
|
---|
107 | <p>The first method is pretty much self-explanatory. A hostname is
|
---|
108 | checked against a cache of hostnames that have been recently resolved
|
---|
109 | to IP addresses. This helps to save time and network bandwidth for
|
---|
110 | resolving names that are used frequently.</p>
|
---|
111 |
|
---|
112 | <p>When a Windows system is configured with the IP address of at least
|
---|
113 | one <a name="INDEX-5"/>DNS server, it can use DNS to
|
---|
114 | resolve fully qualified domain names, such as those for sites on the
|
---|
115 | Internet. The DNS servers can be either Windows NT/2000 or Unix
|
---|
116 | systems. You can learn more about DNS and DNS server configuration in
|
---|
117 | the O'Reilly book <em class="citetitle">DNS and
|
---|
118 | BIND</em>.</p>
|
---|
119 |
|
---|
120 | <p>In this chapter, we focus mainly on name resolution using WINS, which
|
---|
121 | is supported by Samba with the <em class="emphasis">nmbd</em> daemon.</p>
|
---|
122 |
|
---|
123 |
|
---|
124 | <div class="sect2"><a name="samba2-CHP-7-SECT-1.1"/>
|
---|
125 |
|
---|
126 | <h3 class="head2">WINS Clients and Server Interaction</h3>
|
---|
127 |
|
---|
128 | <p>There are two types of interaction between a
|
---|
129 | <a name="INDEX-6"/>WINS client and a server: the
|
---|
130 | client keeps its own NetBIOS name<a name="FNPTR-1"/><a href="#FOOTNOTE-1">[1]</a> registered with the server and
|
---|
131 | queries the server to get the IP address corresponding to the NetBIOS
|
---|
132 | name of another system.</p>
|
---|
133 |
|
---|
134 | <p>When a WINS client joins the network, it registers its NetBIOS name
|
---|
135 | with the WINS server, which stores it along with the
|
---|
136 | client's IP address in the WINS database. This entry
|
---|
137 | is marked <em class="firstterm">active</em>. The client is then expected
|
---|
138 | to renew the registration of its name periodically (typically, every
|
---|
139 | four days) to inform the server that it is still using the name. This
|
---|
140 | period is called the <em class="firstterm">time to live</em>, or TTL.
|
---|
141 | When the client leaves the network by being shut down gracefully, it
|
---|
142 | informs the server, and the server marks the
|
---|
143 | client's entry in its database as
|
---|
144 | <em class="firstterm">released</em>.</p>
|
---|
145 |
|
---|
146 | <p>When a client leaves the network without telling the WINS server to
|
---|
147 | release its name, the server waits until after it fails to receive
|
---|
148 | the expected registration renewal from the client and then marks the
|
---|
149 | entry as released.</p>
|
---|
150 |
|
---|
151 | <p>In either case, the released name is available for use by other
|
---|
152 | clients joining the network. It might persist in the released state
|
---|
153 | in the WINS database, and if it is not reregistered, the entry will
|
---|
154 | eventually be deleted.</p>
|
---|
155 |
|
---|
156 | <p>More information on WINS can be found in the Microsoft white paper
|
---|
157 | <em class="citetitle">Windows Internet Naming Service (WINS) Architecture and
|
---|
158 | Capacity Planning</em><a name="INDEX-7"/>. It can be downloaded from the
|
---|
159 | Microsoft web site at <a href="http://www.microsoft.com">http://www.microsoft.com</a>.</p>
|
---|
160 |
|
---|
161 |
|
---|
162 | </div>
|
---|
163 |
|
---|
164 |
|
---|
165 | <div class="sect2"><a name="samba2-CHP-7-SECT-1.2"/>
|
---|
166 |
|
---|
167 | <h3 class="head2">The lmhosts File</h3>
|
---|
168 |
|
---|
169 | <p>In <a href="ch03.html">Chapter 3</a> we showed you how to configure
|
---|
170 | Windows systems to use the
|
---|
171 | <em class="filename">LMHOSTS</em><a name="INDEX-8"/>
|
---|
172 | file as an alternative to the WINS server for name resolution. Samba
|
---|
173 | also can use an <em class="filename">LMHOSTS</em> file, which by default
|
---|
174 | is <em class="filename">/usr/local/samba/lib/lmhosts</em>.
|
---|
175 | Samba's <em class="filename">lmhosts</em> is the same
|
---|
176 | format as the Windows version. A simple <em class="filename">lmhosts</em>
|
---|
177 | file might look like this:</p>
|
---|
178 |
|
---|
179 | <blockquote><pre class="code">172.16.1.1 toltec
|
---|
180 | 172.16.1.6 maya</pre></blockquote>
|
---|
181 |
|
---|
182 | <p>The names on the right side of the entries are NetBIOS names, so you
|
---|
183 | can assign resource types to them and add additional entries for
|
---|
184 | computers:</p>
|
---|
185 |
|
---|
186 | <blockquote><pre class="code">172.16.1.1 toltec#20
|
---|
187 | 172.16.1.1 metran#1b
|
---|
188 | 172.16.1.6 maya#20</pre></blockquote>
|
---|
189 |
|
---|
190 | <p>Here, we've made <tt class="literal">toltec</tt> the
|
---|
191 | primary domain controller of the <tt class="literal">METRAN</tt> domain on
|
---|
192 | the second line. This line starts with
|
---|
193 | <tt class="literal">toltec</tt>'s IP address, followed by
|
---|
194 | the name metran and the resource type <1B>. The other lines are
|
---|
195 | entries for <tt class="literal">toltec</tt> and <tt class="literal">maya</tt> as
|
---|
196 | standard workstations.</p>
|
---|
197 |
|
---|
198 | <p>If you wish to place an <em class="emphasis">lmhosts</em> file somewhere
|
---|
199 | other than the default location, you will need to notify the
|
---|
200 | <em class="emphasis">nmbd</em> process upon startup using the
|
---|
201 | <em class="emphasis">-H</em> option, followed by the name of your
|
---|
202 | <em class="filename">lmhosts</em> file, as follows:</p>
|
---|
203 |
|
---|
204 | <blockquote><pre class="code"># <tt class="userinput"><b>nmbd -H /etc/samba/lmhosts -D</b></tt></pre></blockquote>
|
---|
205 |
|
---|
206 |
|
---|
207 | </div>
|
---|
208 |
|
---|
209 |
|
---|
210 | <div class="sect2"><a name="samba2-CHP-7-SECT-1.3"/>
|
---|
211 |
|
---|
212 | <h3 class="head2">Configuring Name Resolution for the Samba Suite</h3>
|
---|
213 |
|
---|
214 | <p>Various daemons and tools in the Samba suite need to perform
|
---|
215 | <a name="INDEX-9"/>name resolution. You can define the
|
---|
216 | order in which the programs try each name-resolution method through
|
---|
217 | the <tt class="literal">name</tt><a name="INDEX-10"/><a name="INDEX-11"/>
|
---|
218 | <tt class="literal">resolve</tt> <tt class="literal">order</tt> parameter, like
|
---|
219 | this:</p>
|
---|
220 |
|
---|
221 | <blockquote><pre class="code">[global]
|
---|
222 | name resolve order = wins lmhosts hosts bcast</pre></blockquote>
|
---|
223 |
|
---|
224 | <p>The string used to define the parameter can take up to four values:</p>
|
---|
225 |
|
---|
226 | <dl>
|
---|
227 | <dt><b>lmhosts</b></dt>
|
---|
228 | <dd>
|
---|
229 | <p>Uses the Samba server's local
|
---|
230 | <em class="filename">lmhosts</em> file</p>
|
---|
231 | </dd>
|
---|
232 |
|
---|
233 |
|
---|
234 |
|
---|
235 | <dt><b>hosts</b></dt>
|
---|
236 | <dd>
|
---|
237 | <p>Uses the standard Unix name-resolution methods, which can be
|
---|
238 | <em class="emphasis">/etc/hosts</em>, DNS, NIS, or a combination,
|
---|
239 | depending on how the local system is configured</p>
|
---|
240 | </dd>
|
---|
241 |
|
---|
242 |
|
---|
243 |
|
---|
244 | <dt><b>wins</b></dt>
|
---|
245 | <dd>
|
---|
246 | <p>Uses the WINS server</p>
|
---|
247 | </dd>
|
---|
248 |
|
---|
249 |
|
---|
250 |
|
---|
251 | <dt><b>bcast</b></dt>
|
---|
252 | <dd>
|
---|
253 | <p>Uses the broadcast method</p>
|
---|
254 | </dd>
|
---|
255 |
|
---|
256 | </dl>
|
---|
257 |
|
---|
258 | <p>The order in which they are specified is the order in which name
|
---|
259 | resolution will be attempted. In our example, Samba will attempt to
|
---|
260 | use its WINS server first for name resolution, followed by the
|
---|
261 | <em class="emphasis">lmhosts</em> file on the local system. Next, the
|
---|
262 | <tt class="literal">hosts</tt> value tells it to use Unix name-resolution
|
---|
263 | methods. The word <tt class="literal">hosts</tt> can be misleading; it
|
---|
264 | covers not only the <em class="filename">/etc/hosts</em> file, but also
|
---|
265 | the use of DNS or NIS (as configured on the Unix host). Finally, if
|
---|
266 | those three do not work, it will perform a broadcast name resolution.</p>
|
---|
267 |
|
---|
268 |
|
---|
269 | </div>
|
---|
270 |
|
---|
271 |
|
---|
272 | <div class="sect2"><a name="samba2-CHP-7-SECT-1.4"/>
|
---|
273 |
|
---|
274 | <h3 class="head2">Setting Up Samba as a WINS Server</h3>
|
---|
275 |
|
---|
276 | <p>You can set up Samba as a <a name="INDEX-12"/>WINS server by setting the
|
---|
277 | <tt class="literal">wins</tt><a name="INDEX-13"/> <tt class="literal">support</tt>
|
---|
278 | parameter in the configuration file, like this:</p>
|
---|
279 |
|
---|
280 | <blockquote><pre class="code">[global]
|
---|
281 | wins support = yes</pre></blockquote>
|
---|
282 |
|
---|
283 | <p>Believe it or not, that's all you need to do! The
|
---|
284 | <tt class="literal">wins</tt> <tt class="literal">support</tt> option turns Samba
|
---|
285 | into a WINS server. For most installations, Samba's
|
---|
286 | default configuration is sufficient.</p>
|
---|
287 | <a name="samba2-CHP-7-NOTE-137"/><blockquote class="note"><h4 class="objtitle">WARNING</h4>
|
---|
288 | <p>Remember, Samba cannot communicate with Windows WINS servers. If you
|
---|
289 | are using Samba as your WINS server, you must make sure not to allow
|
---|
290 | any Windows systems or other Samba servers on your network to be
|
---|
291 | configured as WINS servers. If you do, their WINS databases will not
|
---|
292 | synchronize, resulting in inconsistent name resolution.</p>
|
---|
293 | </blockquote>
|
---|
294 |
|
---|
295 |
|
---|
296 | <div class="sect3"><a name="samba2-CHP-7-SECT-1.4.1"/>
|
---|
297 |
|
---|
298 | <h3 class="head3">Configuring a DNS proxy</h3>
|
---|
299 |
|
---|
300 | <p>A Samba <a name="INDEX-14"/><a name="INDEX-15"/>WINS server can check with the
|
---|
301 | system's DNS server if a requested host cannot be
|
---|
302 | found in its WINS database. With a typical Linux system, for example,
|
---|
303 | you can find the IP address of the DNS server by searching the
|
---|
304 | <em class="filename">/etc/resolv.conf</em><a name="INDEX-16"/><a name="INDEX-17"/> file. In it, you might see an entry such
|
---|
305 | as the following:</p>
|
---|
306 |
|
---|
307 | <blockquote><pre class="code">nameserver 127.0.0.1
|
---|
308 | nameserver 172.16.1.192</pre></blockquote>
|
---|
309 |
|
---|
310 | <p>This tells us that the Linux system is configured to use a DNS server
|
---|
311 | located at 172.16.1.192. (The 127.0.0.1 is the
|
---|
312 | <tt class="literal">localhost</tt> address and is never a valid DNS server
|
---|
313 | address.)</p>
|
---|
314 |
|
---|
315 | <p>Now it is a simple matter of using the
|
---|
316 | <tt class="literal">dns</tt><a name="INDEX-18"/> <tt class="literal">proxy</tt> option to tell
|
---|
317 | Samba to use the DNS server:</p>
|
---|
318 |
|
---|
319 | <blockquote><pre class="code">[global]
|
---|
320 | dns proxy = yes</pre></blockquote>
|
---|
321 |
|
---|
322 | <a name="samba2-CHP-7-NOTE-138"/><blockquote class="note"><h4 class="objtitle">TIP</h4>
|
---|
323 | <p>Although this allows Windows clients to resolve fully qualified
|
---|
324 | Internet domain names through the Samba WINS server, it will work
|
---|
325 | only for domain names that fit within the 15-character limitation of
|
---|
326 | NetBIOS names. For this reason, we recommend you use <tt class="literal">dns
|
---|
327 | proxy</tt> only to act as a supplement to your WINS server,
|
---|
328 | rather than as a replacement for a DNS server.</p>
|
---|
329 | </blockquote>
|
---|
330 |
|
---|
331 |
|
---|
332 | </div>
|
---|
333 |
|
---|
334 |
|
---|
335 | </div>
|
---|
336 |
|
---|
337 |
|
---|
338 | <div class="sect2"><a name="samba2-CHP-7-SECT-1.5"/>
|
---|
339 |
|
---|
340 | <h3 class="head2">Setting Up Samba to Use Another WINS Server</h3>
|
---|
341 |
|
---|
342 | <p>You can configure Samba to use a <a name="INDEX-19"/>WINS server somewhere else on the
|
---|
343 | network by simply providing it with the IP address of the WINS
|
---|
344 | server. This is done with the global
|
---|
345 | <tt class="literal">wins</tt><a name="INDEX-20"/> <tt class="literal">server</tt>
|
---|
346 | configuration option, as shown here:</p>
|
---|
347 |
|
---|
348 | <blockquote><pre class="code">[global]
|
---|
349 | wins server = 172.16.1.1</pre></blockquote>
|
---|
350 |
|
---|
351 | <p>With this option enabled, Samba will direct all WINS requests to the
|
---|
352 | server located at 172.16.1.1. Note that because the request is
|
---|
353 | directed at a single machine, we don't have to worry
|
---|
354 | about any of the problems inherent in broadcasting. However, Samba
|
---|
355 | will not necessarily use the WINS server before other forms of name
|
---|
356 | resolution. The order in which Samba attempts various name-resolution
|
---|
357 | techniques is given with the <tt class="literal">name</tt>
|
---|
358 | <tt class="literal">resolve</tt> <tt class="literal">order</tt> configuration
|
---|
359 | option, which we discussed earlier.</p>
|
---|
360 |
|
---|
361 | <p>The <tt class="literal">wins</tt> <tt class="literal">support</tt> and the
|
---|
362 | <tt class="literal">wins</tt> <tt class="literal">server</tt> parameters are
|
---|
363 | mutually exclusive; you cannot simultaneously offer Samba as the WINS
|
---|
364 | server and use another system as the server! Typically, one Samba
|
---|
365 | server is set up as the WINS server using <tt class="literal">wins</tt>
|
---|
366 | <tt class="literal">support</tt>, and all other Samba servers are
|
---|
367 | configured with the <tt class="literal">wins</tt> <tt class="literal">server</tt>
|
---|
368 | parameter pointing to the Samba WINS server.</p>
|
---|
369 |
|
---|
370 |
|
---|
371 | <div class="sect3"><a name="samba2-CHP-7-SECT-1.5.1"/>
|
---|
372 |
|
---|
373 | <h3 class="head3">Configuring a WINS proxy</h3>
|
---|
374 |
|
---|
375 | <p><a name="INDEX-21"/>If you have a Samba server on a
|
---|
376 | subnet that doesn't have a WINS server, and the
|
---|
377 | Samba server has been configured with a WINS server on another
|
---|
378 | subnet, you can tell the Samba server to forward any name-resolution
|
---|
379 | requests with the <tt class="literal">wins</tt><a name="INDEX-22"/>
|
---|
380 | <tt class="literal">proxy</tt> option:</p>
|
---|
381 |
|
---|
382 | <blockquote><pre class="code">[global]
|
---|
383 | wins server = 172.16.200.12
|
---|
384 | wins proxy = yes</pre></blockquote>
|
---|
385 |
|
---|
386 | <p>Use this only in situations where the WINS server resides on another
|
---|
387 | subnet. Otherwise, the broadcast will reach the WINS server
|
---|
388 | regardless of any proxying.</p>
|
---|
389 |
|
---|
390 |
|
---|
391 | </div>
|
---|
392 |
|
---|
393 |
|
---|
394 | </div>
|
---|
395 |
|
---|
396 |
|
---|
397 | <div class="sect2"><a name="samba2-CHP-7-SECT-1.6"/>
|
---|
398 |
|
---|
399 | <h3 class="head2">Name-Resolution Configuration Options</h3>
|
---|
400 |
|
---|
401 | <p><a name="INDEX-23"/>Samba's <a name="INDEX-24"/>name-resolution options
|
---|
402 | are shown in <a href="ch07.html#samba2-CHP-7-TABLE-1">Table 7-1</a>.</p>
|
---|
403 |
|
---|
404 | <a name="samba2-CHP-7-TABLE-1"/><h4 class="head4">Table 7-1. Name-resolution options</h4><table border="1">
|
---|
405 |
|
---|
406 |
|
---|
407 |
|
---|
408 |
|
---|
409 |
|
---|
410 |
|
---|
411 | <tr>
|
---|
412 | <th>
|
---|
413 | <p>Option</p>
|
---|
414 | </th>
|
---|
415 | <th>
|
---|
416 | <p>Parameters</p>
|
---|
417 | </th>
|
---|
418 | <th>
|
---|
419 | <p>Function</p>
|
---|
420 | </th>
|
---|
421 | <th>
|
---|
422 | <p>Default</p>
|
---|
423 | </th>
|
---|
424 | <th>
|
---|
425 | <p>Scope</p>
|
---|
426 | </th>
|
---|
427 | </tr>
|
---|
428 |
|
---|
429 |
|
---|
430 | <tr>
|
---|
431 | <td>
|
---|
432 | <p><tt class="literal">wins support</tt></p>
|
---|
433 | </td>
|
---|
434 | <td>
|
---|
435 | <p>boolean</p>
|
---|
436 | </td>
|
---|
437 | <td>
|
---|
438 | <p>If set to <tt class="literal">yes</tt>, allows Samba to act as a WINS server</p>
|
---|
439 | </td>
|
---|
440 | <td>
|
---|
441 | <p><tt class="literal">no</tt></p>
|
---|
442 | </td>
|
---|
443 | <td>
|
---|
444 | <p>Global</p>
|
---|
445 | </td>
|
---|
446 | </tr>
|
---|
447 | <tr>
|
---|
448 | <td>
|
---|
449 | <p><tt class="literal">wins server</tt></p>
|
---|
450 | </td>
|
---|
451 | <td>
|
---|
452 | <p>string (IP address or DNS name)</p>
|
---|
453 | </td>
|
---|
454 | <td>
|
---|
455 | <p>Identifies a WINS server for Samba to use for name registration and
|
---|
456 | resolution</p>
|
---|
457 | </td>
|
---|
458 | <td>
|
---|
459 | <p>None</p>
|
---|
460 | </td>
|
---|
461 | <td>
|
---|
462 | <p>Global</p>
|
---|
463 | </td>
|
---|
464 | </tr>
|
---|
465 | <tr>
|
---|
466 | <td>
|
---|
467 | <p><tt class="literal">wins proxy</tt></p>
|
---|
468 | </td>
|
---|
469 | <td>
|
---|
470 | <p>boolean</p>
|
---|
471 | </td>
|
---|
472 | <td>
|
---|
473 | <p>Allows Samba to act as a proxy to a WINS server on another subnet</p>
|
---|
474 | </td>
|
---|
475 | <td>
|
---|
476 | <p><tt class="literal">no</tt></p>
|
---|
477 | </td>
|
---|
478 | <td>
|
---|
479 | <p>Global</p>
|
---|
480 | </td>
|
---|
481 | </tr>
|
---|
482 | <tr>
|
---|
483 | <td>
|
---|
484 | <p><tt class="literal">wins hook</tt></p>
|
---|
485 | </td>
|
---|
486 | <td>
|
---|
487 | <p>string</p>
|
---|
488 | </td>
|
---|
489 | <td>
|
---|
490 | <p>Command to run when the WINS database changes</p>
|
---|
491 | </td>
|
---|
492 | <td>
|
---|
493 | <p>None</p>
|
---|
494 | </td>
|
---|
495 | <td>
|
---|
496 | <p>Global</p>
|
---|
497 | </td>
|
---|
498 | </tr>
|
---|
499 | <tr>
|
---|
500 | <td>
|
---|
501 | <p><tt class="literal">dns proxy</tt></p>
|
---|
502 | </td>
|
---|
503 | <td>
|
---|
504 | <p>boolean</p>
|
---|
505 | </td>
|
---|
506 | <td>
|
---|
507 | <p>If set to <tt class="literal">yes</tt>, allows a Samba WINS server to
|
---|
508 | search DNS if it cannot find a name in WINS</p>
|
---|
509 | </td>
|
---|
510 | <td>
|
---|
511 | <p><tt class="literal">no</tt></p>
|
---|
512 | </td>
|
---|
513 | <td>
|
---|
514 | <p>Global</p>
|
---|
515 | </td>
|
---|
516 | </tr>
|
---|
517 | <tr>
|
---|
518 | <td>
|
---|
519 | <p><tt class="literal">name resolve</tt> <tt class="literal">order</tt></p>
|
---|
520 | </td>
|
---|
521 | <td>
|
---|
522 | <p>string</p>
|
---|
523 | </td>
|
---|
524 | <td>
|
---|
525 | <p>The order of methods used to resolve NetBIOS names</p>
|
---|
526 | </td>
|
---|
527 | <td>
|
---|
528 | <p><tt class="literal">lmhosts</tt> <tt class="literal">hosts wins bcast</tt></p>
|
---|
529 | </td>
|
---|
530 | <td>
|
---|
531 | <p>Global</p>
|
---|
532 | </td>
|
---|
533 | </tr>
|
---|
534 | <tr>
|
---|
535 | <td>
|
---|
536 | <p><tt class="literal">max ttl</tt></p>
|
---|
537 | </td>
|
---|
538 | <td>
|
---|
539 | <p>numeric</p>
|
---|
540 | </td>
|
---|
541 | <td>
|
---|
542 | <p>Maximum TTL in seconds for a requested NetBIOS name</p>
|
---|
543 | </td>
|
---|
544 | <td>
|
---|
545 | <p><tt class="literal">259200</tt> ( 3 days)</p>
|
---|
546 | </td>
|
---|
547 | <td>
|
---|
548 | <p>Global</p>
|
---|
549 | </td>
|
---|
550 | </tr>
|
---|
551 | <tr>
|
---|
552 | <td>
|
---|
553 | <p><tt class="literal">max wins ttl</tt></p>
|
---|
554 | </td>
|
---|
555 | <td>
|
---|
556 | <p>numeric</p>
|
---|
557 | </td>
|
---|
558 | <td>
|
---|
559 | <p>Maximum TTL in seconds for NetBIOS names given out by Samba as a WINS
|
---|
560 | server</p>
|
---|
561 | </td>
|
---|
562 | <td>
|
---|
563 | <p><tt class="literal">518400</tt> (6 days)</p>
|
---|
564 | </td>
|
---|
565 | <td>
|
---|
566 | <p>Global</p>
|
---|
567 | </td>
|
---|
568 | </tr>
|
---|
569 | <tr>
|
---|
570 | <td>
|
---|
571 | <p><tt class="literal">min wins ttl</tt></p>
|
---|
572 | </td>
|
---|
573 | <td>
|
---|
574 | <p>numeric</p>
|
---|
575 | </td>
|
---|
576 | <td>
|
---|
577 | <p>Minimum TTL in seconds for NetBIOS names given out by Samba as a WINS
|
---|
578 | server</p>
|
---|
579 | </td>
|
---|
580 | <td>
|
---|
581 | <p><tt class="literal">21600</tt> (6 hours)</p>
|
---|
582 | </td>
|
---|
583 | <td>
|
---|
584 | <p>Global</p>
|
---|
585 | </td>
|
---|
586 | </tr>
|
---|
587 |
|
---|
588 | </table>
|
---|
589 |
|
---|
590 |
|
---|
591 | <div class="sect3"><a name="samba2-CHP-7-SECT-1.6.1"/>
|
---|
592 |
|
---|
593 | <a name="INDEX-25"/><h3 class="head3">wins support</h3>
|
---|
594 |
|
---|
595 | <p>Samba will provide WINS name service to all machines in the network
|
---|
596 | if you set the following in the <tt class="literal">[global]</tt> section
|
---|
597 | of the <em class="filename">smb.conf</em> file:</p>
|
---|
598 |
|
---|
599 | <blockquote><pre class="code">[global]
|
---|
600 | wins support = yes</pre></blockquote>
|
---|
601 |
|
---|
602 | <p>The default value is <tt class="literal">no</tt>, which is typically used
|
---|
603 | to allow a Windows NT/2000 server or another Samba server to be the
|
---|
604 | WINS server. If you enable this option, remember that a Samba WINS
|
---|
605 | server currently cannot exchange data with other WINS servers, so do
|
---|
606 | not allow any other WINS servers on the network. When set to
|
---|
607 | <tt class="literal">yes</tt>, this option is mutually exclusive with the
|
---|
608 | <tt class="literal">wins</tt> <tt class="literal">server</tt> parameter.</p>
|
---|
609 |
|
---|
610 |
|
---|
611 | </div>
|
---|
612 |
|
---|
613 |
|
---|
614 |
|
---|
615 | <div class="sect3"><a name="samba2-CHP-7-SECT-1.6.2"/>
|
---|
616 |
|
---|
617 | <a name="INDEX-26"/><h3 class="head3">wins server</h3>
|
---|
618 |
|
---|
619 | <p>Samba will use an existing WINS server on the network if you specify
|
---|
620 | the <tt class="literal">wins</tt> <tt class="literal">server</tt> global option
|
---|
621 | in your configuration file. The value of this option is either the IP
|
---|
622 | address or DNS name (not NetBIOS name) of the WINS server. For
|
---|
623 | example:</p>
|
---|
624 |
|
---|
625 | <blockquote><pre class="code">[global]
|
---|
626 | wins server = 172.16.220.110</pre></blockquote>
|
---|
627 |
|
---|
628 | <p>or:</p>
|
---|
629 |
|
---|
630 | <blockquote><pre class="code">[global]
|
---|
631 | wins server = wins.metran.cx</pre></blockquote>
|
---|
632 |
|
---|
633 | <p>For this option to work, the <tt class="literal">wins</tt>
|
---|
634 | <tt class="literal">support</tt> option must be set to
|
---|
635 | <tt class="literal">no</tt> (the default). Otherwise, Samba will report an
|
---|
636 | error. You can specify only one WINS server using this option.</p>
|
---|
637 |
|
---|
638 |
|
---|
639 | </div>
|
---|
640 |
|
---|
641 |
|
---|
642 |
|
---|
643 | <div class="sect3"><a name="samba2-CHP-7-SECT-1.6.3"/>
|
---|
644 |
|
---|
645 | <a name="INDEX-27"/><h3 class="head3">wins proxy</h3>
|
---|
646 |
|
---|
647 | <p>This option allows Samba to act as a proxy to another WINS server,
|
---|
648 | and thus relay name registration and resolution requests from itself
|
---|
649 | to the real WINS server, often outside the current subnet. The WINS
|
---|
650 | server can be indicated through the <tt class="literal">wins</tt>
|
---|
651 | <tt class="literal">server</tt> option. The proxy will then return the WINS
|
---|
652 | response back to the client. You can enable this option by specifying
|
---|
653 | the following in the <tt class="literal">[global]</tt> section:</p>
|
---|
654 |
|
---|
655 | <blockquote><pre class="code">[global]
|
---|
656 | wins proxy = yes</pre></blockquote>
|
---|
657 |
|
---|
658 |
|
---|
659 | </div>
|
---|
660 |
|
---|
661 |
|
---|
662 |
|
---|
663 | <div class="sect3"><a name="samba2-CHP-7-SECT-1.6.4"/>
|
---|
664 |
|
---|
665 | <a name="INDEX-28"/><h3 class="head3">wins hook</h3>
|
---|
666 |
|
---|
667 | <p>This option allows you to run a script or other program whenever the
|
---|
668 | WINS database is modified. One application might be to set up another
|
---|
669 | Samba server to act as a backup for another Samba WINS server. This
|
---|
670 | is done by having the <tt class="literal">wins</tt> <tt class="literal">hook</tt>
|
---|
671 | script call <em class="emphasis">rsync</em> to synchronize the WINS
|
---|
672 | databases (<em class="filename">/usr/local/samba/var/locks/wins.dat</em>)
|
---|
673 | on the two systems whenever an entry is added or deleted. The script
|
---|
674 | would be specified in the Samba configuration file like this:</p>
|
---|
675 |
|
---|
676 | <blockquote><pre class="code">[global]
|
---|
677 | wins hook = /usr/local/bin/sync_wins</pre></blockquote>
|
---|
678 |
|
---|
679 |
|
---|
680 | </div>
|
---|
681 |
|
---|
682 |
|
---|
683 |
|
---|
684 | <div class="sect3"><a name="samba2-CHP-7-SECT-1.6.5"/>
|
---|
685 |
|
---|
686 | <a name="INDEX-29"/><h3 class="head3">dns proxy</h3>
|
---|
687 |
|
---|
688 | <p>If you want the DNS to be used if a NetBIOS name
|
---|
689 | isn't found in WINS, you can set the following
|
---|
690 | option:</p>
|
---|
691 |
|
---|
692 | <blockquote><pre class="code">[global]
|
---|
693 | dns proxy = yes</pre></blockquote>
|
---|
694 |
|
---|
695 | <p>This will permit <em class="filename">nmbd</em> to query the
|
---|
696 | server's standard DNS. You might wish to deactivate
|
---|
697 | this option if you do not have a permanent connection to your DNS
|
---|
698 | server. This option should not be used in place of a DNS server on
|
---|
699 | your network; it is intended for resolving NetBIOS names rather than
|
---|
700 | fully qualified Internet domain names.</p>
|
---|
701 |
|
---|
702 |
|
---|
703 | </div>
|
---|
704 |
|
---|
705 |
|
---|
706 |
|
---|
707 | <div class="sect3"><a name="samba2-CHP-7-SECT-1.6.6"/>
|
---|
708 |
|
---|
709 | <h3 class="head3">name resolve order</h3>
|
---|
710 |
|
---|
711 | <p>The global <tt class="literal">name</tt><a name="INDEX-30"/>
|
---|
712 | <tt class="literal">resolve</tt> <tt class="literal">order</tt> option specifies
|
---|
713 | the order of services that Samba will use in performing name
|
---|
714 | resolution. The default order is to use the
|
---|
715 | <em class="emphasis">lmhosts</em> file, followed by standard Unix
|
---|
716 | name-resolution methods (some combination of
|
---|
717 | <em class="filename">/etc/hosts</em>, DNS, and NIS), then to query a WINS
|
---|
718 | server, and finally to use broadcasting to determine the address of a
|
---|
719 | NetBIOS name. You can override this option by specifying something
|
---|
720 | like the following:</p>
|
---|
721 |
|
---|
722 | <blockquote><pre class="code">[global]
|
---|
723 | name resolve order = lmhosts wins hosts bcast</pre></blockquote>
|
---|
724 |
|
---|
725 | <p>This causes resolution to use the <em class="emphasis">lmhosts</em> file
|
---|
726 | first, followed by a query to a WINS server, the
|
---|
727 | <em class="filename">/etc/hosts</em> file, and finally broadcasting. You
|
---|
728 | need not use all four options. This option is covered in more detail
|
---|
729 | in <a href="ch07.html#samba2-CHP-7-SECT-1.4">Section 7.1.4</a>,
|
---|
730 | earlier in this chapter.</p>
|
---|
731 |
|
---|
732 |
|
---|
733 | </div>
|
---|
734 |
|
---|
735 |
|
---|
736 |
|
---|
737 | <div class="sect3"><a name="samba2-CHP-7-SECT-1.6.7"/>
|
---|
738 |
|
---|
739 | <a name="INDEX-31"/><h3 class="head3">max ttl</h3>
|
---|
740 |
|
---|
741 | <p>This option is used when Samba is not acting as a WINS server but is
|
---|
742 | using another system on the network for its WINS server. It sets the
|
---|
743 | maximum T T L for NetBIOS names registered by the Samba server with
|
---|
744 | the WINS server. You should never need to alter this value.</p>
|
---|
745 |
|
---|
746 |
|
---|
747 | </div>
|
---|
748 |
|
---|
749 |
|
---|
750 |
|
---|
751 | <div class="sect3"><a name="samba2-CHP-7-SECT-1.6.8"/>
|
---|
752 |
|
---|
753 | <a name="INDEX-32"/><h3 class="head3">max wins ttl</h3>
|
---|
754 |
|
---|
755 | <p>This option is used when Samba is providing WINS name service, and it
|
---|
756 | sets the maximum T T L for NetBIOS names registered with Samba. You
|
---|
757 | should never need to change this value from its default.</p>
|
---|
758 |
|
---|
759 |
|
---|
760 | </div>
|
---|
761 |
|
---|
762 |
|
---|
763 |
|
---|
764 | <div class="sect3"><a name="samba2-CHP-7-SECT-1.6.9"/>
|
---|
765 |
|
---|
766 | <a name="INDEX-33"/><h3 class="head3">min wins ttl</h3>
|
---|
767 |
|
---|
768 | <p>This option is used when Samba is providing WINS name service, and it
|
---|
769 | sets the minimum T T L for NetBIOS names registered with Samba. You
|
---|
770 | should never need to alter this value from its default. <a name="INDEX-34"/> <a name="INDEX-35"/> <a name="INDEX-36"/></p>
|
---|
771 |
|
---|
772 |
|
---|
773 | </div>
|
---|
774 |
|
---|
775 |
|
---|
776 | </div>
|
---|
777 |
|
---|
778 |
|
---|
779 | </div>
|
---|
780 |
|
---|
781 |
|
---|
782 |
|
---|
783 | <div class="sect1"><a name="samba2-CHP-7-SECT-2"/>
|
---|
784 |
|
---|
785 | <h2 class="head1">Browsing</h2>
|
---|
786 |
|
---|
787 | <p><a name="INDEX-37"/>Browsing
|
---|
788 | was developed by Microsoft to help users find shared resources on the
|
---|
789 | network. In a networked computing environment where users can add or
|
---|
790 | remove shares at any time, it is important to have some automatic
|
---|
791 | means of keeping track of the shared resources and allowing users to
|
---|
792 | "browse" through them to find the
|
---|
793 | ones they wish to use.</p>
|
---|
794 |
|
---|
795 | <p>Before browsing was added to SMB networking, when anyone added a new
|
---|
796 | share, the people with whom they wished to share the data or printer
|
---|
797 | would have to be informed of the share's UNC, using
|
---|
798 | some relatively low-tech method such as speaking to them in person or
|
---|
799 | over the phone, or sending email. Already, this was very inconvenient
|
---|
800 | in large organizations. To further complicate matters, the users
|
---|
801 | working on client computers had to type in the
|
---|
802 | share's UNC to connect to it. The only way to get
|
---|
803 | around typing in the share's UNC every time it was
|
---|
804 | used was to map a network drive to it, and with a large number of
|
---|
805 | shares on the network, this could easily get out of hand.</p>
|
---|
806 |
|
---|
807 |
|
---|
808 | <div class="sect2"><a name="samba2-CHP-7-SECT-2.1"/>
|
---|
809 |
|
---|
810 | <h3 class="head2">Browsing in a Windows Network</h3>
|
---|
811 |
|
---|
812 | <p><a name="INDEX-38"/>To keep things simple, we will
|
---|
813 | first describe network browsing in a network that contains only
|
---|
814 | Windows systems and then show you how to add a Samba server.</p>
|
---|
815 |
|
---|
816 | <p>The basic way browsing works is that one computer in the network
|
---|
817 | takes on the role of the <em class="firstterm">master
|
---|
818 | browser</em><a name="INDEX-39"/> (also
|
---|
819 | called <em class="firstterm">local master
|
---|
820 | browser</em><a name="INDEX-40"/>,<em class="firstterm"> browse
|
---|
821 | master</em><a name="INDEX-41"/>, or
|
---|
822 | <em class="firstterm">browse server</em><a name="INDEX-42"/>) and
|
---|
823 | keeps a list of all the computers on the local subnet that are acting
|
---|
824 | as SMB servers. The list of computers is called the <em class="firstterm">browse
|
---|
825 | list</em><a name="INDEX-43"/> and includes all Samba servers, Windows
|
---|
826 | NT/2000/XP systems, and any Windows 95/98/Me systems that have the
|
---|
827 | "File and printer sharing for Microsoft
|
---|
828 | Networks" networking component installed. The browse
|
---|
829 | list also contains the names of all workgroups and domains. At this
|
---|
830 | level, browsing is limited to the local subnet because the browsing
|
---|
831 | protocol depends on broadcast packets, which are typically not
|
---|
832 | forwarded to other subnets by routers.</p>
|
---|
833 |
|
---|
834 | <p>A user at any Windows system can view the browse list by opening up
|
---|
835 | the Network Neighborhood (or My Network Places), as we showed you in
|
---|
836 | <a href="ch01.html">Chapter 1</a>. Or, the <em class="emphasis">net
|
---|
837 | view</em><a name="INDEX-44"/> command can be used from a Windows
|
---|
838 | command prompt:</p>
|
---|
839 |
|
---|
840 | <blockquote><pre class="code">C:\><tt class="userinput"><b>net view</b></tt>
|
---|
841 | Server Name Remark
|
---|
842 |
|
---|
843 | -------------------------------------------------------------------------------
|
---|
844 | \\MAYA Windows 98
|
---|
845 | \\MIXTEC Samba 2.2.5
|
---|
846 | \\OLMEC Windows XP Pro on Pentium/ASUS
|
---|
847 | \\TOLTEC Samba 2.2.5
|
---|
848 | \\YAQUI Windows 95 on mixtec/VMware
|
---|
849 | \\ZAPOTEC
|
---|
850 | The command completed successfully.</pre></blockquote>
|
---|
851 |
|
---|
852 | <p>Then, <em class="emphasis">net view</em> can be used with a computer name
|
---|
853 | as an argument to contact a server directly and list the resources it
|
---|
854 | is sharing:</p>
|
---|
855 |
|
---|
856 | <blockquote><pre class="code">C:\><tt class="userinput"><b>net view \\maya</b></tt>
|
---|
857 | Shared resources at \\maya
|
---|
858 |
|
---|
859 | Windows 98
|
---|
860 |
|
---|
861 | Share name Type Used as Comment
|
---|
862 |
|
---|
863 | -------------------------------------------------------------------------------
|
---|
864 | D Disk
|
---|
865 | E Disk
|
---|
866 | HP Print
|
---|
867 | The command completed successfully.</pre></blockquote>
|
---|
868 |
|
---|
869 | <p>The computers on the network involved in browsing are more than just
|
---|
870 | the master browser and its clients. There are also backup browsers,
|
---|
871 | which maintain copies of the browse list and respond to client
|
---|
872 | requests for it. Backup browsers are therefore able to take over the
|
---|
873 | role of master browser seamlessly in case it fails. The master
|
---|
874 | browser usually doesn't serve the browse list
|
---|
875 | directly to clients. Instead, its job is mainly to keep the master
|
---|
876 | copy of the browse list up-to-date, and also periodically update the
|
---|
877 | backup browsers. Clients are expected to get their copies of the
|
---|
878 | browse list from backup browsers, selecting among them randomly to
|
---|
879 | help to distribute the load on the backup browsers more evenly.
|
---|
880 | Ideally, the interaction between any client and the master browser is
|
---|
881 | limited to the client announcing when it joins or leaves the network
|
---|
882 | (if it is a server) and requesting a list of backup browsers.</p>
|
---|
883 |
|
---|
884 | <p>There can be more than one <a name="INDEX-45"/>backup browser. A workgroup will have a
|
---|
885 | backup browser if two or more computers are running Windows 95/98/Me
|
---|
886 | or Windows NT Workstation (or another nonserver version of Windows
|
---|
887 | NT/2000/XP) on the subnet. For every 32 additional computers, another
|
---|
888 | backup browser is added.</p>
|
---|
889 |
|
---|
890 | <p>In a Windows NT domain, the <a name="INDEX-46"/>primary domain controller is
|
---|
891 | always the local master browser, and if it fails, another Windows
|
---|
892 | NT/2000 server (if one exists) will take over the role of local
|
---|
893 | master browser. Other versions of Windows can function as backup
|
---|
894 | browsers, but will never become a master browser if a Windows NT/2000
|
---|
895 | server is available.</p>
|
---|
896 |
|
---|
897 | <p>In addition to acting as the local master browser, the primary domain
|
---|
898 | controller also acts as the <em class="firstterm">domain master
|
---|
899 | browser</em><a name="INDEX-47"/>, which ties subnets together and allows
|
---|
900 | browse lists to be shared between master and backup browsers on
|
---|
901 | separate subnets. This is how browsing is extended to function beyond
|
---|
902 | the local subnet. Each subnet functions as a separate browsing
|
---|
903 | entity, and the domain master browser synchronizes the master
|
---|
904 | browsers of each subnet. In a Windows-only network, browsing cannot
|
---|
905 | function across subnets unless a Windows NT/2000 PDC exists on the
|
---|
906 | network. Samba can act as a domain master browser and can perform
|
---|
907 | that task even in a workgroup network, which means that the Windows
|
---|
908 | PDC is not required for this task. (It is also possible to use the
|
---|
909 | <tt class="literal">remote</tt> <tt class="literal">browse</tt>
|
---|
910 | <tt class="literal">sync</tt> parameter to configure a Samba server to
|
---|
911 | synchronize its browse list with a Samba server on another subnet. In
|
---|
912 | this case, each server must be acting as the local master browser of
|
---|
913 | its subnet.)</p>
|
---|
914 |
|
---|
915 | <p>Unless it is configured never to act as a browser, each computer on
|
---|
916 | the subnet is considered a <em class="firstterm">potential browser</em>
|
---|
917 | and can be ordered by the browse master to become a backup browser,
|
---|
918 | or it can identify itself as a backup browser and accept the role on
|
---|
919 | its own.</p>
|
---|
920 |
|
---|
921 |
|
---|
922 | </div>
|
---|
923 |
|
---|
924 |
|
---|
925 | <div class="sect2"><a name="samba2-CHP-7-SECT-2.2"/>
|
---|
926 |
|
---|
927 | <h3 class="head2">Browser Elections</h3>
|
---|
928 |
|
---|
929 | <p><a name="INDEX-48"/>When no master browser is running on
|
---|
930 | the subnet, potential browsers choose a new master browser among
|
---|
931 | themselves in a process called an <em class="firstterm">election</em>. An
|
---|
932 | election is started by a computer in the subnet when it discovers
|
---|
933 | that no master browser is currently running. If a master browser is
|
---|
934 | shut down gracefully, it will broadcast an election request datagram,
|
---|
935 | initiating an election by the remaining computers. If the master
|
---|
936 | browser fails, the election can be started by a client computer that
|
---|
937 | requests a list of backup browsers from the master browser or by a
|
---|
938 | backup browser that requests to have its browse list updated from the
|
---|
939 | master browser. In each case, the system fails to receive a reply
|
---|
940 | from the master browser and initiates the election.</p>
|
---|
941 |
|
---|
942 | <p>Browser elections are decided in multiple rounds of self-elimination.
|
---|
943 | During each round, potential browsers broadcast election request
|
---|
944 | datagrams containing their qualifications to notify other potential
|
---|
945 | browsers that an election is happening and that if the recipient is
|
---|
946 | more qualified, it should also broadcast a bid. When a potential
|
---|
947 | browser receives an election request datagram from a more qualified
|
---|
948 | opponent, it drops out, disqualifying itself from becoming the master
|
---|
949 | browser. Otherwise, it responds with its own election request
|
---|
950 | datagram. After a few rounds, only one potential browser is left in
|
---|
951 | the election. After an additional four rounds of sending out an
|
---|
952 | election request datagram and receiving no response, it becomes the
|
---|
953 | master browser and sends a broadcast datagram announcing itself as
|
---|
954 | the local master browser for the subnet. It then assigns runners-up
|
---|
955 | in the election as backup browsers, as needed.</p>
|
---|
956 |
|
---|
957 | <p>A potential browser's qualifications include the
|
---|
958 | following:</p>
|
---|
959 |
|
---|
960 | <ul><li>
|
---|
961 | <p>Whether it has recently lost an election</p>
|
---|
962 | </li><li>
|
---|
963 | <p>The version of the election protocol it is running</p>
|
---|
964 | </li><li>
|
---|
965 | <p>Its election criteria</p>
|
---|
966 | </li><li>
|
---|
967 | <p>The amount of time the system has been up</p>
|
---|
968 | </li><li>
|
---|
969 | <p>The computer's NetBIOS name</p>
|
---|
970 | </li></ul>
|
---|
971 | <p>If the potential browser has lost an election recently, it
|
---|
972 | immediately disqualifies itself. The version of the election protocol
|
---|
973 | it is running is checked, but so far, all Windows systems (and Samba)
|
---|
974 | use the same election protocol, so the check is not very meaningful.
|
---|
975 | The election criteria are usually what determine which computer
|
---|
976 | becomes the local master browser. There are two parts to the election
|
---|
977 | criteria, shown in Tables <a href="ch07.html#samba2-CHP-7-TABLE-2">Table 7-2</a> and <a href="ch07.html#samba2-CHP-7-TABLE-3">Table 7-3</a>.</p>
|
---|
978 |
|
---|
979 | <a name="samba2-CHP-7-TABLE-2"/><h4 class="head4">Table 7-2. Operating-system values in an election</h4><table border="1">
|
---|
980 |
|
---|
981 |
|
---|
982 |
|
---|
983 | <tr>
|
---|
984 | <th>
|
---|
985 | <p>Operating system</p>
|
---|
986 | </th>
|
---|
987 | <th>
|
---|
988 | <p>Value</p>
|
---|
989 | </th>
|
---|
990 | </tr>
|
---|
991 |
|
---|
992 |
|
---|
993 | <tr>
|
---|
994 | <td>
|
---|
995 | <p>Windows NT/2000 Server, running as PDC</p>
|
---|
996 | </td>
|
---|
997 | <td>
|
---|
998 | <p>32</p>
|
---|
999 | </td>
|
---|
1000 | </tr>
|
---|
1001 | <tr>
|
---|
1002 | <td>
|
---|
1003 | <p>Windows NT/2000/XP, if not the PDC</p>
|
---|
1004 | </td>
|
---|
1005 | <td>
|
---|
1006 | <p>16</p>
|
---|
1007 | </td>
|
---|
1008 | </tr>
|
---|
1009 | <tr>
|
---|
1010 | <td>
|
---|
1011 | <p>Windows 95/98/Me</p>
|
---|
1012 | </td>
|
---|
1013 | <td>
|
---|
1014 | <p>1</p>
|
---|
1015 | </td>
|
---|
1016 | </tr>
|
---|
1017 | <tr>
|
---|
1018 | <td>
|
---|
1019 | <p>Windows for Workgroups</p>
|
---|
1020 | </td>
|
---|
1021 | <td>
|
---|
1022 | <p>1</p>
|
---|
1023 | </td>
|
---|
1024 | </tr>
|
---|
1025 |
|
---|
1026 | </table>
|
---|
1027 |
|
---|
1028 | <a name="samba2-CHP-7-TABLE-3"/><h4 class="head4">Table 7-3. Computer-role settings in an election</h4><table border="1">
|
---|
1029 |
|
---|
1030 |
|
---|
1031 |
|
---|
1032 | <tr>
|
---|
1033 | <th>
|
---|
1034 | <p>Role</p>
|
---|
1035 | </th>
|
---|
1036 | <th>
|
---|
1037 | <p>Value</p>
|
---|
1038 | </th>
|
---|
1039 | </tr>
|
---|
1040 |
|
---|
1041 |
|
---|
1042 | <tr>
|
---|
1043 | <td>
|
---|
1044 | <p>Domain master browser</p>
|
---|
1045 | </td>
|
---|
1046 | <td>
|
---|
1047 | <p>128</p>
|
---|
1048 | </td>
|
---|
1049 | </tr>
|
---|
1050 | <tr>
|
---|
1051 | <td>
|
---|
1052 | <p>WINS client</p>
|
---|
1053 | </td>
|
---|
1054 | <td>
|
---|
1055 | <p>32</p>
|
---|
1056 | </td>
|
---|
1057 | </tr>
|
---|
1058 | <tr>
|
---|
1059 | <td>
|
---|
1060 | <p>Preferred master</p>
|
---|
1061 | </td>
|
---|
1062 | <td>
|
---|
1063 | <p>8</p>
|
---|
1064 | </td>
|
---|
1065 | </tr>
|
---|
1066 | <tr>
|
---|
1067 | <td>
|
---|
1068 | <p>Running master</p>
|
---|
1069 | </td>
|
---|
1070 | <td>
|
---|
1071 | <p>4</p>
|
---|
1072 | </td>
|
---|
1073 | </tr>
|
---|
1074 | <tr>
|
---|
1075 | <td>
|
---|
1076 | <p>Recent backup browser</p>
|
---|
1077 | </td>
|
---|
1078 | <td>
|
---|
1079 | <p>2</p>
|
---|
1080 | </td>
|
---|
1081 | </tr>
|
---|
1082 | <tr>
|
---|
1083 | <td>
|
---|
1084 | <p>Backup browser</p>
|
---|
1085 | </td>
|
---|
1086 | <td>
|
---|
1087 | <p>1</p>
|
---|
1088 | </td>
|
---|
1089 | </tr>
|
---|
1090 |
|
---|
1091 | </table>
|
---|
1092 |
|
---|
1093 | <p>The operating-system type is compared first, and the system with the
|
---|
1094 | highest value wins. The values have been chosen to cause the primary
|
---|
1095 | domain controller, if there is one, to become the local master
|
---|
1096 | browser. Otherwise, a Windows NT/2000/XP system will win over a
|
---|
1097 | Windows for Workgroups or Windows 95/98/Me system.</p>
|
---|
1098 |
|
---|
1099 | <p>When an operating-system type comparison results in a tie, the role
|
---|
1100 | of the computer is compared. A computer can have more than one of the
|
---|
1101 | values in <a href="ch07.html#samba2-CHP-7-TABLE-3">Table 7-3</a>, in which case the values are
|
---|
1102 | added.</p>
|
---|
1103 |
|
---|
1104 | <p>A domain master browser has a role value of 128 to weight the
|
---|
1105 | election so heavily in its favor that it will also become the local
|
---|
1106 | master browser on its own subnet. Although the primary domain
|
---|
1107 | controller (which is always the domain master browser) will win the
|
---|
1108 | election based solely on its operating system value, sometimes there
|
---|
1109 | is no primary domain controller on the network, and the domain master
|
---|
1110 | browser would not otherwise be distinguished from other potential
|
---|
1111 | browsers.</p>
|
---|
1112 |
|
---|
1113 | <p>Systems that are using a WINS server for name resolution are weighted
|
---|
1114 | heavily over ones that use broadcast name resolution with a role
|
---|
1115 | value of 32.</p>
|
---|
1116 |
|
---|
1117 | <p>A <em class="firstterm">preferred master</em> is a computer that has been
|
---|
1118 | selected and configured manually by a system administrator to be
|
---|
1119 | favored as the choice master browser. When a preferred master starts
|
---|
1120 | up, it forces a browser election, even if an existing master browser
|
---|
1121 | is still active. A preferred master has a role value of 8, and the
|
---|
1122 | existing master browser gets a value of 4.</p>
|
---|
1123 |
|
---|
1124 | <p>A backup browser that has recently been a master browser and still
|
---|
1125 | has an up-to-date browse list is given a role value of 2, and a
|
---|
1126 | potential browser that has been running as a backup browser gets a
|
---|
1127 | value of 1.</p>
|
---|
1128 |
|
---|
1129 | <p>If comparing the operating-system type and role results in a tie, the
|
---|
1130 | computer that has been running the longest wins. In the unlikely
|
---|
1131 | event that the two have been up for the same amount of time, the
|
---|
1132 | computer that wins is the one with the NetBIOS name that sorts first
|
---|
1133 | alphabetically.</p>
|
---|
1134 |
|
---|
1135 | <p>You can tell if a machine is a local master browser by using the
|
---|
1136 | Windows <em class="emphasis">nbtstat</em><a name="INDEX-49"/> command. Place the NetBIOS name of the
|
---|
1137 | machine you wish to check after the <em class="emphasis">-a</em> option:</p>
|
---|
1138 |
|
---|
1139 | <blockquote><pre class="code">C:\><tt class="userinput"><b>nbtstat -a toltec</b></tt>
|
---|
1140 |
|
---|
1141 | Local Area Connection:
|
---|
1142 | Node IpAddress: [172.16.1.4] Scope Id: []
|
---|
1143 |
|
---|
1144 | NetBIOS Remote Machine Name Table
|
---|
1145 |
|
---|
1146 | Name Type Status
|
---|
1147 | ---------------------------------------------
|
---|
1148 | TOLTEC <00> UNIQUE Registered
|
---|
1149 | TOLTEC <03> UNIQUE Registered
|
---|
1150 | TOLTEC <20> UNIQUE Registered
|
---|
1151 | ..__MSBROWSE__.<01> GROUP Registered
|
---|
1152 | METRAN <00> GROUP Registered
|
---|
1153 | METRAN <1B> UNIQUE Registered
|
---|
1154 | METRAN <1C> GROUP Registered
|
---|
1155 | METRAN <1D> UNIQUE Registered
|
---|
1156 | METRAN <1E> GROUP Registered
|
---|
1157 |
|
---|
1158 | MAC Address = 00-00-00-00-00-00</pre></blockquote>
|
---|
1159 |
|
---|
1160 | <p>The resource entry that you're looking for is
|
---|
1161 | <tt class="literal">.._ _MSBROWSE_ _.<01></tt><a name="INDEX-50"/>. This indicates
|
---|
1162 | that the server is currently acting as the local master browser for
|
---|
1163 | the current subnet. If the machine is a Samba server, you can check
|
---|
1164 | the Samba <em class="filename">nmbd</em> log file for an entry such as:</p>
|
---|
1165 |
|
---|
1166 | <blockquote><pre class="code">nmbd/nmbd_become_lmb.c:become_local_master_stage2(406)
|
---|
1167 | *****
|
---|
1168 | Samba name server TOLTEC is now a local master browser for
|
---|
1169 | workgroup METRAN on subnet 172.16.1.0</pre></blockquote>
|
---|
1170 |
|
---|
1171 | <p>Or, you can use the
|
---|
1172 | <em class="emphasis">nmblookup</em><a name="INDEX-51"/> command with the
|
---|
1173 | <em class="emphasis">-M</em> option and the workgroup or domain name on
|
---|
1174 | any Samba server to find the IP address of the local master:</p>
|
---|
1175 |
|
---|
1176 | <a name="INDEX-52"/><blockquote><pre class="code">$ <tt class="userinput"><b>nmblookup -M metran</b></tt>
|
---|
1177 | querying metran on 172.16.1.255
|
---|
1178 | 172.16.1.1 metran<1d></pre></blockquote>
|
---|
1179 |
|
---|
1180 |
|
---|
1181 | </div>
|
---|
1182 |
|
---|
1183 |
|
---|
1184 | <div class="sect2"><a name="samba2-CHP-7-SECT-2.3"/>
|
---|
1185 |
|
---|
1186 | <h3 class="head2">Server Announcements</h3>
|
---|
1187 |
|
---|
1188 | <p><a name="INDEX-53"/>After
|
---|
1189 | the master browser election is decided, each server on the network
|
---|
1190 | announces itself to the network to allow the master and backup
|
---|
1191 | browsers to build their browse lists. At first, the server
|
---|
1192 | announcements happen every minute, but the interval is gradually
|
---|
1193 | stretched out to every 12 minutes. When a server is shut down
|
---|
1194 | gracefully, it sends an announcement that it is going offline to
|
---|
1195 | allow the master and backup browsers to remove it from the browse
|
---|
1196 | list. However, when a server goes offline by crashing or by some
|
---|
1197 | other failure, the master browser notices its disappearance only
|
---|
1198 | because it stops receiving server announcements. The master browser
|
---|
1199 | waits for three of the server's announcement periods
|
---|
1200 | before deciding that it is offline, which can take up to 36 minutes.
|
---|
1201 | Because backup browsers have their browse lists updated from the
|
---|
1202 | master browser once every 15 minutes, it can take up to 51 minutes
|
---|
1203 | for clients to be informed of a failed server.</p>
|
---|
1204 |
|
---|
1205 | <p>For more detailed information on Microsoft's
|
---|
1206 | browsing protocols, consult the Microsoft documents
|
---|
1207 | <em class="citetitle">Browsing and Windows 95
|
---|
1208 | Networking</em><a name="INDEX-54"/> and
|
---|
1209 | <em class="citetitle">CIFS/E Browser Protocol</em>. You can find these by
|
---|
1210 | searching for the titles on the Microsoft web site at <a href="http://www.microsoft.com">http://www.microsoft.com</a>.</p>
|
---|
1211 |
|
---|
1212 | <p>More information on configuring Samba for browsing can be found in
|
---|
1213 | <em class="filename">BROWSING.txt</em><a name="INDEX-55"/> and
|
---|
1214 | <em class="filename">BROWSING-Config.txt</em> in the Samba
|
---|
1215 | distribution's <em class="filename">docs/textdocs</em>
|
---|
1216 | directory. <a name="INDEX-56"/></p>
|
---|
1217 |
|
---|
1218 |
|
---|
1219 | </div>
|
---|
1220 |
|
---|
1221 |
|
---|
1222 | <div class="sect2"><a name="samba2-CHP-7-SECT-2.4"/>
|
---|
1223 |
|
---|
1224 | <h3 class="head2">Configuring Samba for Browsing</h3>
|
---|
1225 |
|
---|
1226 | <p><a name="INDEX-57"/><a name="INDEX-58"/><a name="INDEX-59"/>Samba has full support for browsing
|
---|
1227 | and can participate as a master browser, a backup browser, a domain
|
---|
1228 | master browser, a potential browser, or just a server that
|
---|
1229 | doesn't participate in browsing elections. If you
|
---|
1230 | want to make sure your Samba server never becomes a master or backup
|
---|
1231 | browser, simply set:</p>
|
---|
1232 |
|
---|
1233 | <a name="INDEX-60"/><blockquote><pre class="code">[global]
|
---|
1234 | local master = no</pre></blockquote>
|
---|
1235 |
|
---|
1236 | <p>Usually, you will want Samba to be available as a local master or at
|
---|
1237 | least a backup browser. In the simplest case, you
|
---|
1238 | don't need to do anything because
|
---|
1239 | Samba's default is to participate in browsing
|
---|
1240 | elections with its operating system value set to 20, which will beat
|
---|
1241 | any Windows system less than a Windows NT/2000 primary domain
|
---|
1242 | controller (see <a href="ch07.html#samba2-CHP-7-TABLE-2">Table 7-2</a>). The operating-system
|
---|
1243 | value Samba reports for itself in browser elections can be set using
|
---|
1244 | the <tt class="literal">os</tt><a name="INDEX-61"/> <tt class="literal">level</tt>
|
---|
1245 | parameter:</p>
|
---|
1246 |
|
---|
1247 | <blockquote><pre class="code">[global]
|
---|
1248 | os level = 33</pre></blockquote>
|
---|
1249 |
|
---|
1250 | <p>The preceding value will allow Samba to beat even a Windows 2000
|
---|
1251 | Advanced Server acting as a primary domain controller. As we show in
|
---|
1252 | the following section, though, forcing Samba to win this way is not
|
---|
1253 | recommended.</p>
|
---|
1254 |
|
---|
1255 | <p>If you want to allow a Windows XP Professional system to be the
|
---|
1256 | master browser, you would need to set Samba lower:</p>
|
---|
1257 |
|
---|
1258 | <blockquote><pre class="code">[global]
|
---|
1259 | os level = 8</pre></blockquote>
|
---|
1260 |
|
---|
1261 | <p>The maximum value for <tt class="literal">os</tt> <tt class="literal">level</tt>
|
---|
1262 | is 255 because it is handled as an 8-bit unsigned integer. Supposing
|
---|
1263 | we wanted to make absolutely sure our Samba server will be the local
|
---|
1264 | master browser at all times, we might say:</p>
|
---|
1265 |
|
---|
1266 | <blockquote><pre class="code">[global]
|
---|
1267 | local master = yes
|
---|
1268 | os level = 255
|
---|
1269 | preferred master = yes</pre></blockquote>
|
---|
1270 |
|
---|
1271 | <p>The addition of the
|
---|
1272 | <tt class="literal">preferred</tt><a name="INDEX-62"/>
|
---|
1273 | <tt class="literal">master</tt> parameter causes Samba to start a browser
|
---|
1274 | election as soon as it starts up, and the <tt class="literal">os</tt>
|
---|
1275 | <tt class="literal">level</tt> of 255 allows it to beat any other system on
|
---|
1276 | the network. This includes other Samba servers, assuming they are
|
---|
1277 | configured properly! If another server is using a similar
|
---|
1278 | configuration file (with <tt class="literal">os</tt>
|
---|
1279 | <tt class="literal">level</tt> <tt class="literal">=</tt> <tt class="literal">255</tt>
|
---|
1280 | and <tt class="literal">preferred</tt> <tt class="literal">master</tt>
|
---|
1281 | <tt class="literal">=</tt> <tt class="literal">yes</tt>), the two will fight each
|
---|
1282 | other for the master browser role, winning elections based on minor
|
---|
1283 | criteria, such as uptime or their current role. To avoid this, other
|
---|
1284 | Samba servers should be set with a lower <tt class="literal">os</tt>
|
---|
1285 | <tt class="literal">level</tt> and not configured to be the preferred
|
---|
1286 | master.</p>
|
---|
1287 |
|
---|
1288 |
|
---|
1289 | </div>
|
---|
1290 |
|
---|
1291 |
|
---|
1292 | <div class="sect2"><a name="samba2-CHP-7-SECT-2.5"/>
|
---|
1293 |
|
---|
1294 | <h3 class="head2">Samba as the Domain Master Browser</h3>
|
---|
1295 |
|
---|
1296 | <p><a name="INDEX-63"/>Previously we mentioned that for a Windows
|
---|
1297 | workgroup or domain to extend into multiple subnets, one system would
|
---|
1298 | have to take the role of the domain master browser. The domain master
|
---|
1299 | browser propagates browse lists across each subnet in the workgroup.
|
---|
1300 | This works because each local master browser periodically
|
---|
1301 | synchronizes its browse list with the domain master browser. During
|
---|
1302 | this synchronization, the local master browser passes on the name of
|
---|
1303 | any server that the domain master browser does not have in its browse
|
---|
1304 | list, and vice versa. Each local master browser eventually holds the
|
---|
1305 | browse list for the entire domain.</p>
|
---|
1306 |
|
---|
1307 | <p>There is no election to determine which machine assumes the role of
|
---|
1308 | the domain master browser. Instead, the administrator has to set it
|
---|
1309 | manually. By Microsoft design, however, the domain master browser and
|
---|
1310 | the PDC both register a resource type of <1B>, so the
|
---|
1311 | roles—and the machines—are inseparable.</p>
|
---|
1312 |
|
---|
1313 | <p>If you have a Windows NT server on the network acting as a PDC, we
|
---|
1314 | recommend that you do not try to use Samba to become the domain
|
---|
1315 | master browser. The reverse is true as well: if Samba is taking on
|
---|
1316 | the responsibilities of a PDC, we recommend making it the domain
|
---|
1317 | master browser as well. Although it is possible to split the roles
|
---|
1318 | with Samba, this is not a good idea. Using two different machines to
|
---|
1319 | serve as the PDC and the domain master browser can cause random
|
---|
1320 | errors to occur in a Windows workgroup.</p>
|
---|
1321 |
|
---|
1322 | <p>Samba can assume the role of a domain master browser for all subnets
|
---|
1323 | in the workgroup with the following options:</p>
|
---|
1324 |
|
---|
1325 | <blockquote><pre class="code">[global]
|
---|
1326 | domain master = yes
|
---|
1327 | preferred master = yes
|
---|
1328 | local master = yes
|
---|
1329 | os level = 255</pre></blockquote>
|
---|
1330 |
|
---|
1331 | <p>The final three parameters ensure that the server is also the local
|
---|
1332 | master browser, which is vital for it to work properly as the domain
|
---|
1333 | master browser. You can verify that a Samba machine is in fact the
|
---|
1334 | <a name="INDEX-64"/>domain master browser by checking the
|
---|
1335 | <em class="emphasis">nmbd</em><a name="INDEX-65"/><a name="INDEX-66"/> log file:</p>
|
---|
1336 |
|
---|
1337 | <blockquote><pre class="code">nmbd/nmbd_become_dmb.c:become_domain_master_stage2(118)
|
---|
1338 | *****
|
---|
1339 | Samba name server TOLTEC is now a domain master browser for
|
---|
1340 | workgroup METRAN on subnet 172.16.1.0</pre></blockquote>
|
---|
1341 |
|
---|
1342 | <p>Or you can use the
|
---|
1343 | <em class="emphasis">nmblookup</em><a name="INDEX-67"/> command that comes with the Samba
|
---|
1344 | distribution to query for a unique <1B> resource type in the
|
---|
1345 | workgroup:</p>
|
---|
1346 |
|
---|
1347 | <blockquote><pre class="code"># <tt class="userinput"><b>nmblookup METRAN#1B</b></tt>
|
---|
1348 | Sending queries to 172.16.1.255
|
---|
1349 | 172.16.1.1 METRAN<1b></pre></blockquote>
|
---|
1350 |
|
---|
1351 |
|
---|
1352 | <div class="sect3"><a name="samba2-CHP-7-SECT-2.5.1"/>
|
---|
1353 |
|
---|
1354 | <h3 class="head3">Multiple subnets</h3>
|
---|
1355 |
|
---|
1356 | <p><a name="INDEX-68"/>You must
|
---|
1357 | remember three rules when creating a
|
---|
1358 | <a name="INDEX-69"/>workgroup/domain
|
---|
1359 | that spans more than one subnet:</p>
|
---|
1360 |
|
---|
1361 | <ul><li>
|
---|
1362 | <p>You must have either a Windows NT/2000 or Samba server acting as a
|
---|
1363 | local master browser on each subnet in the workgroup/domain.</p>
|
---|
1364 | </li><li>
|
---|
1365 | <p>You must have a Windows NT/2000 Server edition or a Samba server
|
---|
1366 | acting as a domain master browser somewhere in the workgroup/domain.</p>
|
---|
1367 | </li><li>
|
---|
1368 | <p>A WINS server should be on the network, with each system on the
|
---|
1369 | network configured to use it for name resolution.</p>
|
---|
1370 | </li></ul>
|
---|
1371 | <p>Samba has some additional features you can use if you
|
---|
1372 | don't have or want a domain master browser on your
|
---|
1373 | network and still need to have <a name="INDEX-70"/>cross-subnet browsing. Consider the
|
---|
1374 | subnets shown in <a href="ch07.html#samba2-CHP-7-FIG-1">Figure 7-1</a>.</p>
|
---|
1375 |
|
---|
1376 | <div class="figure"><a name="samba2-CHP-7-FIG-1"/><a name="INDEX-71"/><a name="INDEX-72"/><img src="figs/sam2_0701.gif"/></div><h4 class="head4">Figure 7-1. Multiple subnets with Samba servers</h4>
|
---|
1377 |
|
---|
1378 | <p>First, a Samba server that is a local master browser can use the
|
---|
1379 | <tt class="literal">remote</tt><a name="INDEX-73"/> <tt class="literal">announce</tt>
|
---|
1380 | configuration option to make sure that computers in different subnets
|
---|
1381 | are sent broadcast announcements about the server. This has the
|
---|
1382 | effect of ensuring that the Samba server appears in the browse lists
|
---|
1383 | of foreign subnets. To achieve this, however, the directed broadcasts
|
---|
1384 | must reach the local master browser on the other subnet. Be aware
|
---|
1385 | that many routers do not allow directed broadcasts by default; you
|
---|
1386 | might have to change this setting on the router for the directed
|
---|
1387 | broadcasts to get through to its subnet.</p>
|
---|
1388 |
|
---|
1389 | <p>With the <tt class="literal">remote</tt> <tt class="literal">announce</tt>
|
---|
1390 | option, list the subnets and the workgroup that should receive the
|
---|
1391 | broadcast. For example, to ensure that machines in the 172.16.2 and
|
---|
1392 | 172.16.3 subnets and the METRAN workgroup are sent broadcast
|
---|
1393 | information from our Samba server, we could specify the following:</p>
|
---|
1394 |
|
---|
1395 | <blockquote><pre class="code">[global]
|
---|
1396 | remote announce = 172.16.2.255/METRAN \
|
---|
1397 | 172.16.3.255/METRAN</pre></blockquote>
|
---|
1398 |
|
---|
1399 | <p>Instead of supplying a broadcast address of the remote subnet, you
|
---|
1400 | are allowed to specify the exact address where broadcasts should be
|
---|
1401 | sent if the local master browser on the foreign subnet is guaranteed
|
---|
1402 | to always have the same IP address.</p>
|
---|
1403 |
|
---|
1404 | <p>A Samba local master browser can synchronize its browse list directly
|
---|
1405 | with one or more Samba servers, each acting as a local master browser
|
---|
1406 | on a different subnet. This is another way to implement browsing
|
---|
1407 | across subnets. For example, let's assume that Samba
|
---|
1408 | is configured as a local master browser, and Samba local master
|
---|
1409 | browsers exist at 172.16.2.130 and 172.16.3.120. We can use the
|
---|
1410 | <tt class="literal">remote</tt> <tt class="literal">browse</tt>
|
---|
1411 | <tt class="literal">sync</tt> option to sync directly with the Samba
|
---|
1412 | servers, as follows:</p>
|
---|
1413 |
|
---|
1414 | <blockquote><pre class="code">[global]
|
---|
1415 | remote browse sync = 172.16.2.130 172.16.3.120</pre></blockquote>
|
---|
1416 |
|
---|
1417 | <p>For this to work, the other Samba machines must also be local master
|
---|
1418 | browsers. You can also use directed broadcasts with this option if
|
---|
1419 | you do not know specific IP addresses of local master browsers.</p>
|
---|
1420 |
|
---|
1421 |
|
---|
1422 | </div>
|
---|
1423 |
|
---|
1424 |
|
---|
1425 | </div>
|
---|
1426 |
|
---|
1427 |
|
---|
1428 | <div class="sect2"><a name="samba2-CHP-7-SECT-2.6"/>
|
---|
1429 |
|
---|
1430 | <h3 class="head2">Making a Share Invisible</h3>
|
---|
1431 |
|
---|
1432 | <p><a name="INDEX-74"/><a name="INDEX-75"/><a name="INDEX-76"/>You can keep a share from being in the
|
---|
1433 | browse list by using the
|
---|
1434 | <tt class="literal">browsable</tt><a name="INDEX-77"/> option. This Boolean option
|
---|
1435 | prevents a share from being seen in the Network Neighborhood or My
|
---|
1436 | Network Places. For example, to prevent the <tt class="literal">[data]</tt>
|
---|
1437 | share from being visible, we could write:</p>
|
---|
1438 |
|
---|
1439 | <blockquote><pre class="code">[data]
|
---|
1440 | path = /export/samba/userdata
|
---|
1441 | browsable = no</pre></blockquote>
|
---|
1442 |
|
---|
1443 | <p>Although you typically don't want to do this to an
|
---|
1444 | ordinary disk share, the <tt class="literal">browsable</tt> option is
|
---|
1445 | useful in the event that you need to create a share with contents
|
---|
1446 | that you do not want others to see, such as a
|
---|
1447 | <tt class="literal">[netlogon]</tt><a name="INDEX-78"/> share for storing logon scripts
|
---|
1448 | for Windows domain control (see <a href="ch04.html">Chapter 4</a> for more
|
---|
1449 | information on logon scripts).</p>
|
---|
1450 |
|
---|
1451 | <p>Another example is the
|
---|
1452 | <tt class="literal">[homes]</tt><a name="INDEX-79"/> share. This share is often marked
|
---|
1453 | nonbrowsable so that a share named <tt class="literal">[homes]</tt>
|
---|
1454 | won't appear when its machine's
|
---|
1455 | resources are browsed. However, if a user <tt class="literal">alice</tt>
|
---|
1456 | logs on and looks at the machine's shares, an
|
---|
1457 | <tt class="literal">[alice]</tt> share will appear under the machine.</p>
|
---|
1458 |
|
---|
1459 | <p>What if we wanted to make sure
|
---|
1460 | <tt class="literal">alice</tt>'s share appeared to
|
---|
1461 | everyone before she logs on? This could be done with the global
|
---|
1462 | <tt class="literal">auto</tt><a name="INDEX-80"/> <tt class="literal">services</tt>
|
---|
1463 | option. This option preloads shares into the browse list to ensure
|
---|
1464 | that they are always visible:</p>
|
---|
1465 |
|
---|
1466 | <blockquote><pre class="code">[global]
|
---|
1467 | auto services = alice</pre></blockquote>
|
---|
1468 |
|
---|
1469 |
|
---|
1470 | </div>
|
---|
1471 |
|
---|
1472 |
|
---|
1473 | <div class="sect2"><a name="samba2-CHP-7-SECT-2.7"/>
|
---|
1474 |
|
---|
1475 | <h3 class="head2">Browsing Options</h3>
|
---|
1476 |
|
---|
1477 | <p><a href="ch07.html#samba2-CHP-7-TABLE-4">Table 7-4</a> <a name="INDEX-81"/><a name="INDEX-82"/>shows
|
---|
1478 | options that define how Samba handles browsing tasks.</p>
|
---|
1479 |
|
---|
1480 | <a name="samba2-CHP-7-TABLE-4"/><h4 class="head4">Table 7-4. Browsing configuration options</h4><table border="1">
|
---|
1481 |
|
---|
1482 |
|
---|
1483 |
|
---|
1484 |
|
---|
1485 |
|
---|
1486 |
|
---|
1487 | <tr>
|
---|
1488 | <th>
|
---|
1489 | <p>Option</p>
|
---|
1490 | </th>
|
---|
1491 | <th>
|
---|
1492 | <p>Parameters</p>
|
---|
1493 | </th>
|
---|
1494 | <th>
|
---|
1495 | <p>Function</p>
|
---|
1496 | </th>
|
---|
1497 | <th>
|
---|
1498 | <p>Default</p>
|
---|
1499 | </th>
|
---|
1500 | <th>
|
---|
1501 | <p>Scope</p>
|
---|
1502 | </th>
|
---|
1503 | </tr>
|
---|
1504 |
|
---|
1505 |
|
---|
1506 | <tr>
|
---|
1507 | <td>
|
---|
1508 | <p><tt class="literal">announce as</tt></p>
|
---|
1509 | </td>
|
---|
1510 | <td>
|
---|
1511 | <p>string</p>
|
---|
1512 | </td>
|
---|
1513 | <td>
|
---|
1514 | <p>Operating system that Samba will announce itself as.</p>
|
---|
1515 | </td>
|
---|
1516 | <td>
|
---|
1517 | <p><tt class="literal">N T Server</tt></p>
|
---|
1518 | </td>
|
---|
1519 | <td>
|
---|
1520 | <p>Global</p>
|
---|
1521 | </td>
|
---|
1522 | </tr>
|
---|
1523 | <tr>
|
---|
1524 | <td>
|
---|
1525 | <p><tt class="literal">announce</tt> <tt class="literal">version</tt></p>
|
---|
1526 | </td>
|
---|
1527 | <td>
|
---|
1528 | <p>numeric</p>
|
---|
1529 | </td>
|
---|
1530 | <td>
|
---|
1531 | <p>Version of the operating system that Samba will announce itself as.</p>
|
---|
1532 | </td>
|
---|
1533 | <td>
|
---|
1534 | <p><tt class="literal">4.5</tt></p>
|
---|
1535 | </td>
|
---|
1536 | <td>
|
---|
1537 | <p>Global</p>
|
---|
1538 | </td>
|
---|
1539 | </tr>
|
---|
1540 | <tr>
|
---|
1541 | <td>
|
---|
1542 | <p><tt class="literal">browsable</tt> <tt class="literal">(browseable)</tt></p>
|
---|
1543 | </td>
|
---|
1544 | <td>
|
---|
1545 | <p>Boolean</p>
|
---|
1546 | </td>
|
---|
1547 | <td>
|
---|
1548 | <p>Allows share to be displayed in list of machine resources.</p>
|
---|
1549 | </td>
|
---|
1550 | <td>
|
---|
1551 | <p><tt class="literal">yes</tt></p>
|
---|
1552 | </td>
|
---|
1553 | <td>
|
---|
1554 | <p>Share</p>
|
---|
1555 | </td>
|
---|
1556 | </tr>
|
---|
1557 | <tr>
|
---|
1558 | <td>
|
---|
1559 | <p><tt class="literal">browse list</tt></p>
|
---|
1560 | </td>
|
---|
1561 | <td>
|
---|
1562 | <p>Boolean</p>
|
---|
1563 | </td>
|
---|
1564 | <td>
|
---|
1565 | <p>If <tt class="literal">yes</tt>, allows Samba to provide a browse list on
|
---|
1566 | this server.</p>
|
---|
1567 | </td>
|
---|
1568 | <td>
|
---|
1569 | <p><tt class="literal">yes</tt></p>
|
---|
1570 | </td>
|
---|
1571 | <td>
|
---|
1572 | <p>Global</p>
|
---|
1573 | </td>
|
---|
1574 | </tr>
|
---|
1575 | <tr>
|
---|
1576 | <td>
|
---|
1577 | <p><tt class="literal">auto services</tt> <tt class="literal">(preload)</tt></p>
|
---|
1578 | </td>
|
---|
1579 | <td>
|
---|
1580 | <p>string (share list)</p>
|
---|
1581 | </td>
|
---|
1582 | <td>
|
---|
1583 | <p>List of shares that will always appear in the browse list.</p>
|
---|
1584 | </td>
|
---|
1585 | <td>
|
---|
1586 | <p>None</p>
|
---|
1587 | </td>
|
---|
1588 | <td>
|
---|
1589 | <p>Global</p>
|
---|
1590 | </td>
|
---|
1591 | </tr>
|
---|
1592 | <tr>
|
---|
1593 | <td>
|
---|
1594 | <p><tt class="literal">default</tt> <tt class="literal">service (default)</tt></p>
|
---|
1595 | </td>
|
---|
1596 | <td>
|
---|
1597 | <p>string (share name)</p>
|
---|
1598 | </td>
|
---|
1599 | <td>
|
---|
1600 | <p>Name of a share (service) that will be provided if the client
|
---|
1601 | requests a share not listed in <em class="emphasis">smb.conf</em>.</p>
|
---|
1602 | </td>
|
---|
1603 | <td>
|
---|
1604 | <p>None</p>
|
---|
1605 | </td>
|
---|
1606 | <td>
|
---|
1607 | <p>Global</p>
|
---|
1608 | </td>
|
---|
1609 | </tr>
|
---|
1610 | <tr>
|
---|
1611 | <td>
|
---|
1612 | <p><tt class="literal">local master</tt></p>
|
---|
1613 | </td>
|
---|
1614 | <td>
|
---|
1615 | <p>Boolean</p>
|
---|
1616 | </td>
|
---|
1617 | <td>
|
---|
1618 | <p>If <tt class="literal">yes</tt>, allows Samba to participate in browsing
|
---|
1619 | elections.</p>
|
---|
1620 | </td>
|
---|
1621 | <td>
|
---|
1622 | <p><tt class="literal">yes</tt></p>
|
---|
1623 | </td>
|
---|
1624 | <td>
|
---|
1625 | <p>Global</p>
|
---|
1626 | </td>
|
---|
1627 | </tr>
|
---|
1628 | <tr>
|
---|
1629 | <td>
|
---|
1630 | <p><tt class="literal">lm announce</tt></p>
|
---|
1631 | </td>
|
---|
1632 | <td>
|
---|
1633 | <p><tt class="literal">yes</tt>, <tt class="literal">no</tt>, or
|
---|
1634 | <tt class="literal">auto</tt></p>
|
---|
1635 | </td>
|
---|
1636 | <td>
|
---|
1637 | <p>Enables or disables LAN Manager-style host announcements.</p>
|
---|
1638 | </td>
|
---|
1639 | <td>
|
---|
1640 | <p><tt class="literal">auto</tt></p>
|
---|
1641 | </td>
|
---|
1642 | <td>
|
---|
1643 | <p>Global</p>
|
---|
1644 | </td>
|
---|
1645 | </tr>
|
---|
1646 | <tr>
|
---|
1647 | <td>
|
---|
1648 | <p><tt class="literal">lm interval</tt></p>
|
---|
1649 | </td>
|
---|
1650 | <td>
|
---|
1651 | <p>numeric</p>
|
---|
1652 | </td>
|
---|
1653 | <td>
|
---|
1654 | <p>Frequency in seconds that LAN Manager announcements will be made if
|
---|
1655 | activated.</p>
|
---|
1656 | </td>
|
---|
1657 | <td>
|
---|
1658 | <p><tt class="literal">60</tt></p>
|
---|
1659 | </td>
|
---|
1660 | <td>
|
---|
1661 | <p>Global</p>
|
---|
1662 | </td>
|
---|
1663 | </tr>
|
---|
1664 | <tr>
|
---|
1665 | <td>
|
---|
1666 | <p><tt class="literal">preferred</tt> <tt class="literal">master (prefered
|
---|
1667 | master)</tt></p>
|
---|
1668 | </td>
|
---|
1669 | <td>
|
---|
1670 | <p>Boolean</p>
|
---|
1671 | </td>
|
---|
1672 | <td>
|
---|
1673 | <p>If <tt class="literal">yes</tt>, allows Samba to use the preferred master
|
---|
1674 | browser bit to attempt to become the local master browser.</p>
|
---|
1675 | </td>
|
---|
1676 | <td>
|
---|
1677 | <p><tt class="literal">no</tt></p>
|
---|
1678 | </td>
|
---|
1679 | <td>
|
---|
1680 | <p>Global</p>
|
---|
1681 | </td>
|
---|
1682 | </tr>
|
---|
1683 | <tr>
|
---|
1684 | <td>
|
---|
1685 | <p><tt class="literal">domain master</tt></p>
|
---|
1686 | </td>
|
---|
1687 | <td>
|
---|
1688 | <p>Boolean</p>
|
---|
1689 | </td>
|
---|
1690 | <td>
|
---|
1691 | <p>If <tt class="literal">yes</tt>, allows Samba to become the domain browser
|
---|
1692 | master for the workgroup or domain.</p>
|
---|
1693 | </td>
|
---|
1694 | <td>
|
---|
1695 | <p><tt class="literal">no</tt></p>
|
---|
1696 | </td>
|
---|
1697 | <td>
|
---|
1698 | <p>Global</p>
|
---|
1699 | </td>
|
---|
1700 | </tr>
|
---|
1701 | <tr>
|
---|
1702 | <td>
|
---|
1703 | <p><tt class="literal">os level</tt></p>
|
---|
1704 | </td>
|
---|
1705 | <td>
|
---|
1706 | <p>numeric</p>
|
---|
1707 | </td>
|
---|
1708 | <td>
|
---|
1709 | <p>Operating system level of Samba in an election for local master
|
---|
1710 | browser.</p>
|
---|
1711 | </td>
|
---|
1712 | <td>
|
---|
1713 | <p><tt class="literal">0</tt></p>
|
---|
1714 | </td>
|
---|
1715 | <td>
|
---|
1716 | <p>Global</p>
|
---|
1717 | </td>
|
---|
1718 | </tr>
|
---|
1719 | <tr>
|
---|
1720 | <td>
|
---|
1721 | <p><tt class="literal">remote browse</tt> <tt class="literal">sync</tt></p>
|
---|
1722 | </td>
|
---|
1723 | <td>
|
---|
1724 | <p>string (list of IP addresses)</p>
|
---|
1725 | </td>
|
---|
1726 | <td>
|
---|
1727 | <p>Samba servers to synchronize browse lists with.</p>
|
---|
1728 | </td>
|
---|
1729 | <td>
|
---|
1730 | <p>None</p>
|
---|
1731 | </td>
|
---|
1732 | <td>
|
---|
1733 | <p>Global</p>
|
---|
1734 | </td>
|
---|
1735 | </tr>
|
---|
1736 | <tr>
|
---|
1737 | <td>
|
---|
1738 | <p><tt class="literal">remote</tt> <tt class="literal">announce</tt></p>
|
---|
1739 | </td>
|
---|
1740 | <td>
|
---|
1741 | <p>string (IP address/workgroup pairs)</p>
|
---|
1742 | </td>
|
---|
1743 | <td>
|
---|
1744 | <p>Subnets and workgroups to send directed broadcast packets to,
|
---|
1745 | allowing Samba to appear in their browse lists.</p>
|
---|
1746 | </td>
|
---|
1747 | <td>
|
---|
1748 | <p>None</p>
|
---|
1749 | </td>
|
---|
1750 | <td>
|
---|
1751 | <p>Global</p>
|
---|
1752 | </td>
|
---|
1753 | </tr>
|
---|
1754 |
|
---|
1755 | </table>
|
---|
1756 |
|
---|
1757 |
|
---|
1758 | <div class="sect3"><a name="samba2-CHP-7-SECT-2.7.1"/>
|
---|
1759 |
|
---|
1760 | <a name="INDEX-83"/><h3 class="head3">announce as</h3>
|
---|
1761 |
|
---|
1762 | <p>This global configuration option specifies the type of operating
|
---|
1763 | system that Samba announces to other machines on the network. The
|
---|
1764 | default value for this option is <tt class="literal">N T</tt>
|
---|
1765 | <tt class="literal">Server</tt>, which causes Samba to masquerade as a
|
---|
1766 | Windows NT Server operating system. Other possible values are
|
---|
1767 | <tt class="literal">NT</tt>, <tt class="literal">NT</tt>
|
---|
1768 | <tt class="literal">Workstation</tt>, <tt class="literal">Win95</tt>, and
|
---|
1769 | <tt class="literal">W f W</tt> for a Windows for Workgroup operating
|
---|
1770 | system. You can override the default value with the following:</p>
|
---|
1771 |
|
---|
1772 | <blockquote><pre class="code">[global]
|
---|
1773 | announce as = Win95</pre></blockquote>
|
---|
1774 |
|
---|
1775 | <p>We recommend against changing the default value of this configuration
|
---|
1776 | option.</p>
|
---|
1777 |
|
---|
1778 |
|
---|
1779 | </div>
|
---|
1780 |
|
---|
1781 |
|
---|
1782 |
|
---|
1783 | <div class="sect3"><a name="samba2-CHP-7-SECT-2.7.2"/>
|
---|
1784 |
|
---|
1785 | <a name="INDEX-84"/><h3 class="head3">announce version</h3>
|
---|
1786 |
|
---|
1787 | <p>This global option is frequently used with the
|
---|
1788 | <tt class="literal">announce</tt> <tt class="literal">as</tt> configuration
|
---|
1789 | option; it specifies the version of the operating system that Samba
|
---|
1790 | announces to other machines on the network. The default value of this
|
---|
1791 | option is 4.5, which places Samba above Windows NT Version 4.0, but
|
---|
1792 | below Windows 2000. You can specify a new value with a global entry
|
---|
1793 | such as the following:</p>
|
---|
1794 |
|
---|
1795 | <blockquote><pre class="code">[global]
|
---|
1796 | announce version = 4.3</pre></blockquote>
|
---|
1797 |
|
---|
1798 | <p>We recommend against changing the default value of this configuration
|
---|
1799 | option.</p>
|
---|
1800 |
|
---|
1801 |
|
---|
1802 | </div>
|
---|
1803 |
|
---|
1804 |
|
---|
1805 |
|
---|
1806 | <div class="sect3"><a name="samba2-CHP-7-SECT-2.7.3"/>
|
---|
1807 |
|
---|
1808 | <h3 class="head3">browsable</h3>
|
---|
1809 |
|
---|
1810 | <p>The <tt class="literal">browsable</tt><a name="INDEX-85"/> option (also spelled
|
---|
1811 | <tt class="literal">browseable</tt>) indicates whether the share referenced
|
---|
1812 | should appear in the list of available resources for the system on
|
---|
1813 | which it resides. This option is always set to <tt class="literal">yes</tt>
|
---|
1814 | by default. If you wish to prevent the share from being seen in a
|
---|
1815 | client's browser, you can reset this option to
|
---|
1816 | <tt class="literal">no</tt>.</p>
|
---|
1817 |
|
---|
1818 | <p>Note that this does not prevent someone from accessing the share
|
---|
1819 | using other means, such as specifying a UNC location (e.g.,
|
---|
1820 | <tt class="literal">\\server\accounting)</tt> in Windows Explorer. It only
|
---|
1821 | prevents the share from being listed under the
|
---|
1822 | system's resources when being browsed.</p>
|
---|
1823 |
|
---|
1824 |
|
---|
1825 | </div>
|
---|
1826 |
|
---|
1827 |
|
---|
1828 |
|
---|
1829 | <div class="sect3"><a name="samba2-CHP-7-SECT-2.7.4"/>
|
---|
1830 |
|
---|
1831 | <a name="INDEX-86"/><h3 class="head3">browse list</h3>
|
---|
1832 |
|
---|
1833 | <p>You should never need to change this parameter from its default value
|
---|
1834 | of <tt class="literal">yes</tt>. If your Samba server is acting as a local
|
---|
1835 | master browser (i.e., it has won the browsing election), you can use
|
---|
1836 | the global <tt class="literal">browse</tt> <tt class="literal">list</tt> option
|
---|
1837 | to instruct Samba to provide or withhold its browse list to all
|
---|
1838 | clients. By default, Samba always provides a browse list. You can
|
---|
1839 | withhold this information by specifying the following:</p>
|
---|
1840 |
|
---|
1841 | <blockquote><pre class="code">[global]
|
---|
1842 | browse list = no</pre></blockquote>
|
---|
1843 |
|
---|
1844 | <p>If you disable the browse list, clients cannot browse the names of
|
---|
1845 | other machines, their services, and other domains currently available
|
---|
1846 | on the network. Note that this won't make any
|
---|
1847 | particular machine inaccessible; if someone knows a valid machine
|
---|
1848 | name/address and a share on that machine, he can still connect to it
|
---|
1849 | explicitly using the Windows <em class="emphasis">net use</em> command or
|
---|
1850 | by mapping a drive letter to it using Windows Explorer. It simply
|
---|
1851 | prevents information in the browse list from being retrieved by any
|
---|
1852 | client that requests it.</p>
|
---|
1853 |
|
---|
1854 |
|
---|
1855 | </div>
|
---|
1856 |
|
---|
1857 |
|
---|
1858 |
|
---|
1859 | <div class="sect3"><a name="samba2-CHP-7-SECT-2.7.5"/>
|
---|
1860 |
|
---|
1861 | <h3 class="head3">auto services</h3>
|
---|
1862 |
|
---|
1863 | <p>The global <tt class="literal">auto</tt><a name="INDEX-87"/>
|
---|
1864 | <tt class="literal">services</tt> option, which is also called
|
---|
1865 | <tt class="literal">preload</tt> <a name="INDEX-88"/>, ensures that the specified
|
---|
1866 | shares are always visible in the browse list. One common use for this
|
---|
1867 | option is to advertise specific user or printer shares that are
|
---|
1868 | created by the <tt class="literal">[homes]</tt> or
|
---|
1869 | <tt class="literal">[printers]</tt> shares, but are not otherwise
|
---|
1870 | browsable.</p>
|
---|
1871 |
|
---|
1872 | <p>This option works best with disk shares. If you wish to force each of
|
---|
1873 | your system printers (i.e., those listed in the printer capabilities
|
---|
1874 | file) to appear in the browse list, we recommend using the
|
---|
1875 | <tt class="literal">load</tt> <tt class="literal">printers</tt> option instead.</p>
|
---|
1876 |
|
---|
1877 | <p>Shares listed with the <tt class="literal">auto</tt>
|
---|
1878 | <tt class="literal">services</tt> option will not be displayed if the
|
---|
1879 | <tt class="literal">browse</tt> <tt class="literal">list</tt> option is set to
|
---|
1880 | <tt class="literal">no</tt>.</p>
|
---|
1881 |
|
---|
1882 |
|
---|
1883 | </div>
|
---|
1884 |
|
---|
1885 |
|
---|
1886 |
|
---|
1887 | <div class="sect3"><a name="samba2-CHP-7-SECT-2.7.6"/>
|
---|
1888 |
|
---|
1889 | <h3 class="head3">default service</h3>
|
---|
1890 |
|
---|
1891 | <p>The global <tt class="literal">default</tt><a name="INDEX-89"/>
|
---|
1892 | <tt class="literal">service</tt> option (sometimes called
|
---|
1893 | <tt class="literal">default</tt>) names a
|
---|
1894 | "last-ditch" share. The value is
|
---|
1895 | set to an existing share name without the enclosing brackets. When a
|
---|
1896 | client requests a nonexistent disk or printer share, Samba will
|
---|
1897 | attempt to connect the user to the share specified by this option
|
---|
1898 | instead. The option is specified as follows:</p>
|
---|
1899 |
|
---|
1900 | <blockquote><pre class="code">[global]
|
---|
1901 | default service = helpshare</pre></blockquote>
|
---|
1902 |
|
---|
1903 | <p>When Samba redirects the requested, nonexistent service to the
|
---|
1904 | service specified by <tt class="literal">default</tt>
|
---|
1905 | <tt class="literal">service</tt>, the <tt class="literal">%S</tt> option takes on
|
---|
1906 | the value of the requested service, with any underscores (
|
---|
1907 | <tt class="literal">_</tt> ) in the requested service replaced by forward slashes
|
---|
1908 | (<tt class="literal">/</tt>).</p>
|
---|
1909 |
|
---|
1910 |
|
---|
1911 | </div>
|
---|
1912 |
|
---|
1913 |
|
---|
1914 |
|
---|
1915 | <div class="sect3"><a name="samba2-CHP-7-SECT-2.7.7"/>
|
---|
1916 |
|
---|
1917 | <a name="INDEX-90"/><h3 class="head3">local master</h3>
|
---|
1918 |
|
---|
1919 | <p>This global option specifies whether Samba will attempt to become the
|
---|
1920 | local master browser for the subnet when it starts up. If this option
|
---|
1921 | is set to <tt class="literal">yes</tt>, Samba will participate in
|
---|
1922 | elections. However, setting this option by itself does not guarantee
|
---|
1923 | victory. (Other parameters, such as <tt class="literal">preferred</tt>
|
---|
1924 | <tt class="literal">master</tt> and <tt class="literal">os</tt>
|
---|
1925 | <tt class="literal">level</tt>, help Samba win browsing elections.) If this
|
---|
1926 | option is set to <tt class="literal">no</tt>, Samba will lose all browsing
|
---|
1927 | elections, regardless of which values are specified by the other
|
---|
1928 | configuration options. The default value is <tt class="literal">yes</tt>.</p>
|
---|
1929 |
|
---|
1930 |
|
---|
1931 | </div>
|
---|
1932 |
|
---|
1933 |
|
---|
1934 |
|
---|
1935 | <div class="sect3"><a name="samba2-CHP-7-SECT-2.7.8"/>
|
---|
1936 |
|
---|
1937 | <h3 class="head3">lm announce</h3>
|
---|
1938 |
|
---|
1939 | <p>The global <tt class="literal">lm</tt><a name="INDEX-91"/>
|
---|
1940 | <tt class="literal">announce</tt> option tells Samba's
|
---|
1941 | <em class="emphasis">nmbd</em> whether to send <a name="INDEX-92"/>LAN Manager host
|
---|
1942 | announcements on behalf of the server. These host announcements might
|
---|
1943 | be required by older clients, such as IBM's OS/2
|
---|
1944 | operating system. This announcement allows the server to be added to
|
---|
1945 | the browse lists of the client. If activated, Samba will announce
|
---|
1946 | itself repetitively at the number of seconds specified by the
|
---|
1947 | <tt class="literal">lm</tt> <tt class="literal">interval</tt> option.</p>
|
---|
1948 |
|
---|
1949 | <p>You can specify the option as follows:</p>
|
---|
1950 |
|
---|
1951 | <blockquote><pre class="code">[global]
|
---|
1952 | lm announce = yes</pre></blockquote>
|
---|
1953 |
|
---|
1954 | <p>This configuration option takes the standard Boolean values,
|
---|
1955 | <tt class="literal">yes</tt> and <tt class="literal">no</tt>, which enable or
|
---|
1956 | disable LAN Manager announcements, respectively. In addition, a third
|
---|
1957 | option, <tt class="literal">auto</tt>, causes <em class="emphasis">nmbd</em> to
|
---|
1958 | listen passively for LAN Manager announcements, but not to send any
|
---|
1959 | of its own initially. If LAN Manager announcements are detected for
|
---|
1960 | another machine on the network, <em class="emphasis">nmbd</em> will start
|
---|
1961 | sending its own LAN Manager announcements to ensure that it is
|
---|
1962 | visible. The default value is <tt class="literal">auto</tt>. You probably
|
---|
1963 | won't need to change this value from its default.</p>
|
---|
1964 |
|
---|
1965 |
|
---|
1966 | </div>
|
---|
1967 |
|
---|
1968 |
|
---|
1969 |
|
---|
1970 | <div class="sect3"><a name="samba2-CHP-7-SECT-2.7.9"/>
|
---|
1971 |
|
---|
1972 | <a name="INDEX-93"/><h3 class="head3">lm interval</h3>
|
---|
1973 |
|
---|
1974 | <p>This option, which is used in conjunction with <tt class="literal">lm</tt>
|
---|
1975 | <tt class="literal">announce</tt>, indicates the number of seconds
|
---|
1976 | <em class="emphasis">nmbd</em> will wait before repeatedly broadcasting
|
---|
1977 | LAN Manager-style announcements. LAN Manager announcements must be
|
---|
1978 | enabled for this option to work. The default value is 60 seconds. If
|
---|
1979 | you set this value to 0, Samba will not send any LAN Manager host
|
---|
1980 | announcements, regardless of the value of the <tt class="literal">lm</tt>
|
---|
1981 | <tt class="literal">announce</tt> option. You can reset the value of this
|
---|
1982 | option as follows:</p>
|
---|
1983 |
|
---|
1984 | <blockquote><pre class="code">[global]
|
---|
1985 | lm interval = 90</pre></blockquote>
|
---|
1986 |
|
---|
1987 |
|
---|
1988 | </div>
|
---|
1989 |
|
---|
1990 |
|
---|
1991 |
|
---|
1992 | <div class="sect3"><a name="samba2-CHP-7-SECT-2.7.10"/>
|
---|
1993 |
|
---|
1994 | <h3 class="head3">preferred master</h3>
|
---|
1995 |
|
---|
1996 | <p>The <tt class="literal">preferred</tt><a name="INDEX-94"/>
|
---|
1997 | <tt class="literal">master</tt> option requests that Samba set the
|
---|
1998 | preferred master bit when participating in an election. This gives
|
---|
1999 | the server a higher preferred status in the workgroup than other
|
---|
2000 | machines at the same operating-system level. If you are configuring
|
---|
2001 | your Samba machine to become the local master browser, it is wise to
|
---|
2002 | set the following value:</p>
|
---|
2003 |
|
---|
2004 | <blockquote><pre class="code">[global]
|
---|
2005 | preferred master = yes</pre></blockquote>
|
---|
2006 |
|
---|
2007 | <p>Otherwise, you should leave it set to its default,
|
---|
2008 | <tt class="literal">no</tt>. If Samba is configured as a preferred master
|
---|
2009 | browser, it will force an election when it first comes online.</p>
|
---|
2010 |
|
---|
2011 |
|
---|
2012 | </div>
|
---|
2013 |
|
---|
2014 |
|
---|
2015 |
|
---|
2016 | <div class="sect3"><a name="samba2-CHP-7-SECT-2.7.11"/>
|
---|
2017 |
|
---|
2018 | <a name="INDEX-95"/><h3 class="head3">domain master</h3>
|
---|
2019 |
|
---|
2020 | <p>If Samba is the primary domain controller for your workgroup or NT
|
---|
2021 | domain, it should also be made the domain master browser. The domain
|
---|
2022 | master browser is a special machine that has the NetBIOS resource
|
---|
2023 | type <1B> and is used to propagate browse lists to and from
|
---|
2024 | each local master browser in individual subnets across the domain. To
|
---|
2025 | force Samba to become the <a name="INDEX-96"/>domain master browser, set the following in
|
---|
2026 | the <tt class="literal">[global]</tt> section of the
|
---|
2027 | <em class="filename">smb.conf</em>:</p>
|
---|
2028 |
|
---|
2029 | <blockquote><pre class="code">[global]
|
---|
2030 | domain master = yes</pre></blockquote>
|
---|
2031 |
|
---|
2032 | <p>If you have a Windows NT server on the network acting as a primary
|
---|
2033 | domain controller (PDC), we recommend that you do not use Samba to
|
---|
2034 | become the domain master browser. The reverse is true as well: if
|
---|
2035 | Samba is taking on the responsibilities of a PDC, we recommend making
|
---|
2036 | it the domain master browser. Splitting the PDC and the domain master
|
---|
2037 | browser will cause unpredictable errors to occur on the network.</p>
|
---|
2038 |
|
---|
2039 |
|
---|
2040 | </div>
|
---|
2041 |
|
---|
2042 |
|
---|
2043 |
|
---|
2044 | <div class="sect3"><a name="samba2-CHP-7-SECT-2.7.12"/>
|
---|
2045 |
|
---|
2046 | <h3 class="head3">os level</h3>
|
---|
2047 |
|
---|
2048 | <p>The global <tt class="literal">os</tt><a name="INDEX-97"/> <tt class="literal">level</tt> option
|
---|
2049 | defines the operating-system value with which Samba will masquerade
|
---|
2050 | during a browser election. If you wish to have Samba win an election
|
---|
2051 | and become the master browser, set the <tt class="literal">os</tt>
|
---|
2052 | <tt class="literal">level</tt> higher than that of any other system on the
|
---|
2053 | subnet. The values are shown in <a href="ch07.html#samba2-CHP-7-TABLE-2">Table 7-2</a>. The
|
---|
2054 | default level is 20, which means that Samba will win elections
|
---|
2055 | against all versions of Windows, except Windows NT/2000 if it is
|
---|
2056 | operating as the PDC. If you wish Samba to win all elections, you can
|
---|
2057 | set its operating system value as follows:</p>
|
---|
2058 |
|
---|
2059 | <blockquote><pre class="code">[global]
|
---|
2060 | os level = 255</pre></blockquote>
|
---|
2061 |
|
---|
2062 |
|
---|
2063 | </div>
|
---|
2064 |
|
---|
2065 |
|
---|
2066 |
|
---|
2067 | <div class="sect3"><a name="samba2-CHP-7-SECT-2.7.13"/>
|
---|
2068 |
|
---|
2069 | <h3 class="head3">remote browse sync</h3>
|
---|
2070 |
|
---|
2071 | <p>The global <tt class="literal">remote</tt><a name="INDEX-98"/>
|
---|
2072 | <tt class="literal">browse</tt> <tt class="literal">sync</tt> option specifies
|
---|
2073 | that Samba should synchronize its browse lists with local master
|
---|
2074 | browsers in other subnets. However, the synchronization can occur
|
---|
2075 | only with other Samba servers and not with Windows computers. For
|
---|
2076 | example, if your Samba server were a master browser on the subnet
|
---|
2077 | 172.16.235, and Samba local master browsers existed on other subnets
|
---|
2078 | located at 172.16.234.92 and 172.16.236.2, you would specify the
|
---|
2079 | following:</p>
|
---|
2080 |
|
---|
2081 | <blockquote><pre class="code">[global]
|
---|
2082 | remote browse sync = 172.16.234.92 172.16.236.2</pre></blockquote>
|
---|
2083 |
|
---|
2084 | <p>The Samba server would then directly contact the other machines on
|
---|
2085 | the address list and synchronize browse lists. You can also say:</p>
|
---|
2086 |
|
---|
2087 | <blockquote><pre class="code">[global]
|
---|
2088 | remote browse sync = 172.16.234.255 172.16.236.255</pre></blockquote>
|
---|
2089 |
|
---|
2090 | <p>This forces Samba to broadcast queries to determine the IP addresses
|
---|
2091 | of the local master browser on each subnet, with which it will then
|
---|
2092 | synchronize browse lists. This works, however, only if your router
|
---|
2093 | doesn't block directed broadcast requests ending in
|
---|
2094 | 255.</p>
|
---|
2095 |
|
---|
2096 |
|
---|
2097 | </div>
|
---|
2098 |
|
---|
2099 |
|
---|
2100 |
|
---|
2101 | <div class="sect3"><a name="samba2-CHP-7-SECT-2.7.14"/>
|
---|
2102 |
|
---|
2103 | <h3 class="head3">remote announce</h3>
|
---|
2104 |
|
---|
2105 | <p>Samba servers are capable of providing browse lists to foreign
|
---|
2106 | subnets with the <tt class="literal">remote</tt><a name="INDEX-99"/>
|
---|
2107 | <tt class="literal">announce</tt> option. This is typically sent to the
|
---|
2108 | local master browser of the foreign subnet in question. However, if
|
---|
2109 | you do not know the address of the local master browser, you can do
|
---|
2110 | the following:</p>
|
---|
2111 |
|
---|
2112 | <blockquote><pre class="code">[global]
|
---|
2113 | remote announce = 172.16.234.255/ACCOUNTING \
|
---|
2114 | 172.16.236.255/ACCOUNTING</pre></blockquote>
|
---|
2115 |
|
---|
2116 | <p>With this, Samba will broadcast host announcements to all machines on
|
---|
2117 | subnets 172.16.234 and 172.16.236, which will hopefully reach the
|
---|
2118 | local master browser of the subnet.</p>
|
---|
2119 |
|
---|
2120 | <p>You can also specify exact IP addresses, if they are known, but this
|
---|
2121 | works only if the systems are guaranteed to maintain the role of
|
---|
2122 | master browser on their subnets. By appending a workgroup or domain
|
---|
2123 | name to the IP address, Samba announces that it is in that workgroup
|
---|
2124 | or domain. If this is left out, the workgroup set by the
|
---|
2125 | <tt class="literal">workgroup</tt> parameter is used. <a name="INDEX-100"/> <a name="INDEX-101"/><a name="INDEX-102"/></p>
|
---|
2126 |
|
---|
2127 |
|
---|
2128 | </div>
|
---|
2129 |
|
---|
2130 |
|
---|
2131 | </div>
|
---|
2132 |
|
---|
2133 |
|
---|
2134 | </div>
|
---|
2135 |
|
---|
2136 | <hr/><h4 class="head4">Footnotes</h4><blockquote><a name="FOOTNOTE-1"/> <p><a href="#FNPTR-1">[1]</a> As we explained in
|
---|
2137 | <a href="ch01.html">Chapter 1</a>, a system can register under more than
|
---|
2138 | one NetBIOS name. We use the singular here only to keep our
|
---|
2139 | explanation simple.</p> </blockquote><hr/><h4 class="head4"><a href="toc.html">TOC</a></h4></body></html>
|
---|