Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DHCP client not resolving other computer names

Status
Not open for further replies.

kenget

MIS
Jul 24, 2001
4
AU
Hi all,

I am running RH 7.1 and am trying to get samba working on my network. I am having little success. I have been able to mount a share that happens to be on the gateway pc that is running as DHCP server (static ip and in hosts file!). The main problem I am having is that whenever I attempt to ping a PC on the network it comes up with host not found.

I think I am going to answer my own question here but have yet to try it out but will I have to change my smb.conf file to have line:

name resolve order = bcast

as the network is assigned by DHCP the other PCs ip addresses are always changing so setting up the hosts file is pointless except for DHCP server itself. ATM i do not wish to run a DNS server.

Thanks in advance for any advice or direction :)

Tim
 
Hi,

Firstly, do you mean you can't ping using the IP address (e.g. 172.16.16.1) or using the machine 'name' ? If its the first then you have some kind of IP configuration problem. If its using a name then the system would try to resolve the IP address in the usual way, i.e. using dns, /etc/hosts, etc. This is nothing to do with Samba as such.

Do you have NMB services running ? The NMB daemon essentially provides WINS services, i.e. does something similar to DNS for netbios name to IP address mapping. Unlike using a lmhosts file, WINS can be dynamic in the sense that if a Windows client has its IP configuration set to use a WINS server, then (as far as I understand) it should log its netbios name & DHCP-allocated IP address with that server. You can then set the 'name resolve order = wins lmhosts' or such like, i.e. with wins as first option. Just set 'wins support=yes' in the samba config.

There is also a way to add wins as an IP resolution option in the /etc/nsswitch configuration file, i.e. in addition to dns, files, etc. You need the exerimental code from the samba project --> .

Hope this helps...
 
Thanks for your reply and sorry for not being too clear. I am finding this a little confusing myself :)

I can ping the IP successfully but not the PC name ie 'ping blah'. When I ping the PC name it comes back saying 'ping: unknown host blah'. I checked to make sure that nmbd service is running (see example below), I added the 'name resolve order = wins lmhosts bcast' and 'wins support = yes' parameter then restarted samba with still no luck.

[root@linuxpc /root]# ps -ef |grep smbd
root 1467 1 0 09:32 ? 00:00:00 smbd -D
root 1477 1168 0 09:32 pts/1 00:00:00 grep smbd
[root@linuxpc /root]# ps -ef |grep nmbd
root 1472 1 0 09:32 ? 00:00:00 nmbd -D
root 1473 1472 0 09:32 ? 00:00:00 nmbd -D
root 1479 1168 0 09:32 pts/1 00:00:00 grep nmbd

Things that I have also checked include doing a netstat to see if the linux pc is listening for netbios data, which it is.

As both machines are obtaining their IP's from the DHCP server, I didn't think that I could run the linux PC as a WINS server? Because I would have to put a WINS server entry in network properties of the windows machine 'blah'? And this would change after a reboot. Is my understanding of this correct?

As I said in my first post that I was at least able to get a samba connection from the DHCP server that has a share. This machine is the network gateway and is running Windows 2k with Internet connection sharing. I have therefore added it to my hosts file.

I dont really want to have to set each machine up with their own IP address.

Thanks again

Tim
 
You will have to use a name server to resolve names over IP.
Wins will not help you here. That is for netbios traffic
over IP, or netbeui, or whatever.
Run an internal name server or use host files.

Bye.
 
I just want something that will be able to change when the IP addresses change with DHCP. If it can only be done with name server then I'll just have to attempt to set that up!

Thank you both for ur help

Tim
 
For your WINS server, why not allocate the SAMBA server a static IP address from your pool of addresses...

My DHCP server allocates machines an IP address in the 192.168.12.* range... it is allocated 192.168.12.3, the SAMBA server gets it address via DHCP, but has a reserved spot of 192.168.12.5... All workstations are allocated from 192.168.12.10 - 192.168.12.250... This way, if I add a machine that is better at staying on a fixed IP, it will get one of the reserved spaces...
AV
tnedor@yahoo.com
 
With straight DNS you do not get the feature you are looking for - DNS just does mapping of canonical names to fixed ip addresses - basically functionally identical to what you would put in a 'hosts' file. However, there is such a thing as DDNS (Dynamic DNS) which will dynamically update the ip address for a given cname. But you have to have a DDNS-enabled DNS server and DDNS-enabled clients. I know this is included in Win2k but I don't know about other clients, i.e. Win9x.

For the Samba wins service, if you have an NT4 DHCP server you must manually configure each client PC to point at the ip address of the wins (nmbd) server. You leave the dhcp settings as before. This is because the NT4 DHCP server is very basic - (I'm not sure how more sophisticated the Win2K one is). However, if your dhcp server is on Linux you can put an option like 'netbios-name-servers 172.16.1.1;' in the /etc/dhcpd.conf file and this should update the client ip config with the wins info as well, i.e you don't need to configure the clients - its all done thru dhcp.

Samba basically uses nbt (netbios over tcp) so wins is very useful in doing that level of mapping. E.g. in Win you would do something like 'net view \\server1' where server1 is the netbiosname. You can also do 'net view \\172.16.1.1' if you know the ip address and this is in fact necessary if the target is routed because netbios is of course not a routable protocol. Wins allows, without using dns, a remote win box to 'advertise' its ip address by posting it at a central point (wins server) that anyone can get to via nbt.The advantage for your purposes is the dynamic posting element. During network initialisation the box will send the netbios/ip address info to the server. Thereafter you should be able to do 'net view \\server1' even for a remote pc that is using dhcp.

Just to go back to the pinging for a moment, the wins resolution logic is built into samba so samba can do it out of the box. However, 'ping' or other ip utilities do not recognise wins resolution or netbiosnames out of the box. So your samba could be working fine but you still will not be able to do a 'ping netbiosname'. As said above, if you really want to do that you'll need the experimental samba code.

To test connectivity use 'smbclient' -

smbclient -L server1 -N
smbclient -L server1 -R wins -N
smbclient -L server1 -I 172.16.1.2 -N

The first command would use the name resolution order in the conf file; the second would try wins first; the third just goes direct using the (known) ip address. You may need to modify these if there are passwords involved or guest access is not allowed. Take the -N off and use -U username%password - or try -U guest -N .

Try these instead of pinging..

Rgds

 
Whether or not you WANT to use this extended
netbios name logic for ip name resolution
the issue here is that you need resolution on unnamed and dynamically pooled ip hosts.

The traditional, tried and true method is to
provide ip to name mappings via DNS or a hosts file. If you arrange for more than one
method of name resolution over IP on your network then some applications will break
when they cannot use the method they need
if there are not multiple and redundant name logics in place.

This seems like a lot of work to me when a
traditional solution is compatible with all
usages and methods....
However, the dynamic nature of your ip pool
is a problem. We use a novell dhcp server
and the arp mappings are cached and reused
according to a keepalive. If the mac address is off the net for x days the address is recirculated. This is very useful and is configurable.
This means that unless truly extraordinary
measures are taken to remove a host from the
network that host will get the same ip address.
This also saves on server overhead. If you research your dhcp servers docs maybe you will find similar settings available.
 
Well, another variation on the above post is to configure the DHCP server so that it reserves particular ip addresses for particular MAC addresses. Thru this, each adapter will be guaranteed the same ip address so it is more or less the same as static mapping using hosts files or dns. There is much more work involved at the DHCP server side because you have to set-up all the MAC addresses with reserved leases. However, the advantage is that you don't physically have to go and configure each client machine - you do it all with DHCP centrally.

Rgds
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top