Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
09-27-2008, 10:46 PM
|
#1
|
LQ Newbie
Registered: Sep 2008
Posts: 4
Rep:
|
Samba shares only visible using IP address but not host name
I have two computers, both running mepis 7.0 32 bit (basically debian etch). Both are fully updated. one is called "kitchen" and the other "dining_room" I had samba working fine, until I started messing around with NFS on "kitchen". Now "kitchen" isn't visible in Samba.
Using "kitchen", I can see and mount the shares from "dining_room", no problem. But the shares from "kitchen" are not visible on either computer.
In trying to debug this, I went to "kitchen" and using konqueror, I typed in "smb://kitchen/" and I get an error mounting share message. Now here is the interesting thing. If I try to mount shares using the IP address instead of the host name (e.g., smb://192.168.1.4/ instead of smb://kitchen/), it works fine. I also noticed in SMB4K (on "kitchen"), when I try to browse the shares, it is showing a different IP address than the one assigned to the machine. I know the machine is using 192.168.1.4, but in SMB4K, when trying to connect it indicates it is connecting to 192.168.1.5
I copied /etc/samba/samba.conf from the "dining_room" to "kitchen" and that didn't help. I checked /etc/hosts, /etc/hosts.allow, /etc/host.deny, and /etc/network/interfaces, to see if I had hard coded the IP address at some point when I was messing with NFS, but can't find anything out of sorts.
What configuration files do I need to check/edit, to correct this problem? The shares are visible using the IP address but not the host name, so samba is working. But there is something with the hostname and IP address I am overlooking. Any help would be appreciated.
Thanks Reply With Quote
|
|
|
09-27-2008, 11:53 PM
|
#2
|
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
If you run nmap, what ports are open on the other machine.
Code:
139/tcp open netbios-ssn
445/tcp open microsoft-ds
631/tcp open ipp
631 is cups, but samba may use it. You do need 139 and 445 open. If you are using older technologies, such as you have Windows98 machines, they will use 137-139.
Also run "smbclient -L <hostname>" and see if the services are listed.
It seems to me that smb4k doesn't handle the [profile] service properly.
Try restarting smbd and nmbd on both machines.
If one of the machines is used as a server and always on, (such as a desktop for laptops on the network) you might try configuring the it as a wins server and putting it's IP address in the router's configuration, or each client's samba configuration.
Do your hosts use DHCP? Could the lease have changed reassigning IP addresses but samba and/or /etc/hosts and/or arp contains old IP address information?
Last edited by jschiwal; 09-27-2008 at 11:54 PM.
|
|
|
09-28-2008, 12:12 AM
|
#3
|
LQ Newbie
Registered: Sep 2008
Posts: 4
Original Poster
Rep:
|
First, thanks for the response.
I changed the IP address from DHCP to static 192.168.1.5 on "kitchen", and some of the problems have sort of cleared up.
I am sure all the correct ports are open, because of two things: one, samba works when I use the IP address, and two, there is no difference even if the firewall is disabled.
when I do "smbclient -L kitchen" I get the response "timeout connecting to 208.67.217.132:445" I believe the is the openDNS server my box is pinging. However, if I do "smbclient -L 192.168.1.5", it works fine
etc/hosts is as follows:
127.0.0.1 localhost
127.0.0.1 kitchen
# The following lines are desirable for IPv6 capable hosts
# (added automatically by netbase upgrade)
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
While changing the IP address to static helped some, the printer share is not working correctly, unless I use the IP address instead of the host name.
I am firmly convinced this is not so much a SMB problem as much as it is an IP/network/hostname/DNS problem.
|
|
|
09-28-2008, 12:54 AM
|
#4
|
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
If you changed to a static IP setup, and as you only have two hosts, edit your /etc/hosts file. Make sure that /etc/hosts is correct. If you had an old entry in /etc/hosts and you were assigned a different IP address, that could have caused your problem. It sounds like you don't have entries in your /etc/hosts file for the other computers on the network. This will enable you to use ssh or ping by name.
The samba-doc package (if you have it) supplies three books. Samba 3 by Example, and Samba 3 HOWTO & Reference Guide. The second one has a section on browsing. The troubleshooting section might help.
If you have the avahi service running, see if you can ping an IP address using "ping <hostname>.local".
Quote:
127.0.0.1 localhost
127.0.0.1 kitchen
|
Is this on the "kitchen" host?
You should be able to browse even if you don't have /etc/hosts entries (or a dns server). Vice-versa isn't necessarily true however.
I just tried an experiment. I commented out the /etc/hosts entry for "hpmedia" on my LAN. Then I ran "smbclient -L hpmedia". I was able to get the information. The argument after -L is the winbios hostname not the network hostname. If you use a command like "ping", then you do need an entry in /etc/hosts (or run dns or use <hostname>.local with avahi service running) to resolve the hostname.
Last edited by jschiwal; 09-28-2008 at 12:57 AM.
|
|
|
09-28-2008, 02:42 AM
|
#5
|
Member
Registered: Jul 2004
Location: Alton, IL
Distribution: Linux Mint; Slackware; Ubuntu; Slax
Posts: 172
Rep:
|
sure nmbd is running correctly? that's what establishes the hostnames on the windows network - the smb kioslave might rely on it to determine how to reach the other server. I know I use it on my home network - I have two linux boxes, a mac, and an old laptop running xp for compatibility - they can all see each other via samba, ftp, and sftp, and they all advertise as a windows network since that's the most limiting. I also use my /etc/hosts file pretty liberally with static ips.
hope that helps!
|
|
|
09-28-2008, 09:59 AM
|
#6
|
LQ Newbie
Registered: Sep 2008
Posts: 4
Original Poster
Rep:
|
The more I look at this and do research, the more I am convinced it is a nmbd issue. I tried to delete wins.dat and browse.dat, and have the system recreate them fresh. That had some positive impact, but not total resolution.
I'll probably try to uninstall and purge samba next (with apt) and reinstall it, to see if that helps clear out whatever config file is messing me up.
|
|
|
All times are GMT -5. The time now is 07:43 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|