On Monday 16 Jun 2003 12:10 pm, Saurav Gohain wrote:
> Hi,
> I have installed Mandrake 9.1 and is connected to a LAN that has
> both windows nt and linux machines. Using LIN , i can connect to
> the Linux machines and exchange files but I am unable to connect to
> the windows machine. In the lin neighbourhood, it shows the names
> but i couldn't make it through to enter and access the files. what
> could be the problem.
>
> furthermore, i am unable to connect to the net even though the
> gateway address to connect to the net is correct.
>
There's more than one issue here, Saurav.  First, we need to know a 
bit more about your lan.  For a start, where is your gateway?  I mean 
is it on your linux box, a windows machine, a server box, a router?

Then, you need to get the network functioning properly.  Print out the 
attached file - it should help you to find the problem.

Once you can ping your machines correctly both by number and name, and 
run all the tests listed there, you are ready to configure samba.

The easiest way to do that is through Webmin.  If you don't have it 
installed, it's on your disks.  Under ther Server tab you will find a 
section for configuring windows sharing.  That should get you 
started.

Let us know what happens.

Anne
In some of the following tests I have commented alternative commands that seem to be 
needed with later versions of Samba.  It appears that nmb -L is replaced by nmblookup.



DIAGNOSING YOUR SAMBA SERVER

This file contains a list of tests you can perform to validate your Samba server. It 
also tells you what the likely cause of the problem is if it fails any one of these 
steps. If it passes all these tests then it is probably working fine.

You should do ALL the tests, in the order shown. I have tried to carefully choose them 
so later tests only use capabilities verified in the earlier tests.

I would welcome additions to this set of tests. Please mail them to [EMAIL PROTECTED]

If you send me an email saying "it doesn't work" and you have not followed this test 
procedure then you should not be surprised if I ignore your email.

ASSUMPTIONS
-----------
In all of the tests I assume you have a Samba server called BIGSERVER and a PC called 
ACLIENT. I also assume the PC is running windows for workgroups with a recent copy of 
the microsoft tcp/ip stack. The procedure is similar for other types of clients.

I also assume you know the name of a available share in your smb_conf. I will assume 
this share is called "tmp". You can add a "tmp" share like by adding the following to 
smb_conf: 

[tmp]
 comment = temporary files 
 path = /tmp
 read only = yes

These tests also assume version 1.9.14 or later of the samba suite. If you have 
version 1.9.13 then see "NOTE 1" below.


TEST 1:
-------
run the command "testparm". If it reports any errors then your
smb_conf configuration file is faulty.


TEST 2:
-------
run the command "ping BIGSERVER" from the PC and "ping ACLIENT" from the unix box. If 
you don't get a valid response then your TCP/IP software is not correctly installed. 

Note that you will need to start a "dos prompt" window on the PC to run ping.

If you get a message saying "host not found" or similar then your DNS software or 
/etc/hosts file is not correctly setup. It is possible to run samba without DNS 
entries for the server and client, but I assume you do have correct entries for the 
remainder of these tests.

TEST 3:
-------
run the command "smbclient -L BIGSERVER -U%" on the unix box. You should get a list of 
available shares back. 

If you get a error message containing the string "Bad password" then you probably have 
either an incorrect "hosts allow", "hosts deny" or "valid users" line in your 
smb_conf, or your guest account is not valid. Check what your guest account is using 
"testparm" and temporarily remove any "hosts allow", "hosts deny", "valid users" or 
"invalid users" lines.

If you get a "connection refused" response then the smbd server could not be run. If 
you installed it in inetd.conf then you probably edited that file incorrectly. If you 
installed it as a daemon then check that it is running, and check that the netbios-ssn 
port is in a LISTEN state using "netstat -a".

TEST 4:         ; try nmblookup -B BIGSERVER __SAMBA__
-------
run the command "nmbd -L __SAMBA__ -B BIGSERVER". You should get a bunch of info back 
including the string "got a positive name query response". You should also see a 
message "got a positive node status response" and below that a list of netbios names. 
The name BIGSERVER
should be included in that list.

If you don't then nmbd is incorrectly installed. Check your inetd.conf if you run it 
from there, or that the daemon is running and listening to udp port 137.

One common problem is that many inetd implementations can't take many parameters on 
the command line. If this is the case then create a one-line script that contains the 
right parameters and run that from inetd.

TEST 5:         ; try nmblookup -B ACLIENT
-------
run the command "nmbd -L '*' -B ACLIENT"

You should get a "positive name query response" from the PC. If you don't then the 
client software on the PC isn't installed correctly, or isn't started, or you got the 
name of the PC wrong. Note that you probably won't get a "node status response" from 
the PC due to a bug in the microsoft netbios nameserver implementation (it responds to 
the wrong port number).

TEST 6:
-------
run the command "nmbd -L '*'"   ;try nmblookup -d 2 '*'

