1<HTML> 2<HEAD> 3<TITLE> 4[Chapter 5] Browsing and Advanced Disk Shares </title><META NAME="DC.title" CONTENT=""><META NAME="DC.creator" CONTENT=""><META NAME="DC.publisher" CONTENT="O'Reilly & Associates, Inc."><META NAME="DC.date" CONTENT="1999-11-05T21:32:41Z"><META NAME="DC.type" CONTENT="Text.Monograph"><META NAME="DC.format" CONTENT="text/html" SCHEME="MIME"><META NAME="DC.source" CONTENT="" SCHEME="ISBN"><META NAME="DC.language" CONTENT="en-US"><META NAME="generator" CONTENT="Jade 1.1/O'Reilly DocBook 3.0 to HTML 4.0"></head> 5<BODY BGCOLOR="#FFFFFF" TEXT="#000000" link="#990000" vlink="#0000CC"> 6<table BORDER="0" CELLPADDING="0" CELLSPACING="0" width="90%"> 7<tr> 8<td width="25%" valign="TOP"> 9<img hspace=10 vspace=10 src="gifs/samba.s.gif" 10alt="Using Samba" align=left valign=top border=0> 11</td> 12<td height="105" valign="TOP"> 13<br> 14<H2>Using Samba</H2> 15<font size="-1"> 16Robert Eckstein, David Collier-Brown, Peter Kelly 17<br>1st Edition November 1999 18<br>1-56592-449-5, Order Number: 4495 19<br>416 pages, $34.95 20</font> 21<p> <a href="http://www.oreilly.com/catalog/samba/">Buy the hardcopy</a> 22<p><a href="index.html">Table of Contents</a> 23</td> 24</tr> 25</table> 26<hr size=1 noshade> 27<!--sample chapter begins --> 28 29<center> 30<DIV CLASS="htmlnav"> 31<TABLE WIDTH="515" BORDER="0" CELLSPACING="0" CELLPADDING="0"> 32<TR> 33<TD ALIGN="LEFT" VALIGN="TOP" WIDTH="172"> 34<A CLASS="sect1" HREF="ch04_08.html" TITLE="4.8 Logging Configuration Options"> 35<IMG SRC="gifs/txtpreva.gif" ALT="Previous: 4.8 Logging Configuration Options" BORDER="0"></a></td><TD ALIGN="CENTER" VALIGN="TOP" WIDTH="171"> 36<B> 37<FONT FACE="ARIEL,HELVETICA,HELV,SANSERIF" SIZE="-1"> 38Chapter 5</font></b></td><TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="172"> 39<A CLASS="sect1" HREF="ch05_02.html" TITLE="5.2 Filesystem Differences"> 40<IMG SRC="gifs/txtnexta.gif" ALT="Next: 5.2 Filesystem Differences" BORDER="0"></a></td></tr></table> <hr noshade size=1></center> 41</div> 42<blockquote> 43<div class="samplechapter"> 44<H1 CLASS="chapter"> 45<A CLASS="title" NAME="ch05-51347"> 465. Browsing and Advanced Disk Shares </a></h1><DIV CLASS="htmltoc"> 47<P> 48<B> 49Contents:</b><br> 50<A CLASS="sect1" HREF="#ch05-23763" TITLE="5.1 Browsing"> 51Browsing</a><br> 52<A CLASS="sect1" HREF="ch05_02.html" TITLE="5.2 Filesystem Differences"> 53Filesystem Differences</a><br> 54<A CLASS="sect1" HREF="ch05_03.html" TITLE="5.3 File Permissions and Attributes on MS-DOS and Unix"> 55File Permissions and Attributes on MS-DOS and Unix</a><br> 56<A CLASS="sect1" HREF="ch05_04.html" TITLE="5.4 Name Mangling and Case"> 57Name Mangling and Case</a><br> 58<A CLASS="sect1" HREF="ch05_05.html" TITLE="5.5 Locks and Oplocks"> 59Locks and Oplocks</a></p><P> 60</p></div><P CLASS="para">This chapter continues our discussion of disk shares from the previous chapter. Here, we will discuss various differences between the Windows and Unix filesystems - and how Samba works to bridge the gap. There are a surprising number of inconsistencies between a DOS filesystem and a Unix filesystem. In addition, we will talk briefly about name mangling, file locking, and a relatively new feature for Samba: opportunistic locking, or oplocks. However, before we move into that territory, we should first discuss the somewhat arcane topic of browsing with Samba.</p><DIV CLASS="sect1"> 61<H2 CLASS="sect1"> 62<A CLASS="title" NAME="s1"></a> 63<A CLASS="title" NAME="ch05-23763"> 645.1 Browsing</a></h2><P CLASS="para"> 65Browsing is the ability to examine the servers and shares that are currently available on your network. On a Windows NT 4.0 or 95/98 client, a user can browse network servers through the Network Neighborhood folder. By double-clicking the icon representing the server, the user should be able to see the printer and disk share resources available on that machine as well. (If you have Windows NT 3.<EM CLASS="emphasis"> 66x</em>, you can use the Disk-Connect Network Drive menu in the File Manager to display the available shares on a server.) </p><P CLASS="para"> 67From the Windows command line, you can also use the <CODE CLASS="literal"> 68net</code> <CODE CLASS="literal"> 69view</code> option to see which servers are currently on the network. Here is an example of the <CODE CLASS="literal"> 70net</code> <CODE CLASS="literal"> 71view</code> command in action:</p><PRE CLASS="programlisting">C:\><CODE CLASS="userinput"><B> net view</b></code> 72Servers available in workgroup SIMPLE 73Server name Remark 74---------------------------------------------------------- 75\\CHIMAERA Windows NT 4.0 76\\HYDRA Samba 2.0.4 on (hydra) 77\\PHOENIX Windows 98</pre><DIV CLASS="sect2"> 78<H3 CLASS="sect2"> 79<A CLASS="title" NAME="ch05-pgfId-962596"> 805.1.1 Preventing Browsing</a></h3><P CLASS="para">You can restrict a share from being in a browse list by using the <CODE CLASS="literal"> 81browseable</code> option. This boolean option prevents a share from being seen in the Network Neighborhood at all. For example, to prevent the <CODE CLASS="literal"> 82[data]</code> share from the previous chapter from being visible, we could write:</p><PRE CLASS="programlisting"> 83[data] 84 path = /home/samba/data 85 browseable = no 86 guest ok = yes 87 comment = Data Drive 88 volume = Sample-Data-Drive 89 writeable = yes</pre><P CLASS="para"> 90Although you typically don't want to do this to an ordinary disk share, the browseable option is useful in the event that you need to create a share with contents that you do not want others to see, such as a <CODE CLASS="literal"> 91[netlogin]</code> share for storing logon scripts for Windows domain control (see <a href="ch06_01.html"><b>Chapter 6, <CITE CLASS="chapter">Users, Security, and Domains</cite></b></a> for more information on logon scripts).</p><P CLASS="para"> 92Another example is the <CODE CLASS="literal"> 93[homes]</code> share. This share is often marked non-browsable so that a share named <CODE CLASS="literal"> 94[homes]</code> won't appear when its machine's resources are browsed. However, if a user <CODE CLASS="literal"> 95alice</code> logs on and looks at the machine's shares, an <CODE CLASS="literal"> 96[alice]</code> share will appear under the machine. What if we wanted to make sure <CODE CLASS="literal"> 97alice</code>'s share appeared to everyone before she logs in? This could be done with the global <CODE CLASS="literal"> 98auto</code> <CODE CLASS="literal"> 99services</code> option. This option preloads shares into the browse list to ensure that they are always visible: </p><PRE CLASS="programlisting"> 100[global] 101 ... 102 auto services = alice 103 ...</pre></div><DIV CLASS="sect2"> 104<H3 CLASS="sect2"> 105<A CLASS="title" NAME="ch05-pgfId-962409"> 1065.1.2 Default Services</a></h3><P CLASS="para"> 107In the event that a user cannot successfully connect to a share, you can specify a default share to which they can connect. Since you do not know who will default to this share at any time, you will probably want to set the <CODE CLASS="literal"> 108guest</code> <CODE CLASS="literal"> 109ok</code> option to <CODE CLASS="literal"> 110yes</code> for this share. Specifying a <CODE CLASS="literal"> 111default</code> <CODE CLASS="literal"> 112service</code> can be useful when sending the utterly befuddled to a directory of help files. For example:</p><PRE CLASS="programlisting"> 113[global] 114 ... 115 default service = helpshare 116 ... 117 118[helpshare] 119 path = /home/samba/helpshare/%S 120 browseable = yes 121 guest ok = yes 122 comment = Default Share for Unsuccessful Connections 123 volume = Sample-Data-Drive 124 writeable = no</pre><P CLASS="para"> 125Note that we used the <CODE CLASS="literal"> 126%S</code> variable in the <CODE CLASS="literal"> 127path</code> option. If you use the <CODE CLASS="literal"> 128%S</code> variable, it will refer to the requested nonexistent share (the original share requested by the user), not the name of the resulting default share. This allows us to create different paths with the names of each server, which can provide more customized help files for users. In addition, any underscores (_) specified in the requested share will be converted to slashes (/) when the <CODE CLASS="literal"> 129%S</code> variable is used.</p></div><DIV CLASS="sect2"> 130<H3 CLASS="sect2"> 131<A CLASS="title" NAME="ch05-pgfId-969505"> 1325.1.3 Browsing Elections</a></h3><P CLASS="para">As mentioned in <a href="ch01_01.html"><b>Chapter 1, <CITE CLASS="chapter">Learning the Samba</cite></b></a>, one machine in each subnet always keeps a list of the currently active machines. This list is called the <I CLASS="firstterm"> 133browse list</i> and the server that maintains it is called the <I CLASS="firstterm">local master browser</i>. As machines come on and off the network, the local master browser continually updates the information in the browse list and provides it to any machine that requests it.</p><P CLASS="para"> 134A computer becomes a local master browser by holding a browsing election on the local subnet. Browsing elections can be called at any time. Samba can rig a browsing election for a variety of outcomes, including always becoming the local master browser of the subnet or never becoming it. For example, the following options, which we've added to the configuration file from <a href="ch04_01.html"><b>Chapter 4, <CITE CLASS="chapter">Disk Shares</cite></b></a>, will ensure that Samba always wins the election for local master browser no matter which machines are also present:</p><PRE CLASS="programlisting"> 135[global] 136 netbios name = HYDRA 137 server string = Samba %v on (%L) 138 workgroup = SIMPLE 139 140 # Browsing election options 141 os level = 34 142 local master = yes 143 144 # Networking configuration options 145 hosts allow = 192.168.220. 134.213.233. localhost 146 hosts deny = 192.168.220.102 147 interfaces = 192.168.220.100/255.255.255.0 \ 148 134.213.233.110/255.255.255.0 149 150 # Debug logging information 151 log level = 2 152 log file = /var/log/samba.log.%m 153 max log size = 50 154 debug timestamp = yes 155 156[data] 157 path = /home/samba/data 158 browseable = yes 159 guest ok = yes 160 comment = Data Drive 161 volume = Sample-Data-Drive 162 writable = yes</pre><P CLASS="para"> 163However, what if we didn't always want to win the election? What if we wanted to yield browsing to a Windows NT Server if present? In order to do that, we need to learn how browsing elections work. As you already know, each machine that takes place in the election must broadcast information about itself. This information includes the following:</p><UL CLASS="itemizedlist"> 164<LI CLASS="listitem"> 165<P CLASS="para"> 166<A CLASS="listitem" NAME="ch05-pgfId-962259"> 167</a>The version of the election protocol used</p></li><LI CLASS="listitem"> 168<P CLASS="para"> 169<A CLASS="listitem" NAME="ch05-pgfId-962260"> 170</a>The operating system on the machine</p></li><LI CLASS="listitem"> 171<P CLASS="para"> 172<A CLASS="listitem" NAME="ch05-pgfId-962261"> 173</a>The amount of time the client has been on the network</p></li><LI CLASS="listitem"> 174<P CLASS="para"> 175<A CLASS="listitem" NAME="ch05-pgfId-962267"> 176</a>The hostname of the client</p></li></ul><P CLASS="para"> 177Here is how the election is decided. Operating systems are assigned a binary value according to their version, as shown in <A CLASS="xref" HREF="ch05_01.html#ch05-51423"> 178Table 5.1</a>. </p><br> 179<TABLE CLASS="table" BORDER="1" CELLPADDING="3"> 180<CAPTION CLASS="table"> 181<A CLASS="title" NAME="ch05-51423"> 182Table 5.1: Operating System Values in an Election </a></caption><THEAD CLASS="thead"> 183<TR CLASS="row" VALIGN="TOP"> 184<TH CLASS="entry" ALIGN="LEFT" ROWSPAN="1" COLSPAN="1"> 185<P CLASS="para"> 186Operating System</p></th><TH CLASS="entry" ALIGN="LEFT" ROWSPAN="1" COLSPAN="1"> 187<P CLASS="para"> 188Value</p></th></tr></thead><TBODY CLASS="tbody"> 189<TR CLASS="row" VALIGN="TOP"> 190<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 191<P CLASS="para">Windows NT Server 4.0</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 192<P CLASS="para"> 19333</p></td></tr><TR CLASS="row" VALIGN="TOP"> 194<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 195<P CLASS="para"> 196Windows NT Server 3.51</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 197<P CLASS="para"> 19832</p></td></tr><TR CLASS="row" VALIGN="TOP"> 199<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 200<P CLASS="para"> 201Windows NT Workstation 4.0</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 202<P CLASS="para"> 20317</p></td></tr><TR CLASS="row" VALIGN="TOP"> 204<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 205<P CLASS="para"> 206Windows NT Workstation 3.51</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 207<P CLASS="para"> 20816</p></td></tr><TR CLASS="row" VALIGN="TOP"> 209<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 210<P CLASS="para"> 211Windows 98</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 212<P CLASS="para"> 2132</p></td></tr><TR CLASS="row" VALIGN="TOP"> 214<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 215<P CLASS="para"> 216Windows 95</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 217<P CLASS="para"> 2181</p></td></tr><TR CLASS="row" VALIGN="TOP"> 219<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 220<P CLASS="para"> 221Windows 3.1 for Workgroups</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 222<P CLASS="para"> 2231</p></td></tr></tbody></table><P CLASS="para"> 224Following that, each computer on the network is assigned a separate value according to its role, as shown in <A CLASS="xref" HREF="ch05_01.html#ch05-pgfId-962213"> 225Table 5.2</a>. </p><br> 226<TABLE CLASS="table" BORDER="1" CELLPADDING="3"> 227<CAPTION CLASS="table"> 228<A CLASS="title" NAME="ch05-pgfId-962213"> 229Table 5.2: Computer Role Settings in an Election </a></caption><THEAD CLASS="thead"> 230<TR CLASS="row" VALIGN="TOP"> 231<TH CLASS="entry" ALIGN="LEFT" ROWSPAN="1" COLSPAN="1"> 232<P CLASS="para"> 233Role</p></th><TH CLASS="entry" ALIGN="LEFT" ROWSPAN="1" COLSPAN="1"> 234<P CLASS="para"> 235Value</p></th></tr></thead><TBODY CLASS="tbody"> 236<TR CLASS="row" VALIGN="TOP"> 237<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 238<P CLASS="para">Primary Domain Controller</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 239<P CLASS="para"> 240128</p></td></tr><TR CLASS="row" VALIGN="TOP"> 241<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 242<P CLASS="para"> 243WINS Client</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 244<P CLASS="para"> 24532</p></td></tr><TR CLASS="row" VALIGN="TOP"> 246<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 247<P CLASS="para"> 248Preferred Master Browser</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 249<P CLASS="para"> 2508</p></td></tr><TR CLASS="row" VALIGN="TOP"> 251<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 252<P CLASS="para"> 253Active Master Browser</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 254<P CLASS="para"> 2554</p></td></tr><TR CLASS="row" VALIGN="TOP"> 256<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 257<P CLASS="para"> 258Standby Browser</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 259<P CLASS="para"> 2602</p></td></tr><TR CLASS="row" VALIGN="TOP"> 261<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 262<P CLASS="para"> 263Active Backup Browser</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 264<P CLASS="para"> 2651</p></td></tr></tbody></table><P CLASS="para">Elections are decided in the following order:</p><OL CLASS="orderedlist"> 266<LI CLASS="listitem"> 267<P CLASS="para"> 268<A CLASS="listitem" NAME="ch05-pgfId-962245"> 269</a>The machine with the highest version of the election protocol will win. (So far, this is meaningless, as all Windows clients have version 1 of the election protocol.)</p></li><LI CLASS="listitem"> 270<P CLASS="para"> 271<A CLASS="listitem" NAME="ch05-pgfId-962246"> 272</a>The machine with the highest operating system value wins the election.</p></li><LI CLASS="listitem"> 273<P CLASS="para"> 274<A CLASS="listitem" NAME="ch05-pgfId-962247"> 275</a>If there is a tie, the machine with the setting of Preferred Master Browser (role 8) wins the election.</p></li><LI CLASS="listitem"> 276<P CLASS="para"> 277<A CLASS="listitem" NAME="ch05-pgfId-962248"> 278</a>If there is still a tie, the client who has been online the longest wins the election.</p></li><LI CLASS="listitem"> 279<P CLASS="para"> 280<A CLASS="listitem" NAME="ch05-pgfId-962282"> 281</a>And finally, if there is still a tie, the client name that comes first alphabetically wins.</p></li><LI CLASS="listitem"> 282<P CLASS="para"> 283<A CLASS="listitem" NAME="ch05-pgfId-969905"> 284</a>The machine that is the "runner-up" can become a backup browser.</p></li></ol><P CLASS="para"> 285As a result, if you want Samba to take the role of a local master browser, but only if there isn't a Windows NT Server (4.0 or 3.51) on the network, you could change the <CODE CLASS="literal"> 286os</code> <CODE CLASS="literal"> 287level</code> parameter in the previous example to:</p><PRE CLASS="programlisting"> 288os level = 31</pre><P CLASS="para"> 289This will cause Samba to immediately lose the election to a Windows NT 4.0 or Windows NT 3.5 Server, both of which have a higher operating systems level. On the other hand, if you wanted to decide the local master browser on the basis of the network role, such as which machine is the primary domain controller, you could set the <CODE CLASS="literal"> 290os</code> <CODE CLASS="literal"> 291level</code> to match the highest type of operating system on the network and let the election protocol fall down to the next level.</p><P CLASS="para">How can you can tell if a machine is a local master browser? By using the <CODE CLASS="literal"> 292nbtstat</code> command. Place the NetBIOS name of the machine you wish to check after the <CODE CLASS="literal"> 293-a</code> option:</p><PRE CLASS="programlisting">C:\><CODE CLASS="userinput"><B> nbtstat -a hydra</b></code> 294 295 NetBIOS Remote Machine Name Table 296 297 Name Type Status 298---------------------------------------------------------- 299 HYDRA <00> UNIQUE Registered 300 HYDRA <03> UNIQUE Registered 301 HYDRA <20> UNIQUE Registered 302 ..__MSBROWSE__. <01> GROUP Registered 303 SIMPLE <00> GROUP Registered 304 SIMPLE <1D> UNIQUE Registered 305 SIMPLE <1E> GROUP Registered 306 307 MAC Address = 00-00-00-00-00-00</pre><P CLASS="para"> 308The resource entry that you're looking for is the <CODE CLASS="literal"> 309..__MSBROWSE__.<01></code>. This indicates that the server is currently acting as the local master browser for the current subnet. In addition, if the machine is a Samba server, you can check the Samba <I CLASS="filename"> 310nmbd</i> log file for an entry such as:</p><PRE CLASS="programlisting"> 311nmbd/nmbd_become_lmb.c:become_local_master_stage2(406) 312***** 313Samba name server HYDRA is now a local master browser for 314workgroup SIMPLE on subnet 192.168.220.100 315****</pre><P CLASS="para"> 316Finally, Windows NT servers serving as primary domain controllers contain a sneak that allows them to assume the role of the local master browser in certain conditions; this is called the <EM CLASS="emphasis"> 317preferred</em> <EM CLASS="emphasis"> 318master browser</em> bit. Earlier, we mentioned that Samba could set this bit on itself as well. You can enable it with the <CODE CLASS="literal"> 319preferred</code> <CODE CLASS="literal"> 320master</code> option:</p><PRE CLASS="programlisting"> 321# Browsing election options 322os level = 33 323local master = yes 324preferred master = yes</pre><P CLASS="para"> 325If the preferred master bit is set, the machine will force a browsing election at startup. Of course, this is needed only if you set the <CODE CLASS="literal"> 326os</code> <CODE CLASS="literal"> 327level</code> option to match the Windows NT machine. We recommend that you don't use this option if another machine also has the role of preferred master, such as an NT server. </p></div><DIV CLASS="sect2"> 328<H3 CLASS="sect2"> 329<A CLASS="title" NAME="ch05-pgfId-962289"> 3305.1.4 Domain Master Browser</a></h3><P CLASS="para">In the opening chapter, we mentioned that in order for a Windows workgroup or domain to extend into multiple subnets, one machine would have to take the role of the <I CLASS="firstterm"> 331domain master browser</i>. The domain master browser propagates browse lists across each of the subnets in the workgroup. This works because each local master browser periodically synchronizes its browse list with the domain master browser. During this synchronization, the local master browser passes on any server that the domain master browser does not have in its browse list, and vice versa. In a perfect world, each local master browser would eventually have the browse list for the entire domain.</p><P CLASS="para"> 332Unlike the local master browser, there is no election to determine which machine assumes the role of the domain master browser. Instead, the administrator has to set it manually. By Microsoft design, however, the domain master browser and the primary domain controller (PDC) both register a resource type of <1B>, so the roles - and the machines - are inseparable. </p><P CLASS="para"> 333If you have a Windows NT server on the network acting as a PDC, we recommend that you do not use Samba to become the domain master browser. The reverse is true as well: if Samba is taking on the responsibilities of a PDC, we recommend making it the domain master browser as well. Although it is possible to split the roles with Samba, this is not a good idea. Using two different machines to serve as the PDC and the domain master browser can cause random errors to occur on a Windows workgroup.</p><P CLASS="para"> 334Samba can assume the role of a domain master browser for all subnets in the workgroup with the following option:</p><PRE CLASS="programlisting"> 335domain master = yes</pre><P CLASS="para"> 336You can verify that a Samba machine is in fact the domain master browser by checking the <EM CLASS="emphasis"> 337nmbd</em> log file:</p><PRE CLASS="programlisting"> 338nmbd/nmbd_become_dmb.c:become_domain_master_stage2(118) 339***** 340Samba name server HYDRA is now a domain master browser for 341workgroup SIMPLE on subnet 192.168.220.100 342*****</pre><P CLASS="para"> 343Or you can use the <CODE CLASS="literal">nmblookup</code> command that comes with the Samba distribution to query for a unique <1B> resource type in the workgroup:</p><PRE CLASS="programlisting"># <CODE CLASS="userinput"><B>nmblookup SIMPLE#1B</b></code> 344Sending queries to 192.168.220.255 345192.168.220.100 SIMPLE<1b></pre><DIV CLASS="sect3"> 346<H4 CLASS="sect3"> 347<A CLASS="title" NAME="ch05-pgfId-963109"> 3485.1.4.1 Multiple subnets</a></h4><P CLASS="para">There are three rules that you must remember when creating a workgroup/domain that spans more than one subnet:</p><UL CLASS="itemizedlist"> 349<LI CLASS="listitem"> 350<P CLASS="para"> 351<A CLASS="listitem" NAME="ch05-pgfId-962339"> 352</a>You must have either a Windows NT or Samba machine acting as a local master browser on each subnet in the workgroup/domain. (If you have a domain master browser in a subnet, a local master browser is not needed.)</p></li><LI CLASS="listitem"> 353<P CLASS="para"> 354<A CLASS="listitem" NAME="ch05-pgfId-962340"> 355</a>You must have a Windows NT Server or a Samba machine acting as a domain master browser somewhere in the workgroup.</p></li><LI CLASS="listitem"> 356<P CLASS="para"> 357<A CLASS="listitem" NAME="ch05-pgfId-962343"> 358</a>Each local master browser must be instructed to synchronize with the domain master browser.</p></li></ul><P CLASS="para"> 359Samba has a few other features in this arena in the event that you don't have or want a domain master browser on your network. Consider the subnets shown in <A CLASS="xref" HREF="ch05_01.html#ch05-15706"> 360Figure 5.1</a>. </p><H4 CLASS="figure"> 361<A CLASS="title" NAME="ch05-15706"> 362Figure 5.1: Multiple subnets with Samba servers</a></h4><IMG CLASS="graphic" SRC="figs/sam.0501.gif" ALT="Figure 5.1"><P CLASS="para"> 363First, a Samba server that is a local master browser can use the <CODE CLASS="literal"> 364remote</code> <CODE CLASS="literal"> 365announce</code> configuration option to make sure that computers in different subnets are sent broadcast announcements about the server. This has the effect of ensuring that the Samba server appears in the browse lists of foreign subnets. To achieve this, however, the directed broadcasts must reach the local master browser on the other subnet. Be aware that many routers do not allow directed broadcasts by default; you may have to change this setting on the router for the directed broadcasts to get through to its subnet.</p><P CLASS="para"> 366With the <CODE CLASS="literal"> 367remote</code> <CODE CLASS="literal"> 368announce</code> option, list the subnets and the workgroup that should receive the broadcast. For example, to ensure that machines in the 192.168.221 and 192.168.222 subnets and SIMPLE workgroup are sent broadcast information from our Samba server, we could specify the following:</p><PRE CLASS="programlisting"> 369# Browsing election options 370os level = 34 371local master = yes 372remote announce = 192.168.221.255/SIMPLE \ 373 192.168.222.255/SIMPLE</pre><P CLASS="para"> 374In addition, you are allowed to specify the exact address to send broadcasts to if the local master browser on the foreign subnet is guaranteed to always have a fixed IP address.</p><P CLASS="para"> 375A Samba local master browser can synchronize its browse list directly with another Samba server acting as a local master browser on a different subnet. For example, let's assume that Samba is configured as a local master browser, and Samba local master browsers exist at 192.168.221.130 and 192.168.222.120. We can use the <CODE CLASS="literal"> 376remote</code> <CODE CLASS="literal"> 377browse</code> <CODE CLASS="literal"> 378sync</code> option to sync directly with the Samba servers, as follows:</p><PRE CLASS="programlisting"> 379# Browsing election options 380os level = 34 381local master = yes 382remote browse sync = 192.168.221.130 192.168.222.120</pre><P CLASS="para"> 383In order for this to work, the other Samba machines must also be local master browsers. You can also use directed broadcasts with this option if you do not know specific IP addresses of local master browsers. </p></div></div><DIV CLASS="sect2"> 384<H3 CLASS="sect2"> 385<A CLASS="title" NAME="ch05-pgfId-969941"> 3865.1.5 Browsing Options</a></h3><P CLASS="para"> 387<A CLASS="xref" HREF="ch05_01.html#ch05-81028">Table 5.3</a> shows 14 options that define how Samba handles browsing tasks. We recommend the defaults for a site that prefers to be easy on its users with respect to locating shares and printers. </p><br> 388<TABLE CLASS="table" BORDER="1" CELLPADDING="3"> 389<CAPTION CLASS="table"> 390<A CLASS="title" NAME="ch05-81028"> 391Table 5.3: Browsing Configuration Options </a></caption><THEAD CLASS="thead"> 392<TR CLASS="row" VALIGN="TOP"> 393<TH CLASS="entry" ALIGN="LEFT" ROWSPAN="1" COLSPAN="1"> 394<P CLASS="para"> 395Option</p></th><TH CLASS="entry" ALIGN="LEFT" ROWSPAN="1" COLSPAN="1"> 396<P CLASS="para"> 397Parameters</p></th><TH CLASS="entry" ALIGN="LEFT" ROWSPAN="1" COLSPAN="1"> 398<P CLASS="para"> 399Function</p></th><TH CLASS="entry" ALIGN="LEFT" ROWSPAN="1" COLSPAN="1"> 400<P CLASS="para"> 401Default</p></th><TH CLASS="entry" ALIGN="LEFT" ROWSPAN="1" COLSPAN="1"> 402<P CLASS="para"> 403Scope</p></th></tr></thead><TBODY CLASS="tbody"> 404<TR CLASS="row" VALIGN="TOP"> 405<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 406<P CLASS="para"> 407<CODE CLASS="literal"> 408announce as</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 409<P CLASS="para"> 410<CODE CLASS="literal"> 411NT</code> or <CODE CLASS="literal"> 412Win95</code> or <CODE CLASS="literal"> 413WfW</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 414<P CLASS="para"> 415Sets the operating system that Samba will announce itself as.</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 416<P CLASS="para"> 417<CODE CLASS="literal"> 418NT</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 419<P CLASS="para"> 420Global</p></td></tr><TR CLASS="row" VALIGN="TOP"> 421<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 422<P CLASS="para"> 423<CODE CLASS="literal"> 424announce version</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 425<P CLASS="para"> 426numerical</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 427<P CLASS="para"> 428Sets the version of the operating system that Samba will announce itself as.</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 429<P CLASS="para"> 430<CODE CLASS="literal"> 4314.2</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 432<P CLASS="para"> 433Global</p></td></tr><TR CLASS="row" VALIGN="TOP"> 434<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 435<P CLASS="para"> 436<CODE CLASS="literal"> 437browseable (browsable)</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 438<P CLASS="para"> 439boolean</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 440<P CLASS="para"> 441Allows share to be displayed in list of machine resources.</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 442<P CLASS="para"> 443<CODE CLASS="literal"> 444yes</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 445<P CLASS="para"> 446Share</p></td></tr><TR CLASS="row" VALIGN="TOP"> 447<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 448<P CLASS="para"> 449<CODE CLASS="literal"> 450browse list</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 451<P CLASS="para"> 452boolean</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 453<P CLASS="para"> 454If <CODE CLASS="literal"> 455yes</code>, Samba will provide a browse list on this server.</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 456<P CLASS="para"> 457<CODE CLASS="literal"> 458yes</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 459<P CLASS="para"> 460Global</p></td></tr><TR CLASS="row" VALIGN="TOP"> 461<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 462<P CLASS="para"> 463<CODE CLASS="literal"> 464auto services (preload)</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 465<P CLASS="para"> 466string (share list)</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 467<P CLASS="para"> 468Sets a list of shares that will always appear in the browse list.</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 469<P CLASS="para"> 470None</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 471<P CLASS="para"> 472Global</p></td></tr><TR CLASS="row" VALIGN="TOP"> 473<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 474<P CLASS="para"> 475<CODE CLASS="literal"> 476default service (default)</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 477<P CLASS="para"> 478string (share name)</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 479<P CLASS="para"> 480Names a share (service) that will be provided if the client requests a share not listed in <EM CLASS="emphasis"> 481smb.conf.</em></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 482<P CLASS="para"> 483None</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 484<P CLASS="para"> 485Global</p></td></tr><TR CLASS="row" VALIGN="TOP"> 486<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 487<P CLASS="para"> 488<CODE CLASS="literal"> 489local master</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 490<P CLASS="para"> 491boolean</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 492<P CLASS="para"> 493If <CODE CLASS="literal"> 494yes</code>, Samba will try to become a master browser on the local subnet.</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 495<P CLASS="para"> 496<CODE CLASS="literal"> 497yes</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 498<P CLASS="para"> 499Global</p></td></tr><TR CLASS="row" VALIGN="TOP"> 500<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 501<P CLASS="para"> 502<CODE CLASS="literal"> 503lm announce</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 504<P CLASS="para"> 505<CODE CLASS="literal"> 506yes</code> or <CODE CLASS="literal"> 507no</code> or <CODE CLASS="literal"> 508auto</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 509<P CLASS="para"> 510Enables or disables LAN Manager style host announcements.</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 511<P CLASS="para"> 512<CODE CLASS="literal"> 513auto</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 514<P CLASS="para"> 515Global</p></td></tr><TR CLASS="row" VALIGN="TOP"> 516<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 517<P CLASS="para"> 518<CODE CLASS="literal"> 519lm interval</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 520<P CLASS="para"> 521numerical</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 522<P CLASS="para"> 523Specifies the frequency in seconds that LAN Manager announcements will be made if activated.</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 524<P CLASS="para"> 525<CODE CLASS="literal"> 52660</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 527<P CLASS="para"> 528Global</p></td></tr><TR CLASS="row" VALIGN="TOP"> 529<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 530<P CLASS="para"> 531<CODE CLASS="literal"> 532preferred master (prefered master)</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 533<P CLASS="para"> 534boolean</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 535<P CLASS="para"> 536If <CODE CLASS="literal"> 537yes</code>, Samba will use the preferred master browser bit to attempt to become the local master browser.</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 538<P CLASS="para"> 539<CODE CLASS="literal"> 540no</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 541<P CLASS="para"> 542Global</p></td></tr><TR CLASS="row" VALIGN="TOP"> 543<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 544<P CLASS="para"> 545<CODE CLASS="literal"> 546domain master</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 547<P CLASS="para"> 548boolean</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 549<P CLASS="para"> 550If <CODE CLASS="literal"> 551yes</code>, Samba will try to become the main browser master for the workgroup.</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 552<P CLASS="para"> 553<CODE CLASS="literal"> 554no</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 555<P CLASS="para"> 556Global</p></td></tr><TR CLASS="row" VALIGN="TOP"> 557<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 558<P CLASS="para"> 559<CODE CLASS="literal"> 560os level</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 561<P CLASS="para"> 562numerical</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 563<P CLASS="para"> 564Sets the operating system level of Samba in an election for local master browser.</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 565<P CLASS="para"> 566<CODE CLASS="literal"> 5670</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 568<P CLASS="para"> 569Global</p></td></tr><TR CLASS="row" VALIGN="TOP"> 570<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 571<P CLASS="para"> 572<CODE CLASS="literal"> 573remote browse sync</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 574<P CLASS="para"> 575string (list of IP addresses)</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 576<P CLASS="para"> 577Lists Samba servers to synchronize browse lists with.</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 578<P CLASS="para"> 579None</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 580<P CLASS="para"> 581Global</p></td></tr><TR CLASS="row" VALIGN="TOP"> 582<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 583<P CLASS="para"> 584<CODE CLASS="literal"> 585remote announce</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 586<P CLASS="para"> 587string (IP address/ workgroup pairs)</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 588<P CLASS="para"> 589Lists subnets and workgroups to send directed broadcast packets to, allowing Samba to appear to browse lists.</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 590<P CLASS="para"> 591None</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 592<P CLASS="para"> 593Global</p></td></tr></tbody></table><DIV CLASS="sect3"> 594<H4 CLASS="sect3"> 595<A CLASS="title" NAME="ch05-pgfId-959886"> 5965.1.5.1 announce as</a></h4><P CLASS="para"> 597This global configuration option specifies the type of operating system that Samba will announce to other machines on the network. The default value for this option is <CODE CLASS="literal"> 598NT</code>, which represents a Windows NT operating system. Other possible values are <CODE CLASS="literal"> 599Win95</code>, which represents a Windows 95 operating system, and <CODE CLASS="literal"> 600WfW</code> for a Windows for Workgroup operating system. You can override the default value with the following:</p><PRE CLASS="programlisting"> 601[global] 602 announce as = Win95</pre><P CLASS="para"> 603We recommend against changing the default value of this configuration option.</p></div><DIV CLASS="sect3"> 604<H4 CLASS="sect3"> 605<A CLASS="title" NAME="ch05-pgfId-959896"> 6065.1.5.2 announce version</a></h4><P CLASS="para"> 607This global option is frequently used with the <CODE CLASS="literal"> 608announce</code> <CODE CLASS="literal"> 609as</code> configuration option; it specifies the version of the operating system that Samba will announce to other machines on the network. The default value of this options is 4.2, which places itself above the current Windows NT version of 4.0. You can specify a new value with a global entry such as the following:</p><PRE CLASS="programlisting"> 610[global] 611 announce version = 4.3</pre><P CLASS="para"> 612We recommend against changing the default value of this configuration option.</p></div><DIV CLASS="sect3"> 613<H4 CLASS="sect3"> 614<A CLASS="title" NAME="ch05-38345"> 6155.1.5.3 browseable</a></h4><P CLASS="para"> 616The <CODE CLASS="literal"> 617browseable</code> option (also spelled <CODE CLASS="literal"> 618browsable</code>) indicates whether the share referenced should appear in the list of available resources of the machine on which it resides. This option is always set to <CODE CLASS="literal"> 619yes</code> by default. If you wish to prevent the share from being seen in a client's browser, you can reset this option to <CODE CLASS="literal"> 620no</code>.</p><P CLASS="para"> 621Note that this does not prevent someone from accessing the share using other means, such as specifying a UNC location (<CODE CLASS="literal">//server/accounting)</code> in Windows Explorer. It only prevents the share from being listed under the machine's resources when being browsed.</p></div><DIV CLASS="sect3"> 622<H4 CLASS="sect3"> 623<A CLASS="title" NAME="ch05-pgfId-959474"> 6245.1.5.4 browse list</a></h4><P CLASS="para">You should never need to change this parameter from its default value of <CODE CLASS="literal"> 625yes</code>. If your Samba server is acting as a local master browser (i.e., it has won the browsing election), you can use the global <CODE CLASS="literal"> 626browse</code> <CODE CLASS="literal"> 627list</code> option to instruct Samba to provide or withhold its browse list to all clients. By default, Samba always provides a browse list. You can withhold this information by specifying the following:</p><PRE CLASS="programlisting"> 628[global] 629 browse list = no</pre><P CLASS="para"> 630If you disable the browse list, clients cannot browse the names of other machines, their services, and other domains currently available on the network. Note that this won't make any particular machine inaccessible; if someone knows a valid machine name/address and a share on that machine, they can still connect to it explicitly using NET USE or by mapping a drive letter to it using Windows Explorer. It simply prevents information in the browse list from being retrieved by any client that requests it.</p></div><DIV CLASS="sect3"> 631<H4 CLASS="sect3"> 632<A CLASS="title" NAME="ch05-pgfId-957885"> 6335.1.5.5 auto services</a></h4><P CLASS="para"> 634The global <CODE CLASS="literal"> 635auto</code> <CODE CLASS="literal"> 636services</code> option, which is also called <CODE CLASS="literal"> 637preload</code>, ensures that the specified shares are always visible in the browse list. One common use for this option is to advertise specific user or printer shares that are created by the <CODE CLASS="literal"> 638[homes]</code> or <CODE CLASS="literal"> 639[printers]</code> shares, but are not otherwise browsable.</p><P CLASS="para"> 640This option works best with disk shares. If you wish to force each of your system printers (i.e., those listed in the printer capabilities file) into the browse list using this option, we recommend using the <CODE CLASS="literal"> 641load</code> <CODE CLASS="literal"> 642printers</code> option instead. Any shares listed with the <CODE CLASS="literal"> 643auto</code> <CODE CLASS="literal"> 644services</code> option will not be displayed if the <CODE CLASS="literal"> 645browse</code> <CODE CLASS="literal"> 646list</code> option is set to <CODE CLASS="literal"> 647no</code>.</p></div><DIV CLASS="sect3"> 648<H4 CLASS="sect3"> 649<A CLASS="title" NAME="ch05-pgfId-962615"> 6505.1.5.6 default service</a></h4><P CLASS="para"> 651The global <CODE CLASS="literal"> 652default</code> <CODE CLASS="literal"> 653service</code> option (sometimes called <CODE CLASS="literal"> 654default</code>) names a "last-ditch" share. If set to an existing share name, and a client requests a nonexistent disk or printer share, Samba will attempt to connect the user to the share specified by this option instead. The option is specified as follows:</p><PRE CLASS="programlisting"> 655default service = helpshare</pre><P CLASS="para"> 656Note that there are no braces surrounding the share name <CODE CLASS="literal"> 657helpshare</code>, even though the definition of the share later in the Samba configuration file will have braces. Also, if you use the <CODE CLASS="literal"> 658%S</code> variable in the share specified by this option, it will represent the requested, nonexistent share, not the default service. Any underscores (<CODE CLASS="literal">_</code>) specified in the request share will be converted to slashes (<CODE CLASS="literal">/</code>) when the variable is used.</p></div><DIV CLASS="sect3"> 659<H4 CLASS="sect3"> 660<A CLASS="title" NAME="ch05-pgfId-957903"> 6615.1.5.7 local master</a></h4><P CLASS="para">This global option specifies whether Samba will attempt to become the local master browser for the subnet when it starts up. If this option is set to <CODE CLASS="literal"> 662yes</code>, Samba will take place in elections. However, setting this option by itself does not guarantee victory. (Other parameters, such as <CODE CLASS="literal"> 663preferred</code> <CODE CLASS="literal"> 664master</code> and <CODE CLASS="literal"> 665os</code> <CODE CLASS="literal"> 666level</code> help Samba win browsing elections.) If this option is set to <CODE CLASS="literal"> 667no</code>, Samba will lose all browsing elections, no matter which values are specified by the other configuration options. The default value is <CODE CLASS="literal"> 668yes</code>.</p></div><DIV CLASS="sect3"> 669<H4 CLASS="sect3"> 670<A CLASS="title" NAME="ch05-pgfId-957907"> 6715.1.5.8 lm announce</a></h4><P CLASS="para"> 672The global <CODE CLASS="literal"> 673lm</code> <CODE CLASS="literal"> 674announce</code> option tells Samba's <EM CLASS="emphasis"> 675nmbd</em> whether or not to send LAN Manager host announcements on behalf of the server. These host announcements may be required by older clients, such as IBM's OS/2 operating system. This announcement allows the server to be added to the browse lists of the client. If activated, Samba will announce itself repetitively at the number of seconds specified by the <CODE CLASS="literal"> 676lm</code> <CODE CLASS="literal"> 677interval</code> option.</p><P CLASS="para"> 678This configuration option takes the standard boolean values, <CODE CLASS="literal"> 679yes</code> and <CODE CLASS="literal"> 680no</code>, which engage or disengage LAN Manager announcements, respectively. In addition, there is a third option, <CODE CLASS="literal"> 681auto</code>, which causes <EM CLASS="emphasis"> 682nmbd</em> to passively listen for LAN Manager announcements, but not send any of its own initially. If LAN Manager announcements are detected for another machine on the network, <EM CLASS="emphasis"> 683nmbd</em> will start sending its own LAN Manager announcements to ensure that it is visible. You can specify the option as follows:</p><PRE CLASS="programlisting"> 684[global] 685 lm announce = yes</pre><P CLASS="para"> 686The default value is <CODE CLASS="literal"> 687auto</code>. You probably won't need to change this value from its default.</p></div><DIV CLASS="sect3"> 688<H4 CLASS="sect3"> 689<A CLASS="title" NAME="ch05-pgfId-959967"> 6905.1.5.9 lm interval</a></h4><P CLASS="para"> 691This option, which is used in conjunction with <CODE CLASS="literal"> 692lm</code> <CODE CLASS="literal"> 693announce</code>, indicates the number of seconds <EM CLASS="emphasis"> 694nmbd</em> will wait before repeatedly broadcasting LAN Manager-style announcements. Remember that LAN Manager announcements must be activated in order for this option to be used. The default value is 60 seconds. If you set this value to 0, Samba will not send any LAN Manager host announcements, no matter what the value of the <CODE CLASS="literal"> 695lm</code> <CODE CLASS="literal"> 696announce</code> option. You can reset the value of this option as follows:</p><PRE CLASS="programlisting"> 697[global] 698 lm interval = 90</pre></div><DIV CLASS="sect3"> 699<H4 CLASS="sect3"> 700<A CLASS="title" NAME="ch05-pgfId-959947"> 7015.1.5.10 preferred master</a></h4><P CLASS="para"> 702The <CODE CLASS="literal"> 703preferred</code> <CODE CLASS="literal"> 704master</code> option requests that Samba set the preferred master bit when participating in an election. This gives the server a higher preferred status in the workgroup than other machines at the same operating system level. If you are configuring your Samba machine to become the local master browser, it is wise to set the following value:</p><PRE CLASS="programlisting"> 705[global] 706 preferred master = yes</pre><P CLASS="para"> 707Otherwise, you should leave it set to its default, <CODE CLASS="literal"> 708no</code>. If Samba is configured as a preferred master browser, it will force an election when it first comes online.</p></div><DIV CLASS="sect3"> 709<H4 CLASS="sect3"> 710<A CLASS="title" NAME="ch05-pgfId-957912"> 7115.1.5.11 os level</a></h4><P CLASS="para"> 712The global <CODE CLASS="literal"> 713os</code> <CODE CLASS="literal"> 714level</code> option dictates the operating system level at which Samba will masquerade during a browser election. If you wish to have Samba win an election and become the master browser, you can set the level above that of the operating system on your network with the highest current value. The values are shown in Table 5-1. The default level is 0, which means that Samba will lose all elections. If you wish Samba to win all elections, you can reset its value as follows:</p><PRE CLASS="programlisting"> 715os level = 34</pre><P CLASS="para"> 716This means that the server will vote for itself 34 times each time an election is called, which ensures a victory.</p></div><DIV CLASS="sect3"> 717<H4 CLASS="sect3"> 718<A CLASS="title" NAME="ch05-pgfId-957960"> 7195.1.5.12 domain master</a></h4><P CLASS="para"> 720If Samba is the primary domain controller for your workgroup or NT domain, it should also be the domain master browser. The domain master browser is a special machine that has the NetBIOS resource type <1B> and is used to propagate browse lists to and from each of the local master browsers in individual subnets across the domain. To force Samba to become the domain master browser, set the following in the <CODE CLASS="literal"> 721[global]</code> section of the <I CLASS="filename"> 722smb.conf</i>:</p><PRE CLASS="programlisting"> 723[global] 724 domain master = yes</pre><P CLASS="para"> 725If you have a Windows NT server on the network acting as a primary domain controller (PDC), we recommend that you do not use Samba to become the domain master browser. The reverse is true as well: if Samba is taking on the responsibilities of a PDC, we recommend making it the domain master browser. Splitting the PDC and the domain master browser will cause unpredictable errors to occur on the network.</p></div><DIV CLASS="sect3"> 726<H4 CLASS="sect3"> 727<A CLASS="title" NAME="ch05-pgfId-957965"> 7285.1.5.13 remote browse sync</a></h4><P CLASS="para"> 729The global <CODE CLASS="literal"> 730remote</code> <CODE CLASS="literal"> 731browse</code> <CODE CLASS="literal"> 732sync</code> option specifies that Samba should synchronize its browse lists with local master browsers in other subnets. However, the synchronization can occur only with other Samba servers, and not with Windows computers. For example, if your Samba server was a master browser on the subnet 192.168.235, and Samba local master browsers existed on other subnets at 192.168.234.92 and 192.168.236.2, you could specify the following:</p><PRE CLASS="programlisting"> 733remote browse sync = 192.168.234.92 192.168.236.2 </pre><P CLASS="para"> 734The Samba server would then directly contact the other machines on the address list and synchronize browse lists. You can also say:</p><PRE CLASS="programlisting"> 735remote browse sync = 192.168.234.255 192.168.236.255</pre><P CLASS="para"> 736This forces Samba to broadcast queries to determine the IP addresses of the local master browser on each subnet, with which it will then synchronize browse lists. This only works, however, if your router doesn't block directed broadcast requests ending in 255.</p></div><DIV CLASS="sect3"> 737<H4 CLASS="sect3"> 738<A CLASS="title" NAME="ch05-pgfId-957971"> 7395.1.5.14 remote announce</a></h4><P CLASS="para"> 740Samba servers are capable of providing browse lists to foreign subnets with the <CODE CLASS="literal"> 741remote</code> <CODE CLASS="literal"> 742announce</code> option. This is typically sent to the local master browser of the foreign subnet in question. However, if you do not know the address of the local master browser, you can do the following:</p><PRE CLASS="programlisting"> 743[global] 744 remote announce = 192.168.234.255/ACCOUNTING \ 745 192.168.236.255/ACCOUNTING</pre><P CLASS="para"> 746With this, Samba will broadcast host announcements to all machines on subnets 192.168.234 and 192.168.236, which will hopefully reach the local master browser of the subnet. You can also specify exact IP addresses, if they are known.</p></div></div></div></div></blockquote> 747<div> 748<center> 749<hr noshade size=1><TABLE WIDTH="515" BORDER="0" CELLSPACING="0" CELLPADDING="0"> 750<TR> 751<TD ALIGN="LEFT" VALIGN="TOP" WIDTH="172"> 752<A CLASS="sect1" HREF="ch04_08.html" TITLE="4.8 Logging Configuration Options"> 753<IMG SRC="gifs/txtpreva.gif" ALT="Previous: 4.8 Logging Configuration Options" BORDER="0"></a></td><TD ALIGN="CENTER" VALIGN="TOP" WIDTH="171"> 754<A CLASS="book" HREF="index.html" TITLE=""> 755<IMG SRC="gifs/txthome.gif" ALT="" BORDER="0"></a></td><TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="172"> 756<A CLASS="sect1" HREF="ch05_02.html" TITLE="5.2 Filesystem Differences"> 757<IMG SRC="gifs/txtnexta.gif" ALT="Next: 5.2 Filesystem Differences" BORDER="0"></a></td></tr><TR> 758<TD ALIGN="LEFT" VALIGN="TOP" WIDTH="172"> 7594.8 Logging Configuration Options</td><TD ALIGN="CENTER" VALIGN="TOP" WIDTH="171"> 760<A CLASS="index" HREF="inx.html" TITLE="Book Index"> 761<IMG SRC="gifs/index.gif" ALT="Book Index" BORDER="0"></a></td><TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="172"> 7625.2 Filesystem Differences</td></tr></table><hr noshade size=1></center> 763</div> 764 765<!-- End of sample chapter --> 766<CENTER> 767<FONT SIZE="1" FACE="Verdana, Arial, Helvetica"> 768<A HREF="http://www.oreilly.com/"> 769<B>O'Reilly Home</B></A> <B> | </B> 770<A HREF="http://www.oreilly.com/sales/bookstores"> 771<B>O'Reilly Bookstores</B></A> <B> | </B> 772<A HREF="http://www.oreilly.com/order_new/"> 773<B>How to Order</B></A> <B> | </B> 774<A HREF="http://www.oreilly.com/oreilly/contact.html"> 775<B>O'Reilly Contacts<BR></B></A> 776<A HREF="http://www.oreilly.com/international/"> 777<B>International</B></A> <B> | </B> 778<A HREF="http://www.oreilly.com/oreilly/about.html"> 779<B>About O'Reilly</B></A> <B> | </B> 780<A HREF="http://www.oreilly.com/affiliates.html"> 781<B>Affiliated Companies</B></A><p> 782<EM>© 1999, O'Reilly & Associates, Inc.</EM> 783</FONT> 784</CENTER> 785</BODY> 786</html> 787