Linux - NetworkingThis 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.
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.
My two linux boxes are behind an internet gateway/router on a DHCP network. They work just fine. Both happily ping each other. But due to DHCP, I am not able to atttach a name to each machine. Is there a way for me to ping other machine based solely on machine name and not IP address? I dont want to use static IP.
(ON a windows based network, wins resolution would take care of mapping name to IP. My both machines, however, run linux.)
I'm no expert but I have a similar situation using 1 linux box and 2 win98 clients. Samba and Windows WINS handle the nameserver issue but I still have problems logging into samba. The way I fixed it is to put the clients in the /etc/hosts file.
DHCP seems to assign an IP to a hardware address and maintains that IP unlees you change the network card. So in your case, I think you can add the IP's of your 2 machines to the /etc/hosts file (both machines) because even though they are assigned by DHCP dynamically, they are essentially static once assigned
Well, since you are using W98, name resolutions is not difficult since 98 screams all the time about it's ip address. But not so in linux.
DHCP doesn't bind hardware to an ip address. Infact, I get a different IP everytime. It is based on what IP number is free when you log onto network. In my case, whichever machies start first ( i have only two on the network), gets 192.168.0.2. The second one gets 3. This is precisely the reason why I can't map a name to an IP in /etc/hosts.
This is a total piece of cake, but it took me having to read the excellent "Using Samba" O'Reilly book to find out how to do it.
Make one of your Linux machines that is always up on your network a WINS server. This is very simple to do:
Add to your [global] section of the smb.conf file
wins support = yes
Then to any other Linux machines on your network, in their smb.conf files (again in the [global] section):
wins server = xxx.xxx.xxx.xxx
name resolve order = wins lmhosts hosts bcast
where xxx.xxx.xxx.xxx is the IP address of the machine you've made the WINS server in the first step.
You can change the name resolve order order (sic) to whatever you like. You might want to look up the static IP addresses first I suppose, in which case put lmhosts first.
On any Wind*ws clients, go to Notwork Neighbourhood and make the WINS server on there point to IP address xxx.xxx.xxx.xxx
Stop and start your samba daemons, reboot your Windoze clients and hey presto, you can ping to the netbios names to your heart's content.
It really is that easy, but it took me bloody ages to work out!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.