Yet another Samba-related (or maybe hostname or NetBIOS-related) problem
Posted on 2003-03-19
Bear in mind that I'm pretty new at this whole Linux deal. Networking isn't my area of expertise.
Okay, info dump time:
I've got a small LAN of three PCs (and a network printer) hooked up to a gateway router (Netgear RT314). The router also provides DHCP for the network. Two of the PCs are Windows 98 (let's call their host names A and B, for brevity's sake); the third is running Red Hat 6.1 (we'll call it C). I just added this machine to the network and installed RH6.1 so it can hold some data files commonly accessed by the LAN. So, I figured, "Hey, I got a book that says Samba would be great for this. Let's do it!"
First I set up Samba on C. I set its access level to SHARE to match that of the Windows machines; I create a directory in which to place the shared files and create a "Share" for it in Samba. I set up the access levels, etc., etc.
After all that, I tried to access it via Network Neighborhood, and it doesn't show up. But, hey, no big deal, nothing in Linux ever works the first try, right? So I comb through the help files, the unofficial HOWTO at samba.org, and a few experts-exchange questions for possibilities.
Following Samba's DIAGNOSIS file and the HOWTO, I determine that Samba is indeed running. I can log into it in several ways from the local machine (C) itself using smbclient; I have no problem with nmblookup (again, on C). I can even access the shared folders on my Windows boxes (A & B) from C with smbclient, which is nice, but not my original desire. But I try using A to access the shared folders on C (Windows accessing Linux box) and it can't do it. What's more, it can't even seem to see the machine.
From A, I can ping C by IP address within the network, but I can't ping it by host name. Doing a "net view" only turns up the Windows machines A & B; C is completely absent. I'm fairly sure the share is set up properly, as I can use smbclient on C to access the shared folders on C by NetBIOS name. No, it appears that my problem may be with other parts of my network seeing the machine by NetBIOS name.
I checked my router's DHCP table, and, interestingly, the entry for C doesn't have the machine's host name--it's just blank! Even my printer shows up with a host name. Yet C can access the Internet and A & B with no problem. I'm pretty sure the host name on C is configured properly; on boot, it shows up with "C login: ", and the command prompt is "[root@C /root]# " upon logging in as root. However, I noticed that httpd wasn't starting up properly either, reporting that it "cannot determine local host name."
So, what do I do to get this Samba working? Am I missing an obscure parameter for smb.conf? Is my host name not properly set up? Is the fact that my network uses DHCP at all working against me?
For reference, here are a couple of pertinent configuration files from C:
*** /etc/smb.conf ***
# Samba config file created using SWAT
# from 192.168.0.4 (192.168.0.4)
# Date: 2003/03/19 14:57:26
# Global parameters
workgroup = THEWORKGROUP
netbios name = C
server string = PII 300MHz on RedHat Linux 6.1
security = SHARE
log file = /var/log/samba/log.%m
max log size = 50
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
dns proxy = No
hosts allow = 192.168.0.
remote announce = 192.168.0.255/THEWORKGROUP
comment = Home Directories
read only = No
browseable = No
comment = All Printers
path = /var/spool/samba
print ok = Yes
browseable = No
comment = SHAREPUB
path = /share/pub
read only = No
guest ok = Yes
public = Yes
force directory mode = 777
delete readonly = yes
create mode = 777
wide links = no
force create mode = 7777
directory mode = 777
*** /etc/hosts ***
127.0.0.1 C C
127.0.0.1 localhost.localdomain localhost
192.168.0.1 Router Router
192.168.0.2 A A
192.168.0.3 B B