This time we are trying the same as the previous test but are trying it via a 
broadcast to the default broadcast address. All Netbios/TCPIP hosts on the network 
should respond, although Samba may not catch all of the responses in the short time it 
listens.

If this doesn't give a similar result to the previous test then nmbd isn't correctly 
getting your broadcast address through its automatic mechanism. In this case you 
should experiment with the -B option which allows you to manually specify the 
broadcast address, overriding the automatic detection. You should try different 
broadcast addresses until your find the one that works. It will most likely be 
something like a.b.c.255 as microsoft tcpip stacks only listen on 1's based broadcast 
addresses. If you get stuck then ask your local networking guru for help (and show 
them this paragraph).

If you find you do need the -B option (ie. the automatic detection doesn't work) then 
you should add the -B option with the right broadcast address for your network to the 
command line of nmbd in
inetd.conf or in the script you use to start nmbd as a daemon. Once you do this go 
back to the "nmbd -L __SAMBA__ -B BIGSERVER" test to make sure you have it running 
properly.

If your PC and server aren't on the same subnet then you will need to use the -B 
option to set the broadcast address to the that of the PCs subnet.

TEST 7:         ;Does not work on later versions, No new command found.
-------
run the command "nmbd -M -" 

this should find a master browser on your network. If you don't have one then browsing 
won't work with samba. See the file BROWSING.txt for details. Note that you may need 
the -B option to the command if the previous test showed that the default broadcast is 
incorrect.

TEST 8:
-------
run the command "smbclient '\\BIGSERVER\TMP'". You should then be prompted for a 
password. You should use the password of the account you are logged into the unix box 
with. If you want to test with another account then add the -U <accountname> option to 
the command
line. 

Once you enter the password you should get the "smb>" prompt. If you don't then look 
at the error message. If it says "invalid network name" then the service "tmp" is not 
correctly setup in your smb_conf. 

If it says "bad password" then the likely causes are:

- you have shadow passords (or some other password system) but didn't   compile in 
support for                              them in smbd
- your "valid users" configuration is incorrect
- you have a mixed case password and you haven't enabled the "password   level" option 
at a high enough level
- the "path =" line in smb_conf is incorrect. Check it with testparm

Once connected you should be able to use the commands "dir" "get" "put" etc. Type 
"help <command>" for instructions. You should especially check that the amount of free 
disk space shown is correct when you type "dir".

TEST 9:
-------
On the PC type the command "net view \\BIGSERVER". You will need to do this from 
within a "dos prompt" window. You should get back a list of available shares on the 
server.

If you get a "network name not found" or similar error then netbios name resolution is 
not working. This is usually caused by a problem in particular, make sure your "hosts 
allow" line is correct (see the man pages)

- fixup the nmbd installation
- add the IP address of BIGSERVER to the "wins server" box in the advanced tcp/ip 
setup on the PC.
- enable windows name resolution via DNS in the advanced section of   the tcp/ip setup
- add BIGSERVER to your lmhosts file on the PC.

If you get a "invalid network name" or "bad password error" then the same fixes apply 
as they did for the "smbclient -L" test above. In particular, make sure your "hosts 
allow" line is correct (see the man pages)


TEST 10:                ; leave out the x:
--------
run the command "net use x: \\BIGSERVER\TMP". You should be prompted for a password 
then you should get a "command completed successfully" message. If not then your PC 
software is incorrectly installed or your smb_conf is incorrect. make sure your "hosts 
allow" and other config
lines in smb_conf are correct. 

It's also possible that the server can't work out what user name to connect you as. To 
see if this is the problem add the line "user = USERNAME" to the [tmp] section of 
smb_conf where "USERNAME" is the username corresponding to the password you typed. If 
you find this
fixes things you may need the username mapping option.

TEST 11:
--------
>From file manager try to browse the server. Your samba server should appear in the 
>browse list of your local workgroup (or the one you specified in the Makefile). You 
>should be able to double click on the name of the server and get a list of shares. If 
>you get a "invalid password" error when you do then you are probably running WinNT 
>and it is refusing to browse a server that has no encrypted password capability and 
>is in user level security mode.

Still having troubles?
----------------------
Try the mailing list or newsgroup, or use the tcpdump-smb utility to sniff the problem.

ADDITIONAL NOTES
----------------
NOTE 1: 
If you have version 1.9.13 of Samba then the "nmbd -L ACLIENT -B ACLIENT" test may 
fail if your client doesn't export any shares. To fix this either export a share or 
change the "lookup_type" in nameserv.c from ' ' to 0 and recompile.

Also the "wildcard" lookup capability used in the command "nmbd -L '*'" was only added 
in 1.9.14. If you have 1.9.13 then use a clients netbios name instead (for example 
"nmbd -L ACLIENT").

http://www.rtr.com/win95pak/sambadiag.htm
Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to