1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
4 <!ENTITY % global_entities SYSTEM '../entities/global.entities'>
7 <chapter id="problems">
14 <pubdate>8 Apr 2003</pubdate>
17 <title>Analyzing and Solving Samba Problems</title>
20 There are many sources of information available in the form
21 of mailing lists, RFCs and documentation. The documentation that comes
22 with the Samba distribution contains good explanations of
23 general SMB topics such as browsing.</para>
26 <title>Diagnostics Tools</title>
28 <para>With SMB networking, it is often not immediately clear what
29 the cause is of a certain problem. Samba itself provides rather
30 useful information, but in some cases you might have to fall back
31 to using a <emphasis>sniffer</emphasis>. A sniffer is a program that
32 listens on your LAN, analyzes the data sent on it and displays it
36 <title>Debugging with Samba Itself</title>
39 One of the best diagnostic tools for debugging problems is Samba itself.
40 You can use the <option>-d option</option> for both &smbd; and &nmbd; to specify the
41 <smbconfoption><name>debug level</name></smbconfoption> at which to run.
42 See the man pages for <command>smbd, nmbd</command> and
43 &smb.conf; for more information regarding debugging options. The debug
44 level can range from 1 (the default) to 10 (100 for debugging passwords).
48 Another helpful method of debugging is to compile Samba using the
49 <command>gcc -g </command> flag. This will include debug information in the binaries and
50 allow you to attach gdb to the running <command>smbd/nmbd</command> process.
51 To attach <command>gdb</command> to an <command>smbd</command>
52 process for an NT workstation, first get the workstation to make the
53 connection. Pressing ctrl-alt-delete and going down to the domain box
54 is sufficient (at least, the first time you join the domain) to
55 generate a <parameter>LsaEnumTrustedDomains</parameter>. Thereafter, the workstation
56 maintains an open connection and there will be an smbd
57 process running (assuming that you haven't set a really short smbd
58 idle timeout). So, in between pressing <command>ctrl-alt-delete</command> and actually
59 typing in your password, you can attach <command>gdb</command> and continue.
63 Some useful Samba commands worth investigating are:
67 &prompt;<userinput>testparm | more</userinput>
68 &prompt;<userinput>smbclient -L //{netbios name of server}</userinput>
74 <title>Tcpdump</title>
77 <ulink url="http://www.tcpdump.org/">Tcpdump</ulink> was the first
78 UNIX sniffer with SMB support. It is a command-line utility and
79 now, its SMB support is somewhat lagging that of <command>ethereal</command>
80 and <command>tethereal</command>.
86 <title>Ethereal</title>
89 <ulink url="http://www.ethereal.com/">Ethereal</ulink> is a graphical
90 sniffer, available for both UNIX (Gtk) and Windows. Ethereal's
91 SMB support is quite good.</para>
93 <para>For details on the use of <command>ethereal</command>, read the well-written
94 Ethereal User Guide.</para>
96 <image id="ethereal1"><imagefile>ethereal1</imagefile><imagedescription>Starting a capture.</imagedescription></image>
98 <para>Listen for data on ports 137, 138, 139, and 445. For example, use
99 the filter <userinput>port 137, port 138, port 139, or port
100 445</userinput> as seen in <link linkend="ethereal1">Starting a capture</link> snapshot.</para>
102 <para>A console version of ethereal is available as well and is called
103 <command>tethereal</command>.</para>
105 <image id="ethereal2"><imagefile>ethereal2</imagefile><imagedescription>Main ethereal data window.</imagedescription></image>
110 <title>The Windows Network Monitor</title>
113 For tracing things on Microsoft Windows NT, Network Monitor
114 (aka Netmon) is available on Microsoft Developer Network CDs,
115 the Windows NT Server install CD and the SMS CDs. The version of
116 Netmon that ships with SMS allows for dumping packets between any two
117 computers (i.e., placing the network interface in promiscuous mode).
118 The version on the NT Server install CD will only allow monitoring
119 of network traffic directed to the local NT box and broadcasts on the
120 local subnet. Be aware that Ethereal can read and write Netmon
125 <title>Installing Network Monitor on an NT Workstation</title>
128 Installing Netmon on an NT workstation requires a couple
129 of steps. The following are instructions for installing Netmon V4.00.349, which comes
130 with Microsoft Windows NT Server 4.0, on Microsoft Windows NT
131 Workstation 4.0. The process should be similar for other versions of
132 Windows NT version of Netmon. You will need both the Microsoft Windows
133 NT Server 4.0 Install CD and the Workstation 4.0 Install CD.
137 Initially you will need to install <application>Network Monitor Tools and Agent</application>
138 on the NT Server to do this:
142 <listitem><para>Go to <guibutton>Start</guibutton> -> <guibutton>Settings</guibutton> -> <guibutton>Control Panel</guibutton> ->
143 <guibutton>Network</guibutton> -> <guibutton>Services</guibutton> -> <guibutton>Add</guibutton>.</para></listitem>
145 <listitem><para>Select the <guilabel>Network Monitor Tools and Agent</guilabel> and click on <guibutton>OK</guibutton>.</para></listitem>
147 <listitem><para>Click on <guibutton>OK</guibutton> on the Network Control Panel.</para></listitem>
149 <listitem><para>Insert the Windows NT Server 4.0 install CD when prompted.</para></listitem>
153 At this point, the Netmon files should exist in <filename>%SYSTEMROOT%\System32\netmon\*.*</filename>.
154 Two subdirectories exist as well, <filename>parsers\</filename> which contains the necessary DLLs
155 for parsing the Netmon packet dump, and <filename>captures\</filename>.
159 To install the Netmon tools on an NT Workstation, you will first need to install the
160 Network Monitor Agent from the Workstation install CD.
164 <listitem><para>Go to <guibutton>Start</guibutton> -> <guibutton>Settings</guibutton> -> <guibutton>Control Panel</guibutton> ->
165 <guibutton>Network</guibutton> -> <guibutton>Services</guibutton> -> <guibutton>Add</guibutton>.</para></listitem>
167 <listitem><para>Select the <guilabel>Network Monitor Agent</guilabel>, click on <guibutton>OK</guibutton>.</para></listitem>
169 <listitem><para>Click on <guibutton>OK</guibutton> in the Network Control Panel.
172 <listitem><para>Insert the Windows NT Workstation 4.0 install CD when prompted.</para></listitem>
176 Now copy the files from the NT Server in <filename>%SYSTEMROOT%\System32\netmon</filename>
177 to <filename>%SYSTEMROOT%\System32\netmon</filename> on the Workstation and set permissions
178 as you deem appropriate for your site. You will need administrative rights on the NT box to run Netmon.
183 <title>Installing Network Monitor on Windows 9x/Me</title>
185 To install Netmon on Windows 9x/Me, install the Network Monitor Agent
186 from the Windows 9x/Me CD (<filename>\admin\nettools\netmon</filename>).
187 There is a readme file located with the Netmon driver files on the CD if you need
188 information on how to do this. Copy the files from a working Netmon installation.
195 <title>Useful URLs</title>
198 <listitem><para>See how Scott Merrill simulates a BDC behavior at
199 <ulink noescape="1" url="http://www.skippy.net/linux/smb-howto.html">
200 http://www.skippy.net/linux/smb-howto.html</ulink>. </para></listitem>
202 <listitem><para>FTP site for older SMB specs:
203 <ulink noescape="1" url="ftp://ftp.microsoft.com/developr/drg/CIFS/">
204 ftp://ftp.microsoft.com/developr/drg/CIFS/</ulink></para></listitem>
211 <title>Getting Mailing List Help</title>
214 There are a number of Samba-related mailing lists. Go to <ulink
215 noescape="1" url="http://samba.org">http://samba.org</ulink>, click on your nearest mirror
216 and then click on <command>Support</command> and next click on <command>
217 Samba-related mailing lists</command>.
221 For questions relating to Samba TNG, go to
222 <ulink noescape="1" url="http://www.samba-tng.org/">http://www.samba-tng.org/.</ulink>
223 It has been requested that you do not post questions about Samba-TNG to the
224 main-stream Samba lists.</para>
227 If you do post a message to one of the lists, please observe the following guidelines :
232 <listitem><para>Always remember that the developers are volunteers, they are
233 not paid and they never guarantee to produce a particular feature at
234 a particular time. Any timelines are <quote>best guess</quote> and nothing more.
237 <listitem><para>Always mention what version of Samba you are using and what
238 operating system it's running under. You should list the relevant sections of
239 your &smb.conf; file, at least the options in <smbconfsection>[global]</smbconfsection>
240 that affect PDC support.
243 <listitem><para>In addition to the version, if you obtained Samba via
244 CVS, mention the date when you last checked it out.</para></listitem>
246 <listitem><para> Try and make your questions clear and brief. Lots of long,
247 convoluted questions get deleted before they are completely read!
248 Do not post HTML encoded messages. Most people on mailing lists simply delete
252 <listitem><para> If you run one of those nifty <quote>I'm on holidays</quote> things when
253 you are away, make sure its configured to not answer mailing list traffic. Auto-responses
254 to mailing lists really irritate the thousands of people who end up having to deal
255 with such bad netiquet bahavior.
258 <listitem><para>Don't cross post. Work out which is the best list to post to
259 and see what happens. Do not post to both samba-ntdom and samba-technical.
260 Many people active on the lists subscribe to more
261 than one list and get annoyed to see the same message two or more times.
262 Often someone will see a message and thinking it would be better dealt
263 with on another list, will forward it on for you.</para></listitem>
265 <listitem><para>You might include <emphasis>partial</emphasis>
266 log files written at a debug level set to as much as 20.
267 Please do not send the entire log but just enough to give the context of the
268 error messages.</para></listitem>
270 <listitem><para>If you have a complete Netmon trace (from the opening of
271 the pipe to the error), you can send the *.CAP file as well.</para></listitem>
273 <listitem><para>Please think carefully before attaching a document to an email.
274 Consider pasting the relevant parts into the body of the message. The Samba
275 mailing lists go to a huge number of people. Do they all need a copy of your
276 &smb.conf; in their attach directory?</para></listitem>
283 <title>How to Get Off the Mailing Lists</title>
285 <para>To have your name removed from a Samba mailing list, go to the same
286 place where you went to
287 subscribe to it. Go to <ulink noescape="1" url="http://lists.samba.org/">http://lists.samba.org</ulink>,
288 click on your nearest mirror, click on <command>Support</command> and
289 then click on<command> Samba related mailing lists</command>.
293 Please do not post messages to the list asking to be removed. You will only
294 be referred to the above address (unless that process failed in some way).