ONLamp.com
oreilly.comSafari Books Online.Conferences.

advertisement


Name Resolution and Browsing in Samba, Part 2
Pages: 1, 2, 3

Browsing Options

Table 7-4 shows options that define how Samba handles browsing tasks.

Table 7-4: Browsing configuration options

Option

Parameters

Function

Default

Scope

announce as

string

Operating system that Samba will announce itself as.

N T Server

Global

announce version

numeric

Version of the operating system that Samba will announce itself as.

4.5

Global

browsable (browseable)

Boolean

Allows share to be displayed in list of machine resources.

yes

Share

browse list

Boolean

If yes, allows Samba to provide a browse list on this server.

yes

Global

auto services (preload)

string (share list)

List of shares that will always appear in the browse list.

None

Global

default service (default)

string (share name)

Name of a share (service) that will be provided if the client requests a share not listed in smb.conf.

None

Global

local master

Boolean

If yes, allows Samba to participate in browsing elections.

yes

Global

lm announce

yes, no or auto

Enables or disables LAN Manager-style host announcements.

auto

Global

lm interval

numeric

Frequency in seconds that LAN Manager announcements will be made if activated.

60

Global

preferred master (prefered master)

Boolean

If yes, allows Samba to use the preferred master browser bit to attempt to become the local master browser.

no

Global

domain master

Boolean

If yes, allows Samba to become the domain browser master for the workgroup or domain.

no

Global

os level

numeric

Operating system level of Samba in an election for local master browser.

0

Global

remote browse sync

string (list of IP addresses)

Samba servers to synchronize browse lists with.

None

Global

remote announce

string (IP address/workgroup pairs)

Subnets and workgroups to send directed broadcast packets to, allowing Samba to appear in their browse lists.

None

Global


announce as

This global configuration option specifies the type of operating system that Samba announces to other machines on the network. The default value for this option is N T Server, which causes Samba to masquerade as a Windows NT Server operating system. Other possible values are NT, NT Workstation, Win95, and W f W for a Windows for Workgroup operating system. You can override the default value with the following:



[global]
	announce as = Win95

We recommend against changing the default value of this configuration option.

announce version

This global option is frequently used with the announce as configuration option; it specifies the version of the operating system that Samba announces to other machines on the network. The default value of this option is 4.5, which places Samba above Windows NT Version 4.0, but below Windows 2000. You can specify a new value with a global entry such as the following:

[global]
	announce version = 4.3

We recommend against changing the default value of this configuration option.

browsable

The browsable option (also spelled browseable) indicates whether the share referenced should appear in the list of available resources for the system on which it resides. This option is always set to yes by default. If you wish to prevent the share from being seen in a client's browser, you can reset this option to no.

Note that this does not prevent someone from accessing the share using other means, such as specifying a UNC location (e.g., \\server\accounting) in Windows Explorer. It only prevents the share from being listed under the system's resources when being browsed.

browse list

You should never need to change this parameter from its default value of yes. If your Samba server is acting as a local master browser (i.e., it has won the browsing election), you can use the global browse list 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:

[global]
	browse list = no

If 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, he can still connect to it explicitly using the Windows net use command 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.

auto services

The global auto services option, which is also called preload , 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 [homes] or [printers] shares, but are not otherwise browsable.

This 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) to appear in the browse list, we recommend using the load printers option instead.

Shares listed with the auto services option will not be displayed if the browse list option is set to no.

default service

The global default service option (sometimes called default) names a "last-ditch" share. The value is set to an existing share name without the enclosing brackets. When 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:

[global]
	default service = helpshare

When Samba redirects the requested, nonexistent service to the service specified by default service, the %S option takes on the value of the requested service, with any underscores ( _ ) in the requested service replaced by forward slashes (/).

local master

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 yes, Samba will participate in elections. However, setting this option by itself does not guarantee victory. (Other parameters, such as preferred master and os level, help Samba win browsing elections.) If this option is set to no, Samba will lose all browsing elections, regardless of which values are specified by the other configuration options. The default value is yes.

lm announce

The global lm announce option tells Samba's nmbd whether to send LAN Manager host announcements on behalf of the server. These host announcements might 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 lm interval option.

You can specify the option as follows:

[global]
	lm announce = yes

This configuration option takes the standard Boolean values, yes and no, which enable or disable LAN Manager announcements, respectively. In addition, a third option, auto, causes nmbd to listen passively for LAN Manager announcements, but not to send any of its own initially. If LAN Manager announcements are detected for another machine on the network, nmbd will start sending its own LAN Manager announcements to ensure that it is visible. The default value is auto. You probably won't need to change this value from its default.

lm interval

This option, which is used in conjunction with lm announce, indicates the number of seconds nmbd will wait before repeatedly broadcasting LAN Manager-style announcements. LAN Manager announcements must be enabled for this option to work. The default value is 60 seconds. If you set this value to 0, Samba will not send any LAN Manager host announcements, regardless of the value of the lm announce option. You can reset the value of this option as follows:

[global]
	lm interval = 90

preferred master

The preferred master 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:

[global]
	preferred master = yes

Otherwise, you should leave it set to its default, no. If Samba is configured as a preferred master browser, it will force an election when it first comes online.

domain master

If Samba is the primary domain controller for your workgroup or NT domain, it should also be made 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 local master browser in individual subnets across the domain. To force Samba to become the domain master browser, set the following in the [global] section of the smb.conf:

[global]
	domain master = yes

If 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.

os level

The global os level option defines the operating-system value with which Samba will masquerade during a browser election. If you wish to have Samba win an election and become the master browser, set the os level higher than that of any other system on the subnet. The values are shown in Table 7-2. The default level is 20, which means that Samba will win elections against all versions of Windows, except Windows NT/2000 if it is operating as the PDC. If you wish Samba to win all elections, you can set its operating system value as follows:

[global]
	os level = 255

remote browse sync

The global remote browse sync 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 were a master browser on the subnet 172.16.235, and Samba local master browsers existed on other subnets located at 172.16.234.92 and 172.16.236.2, you would specify the following:

[global]
	remote browse sync = 172.16.234.92 172.16.236.2 

The Samba server would then directly contact the other machines on the address list and synchronize browse lists. You can also say:

[global]
	remote browse sync = 172.16.234.255 172.16.236.255

This 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 works, however, only if your router doesn't block directed broadcast requests ending in 255.

remote announce

Samba servers are capable of providing browse lists to foreign subnets with the remote announce 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:

[global]
    remote announce = 172.16.234.255/ACCOUNTING \
						172.16.236.255/ACCOUNTING

With this, Samba will broadcast host announcements to all machines on subnets 172.16.234 and 172.16.236, which will hopefully reach the local master browser of the subnet.

You can also specify exact IP addresses, if they are known, but this works only if the systems are guaranteed to maintain the role of master browser on their subnets. By appending a workgroup or domain name to the IP address, Samba announces that it is in that workgroup or domain. If this is left out, the workgroup set by the workgroup parameter is used.


Return to ONLamp.com.





Sponsored by: