LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 06-15-2004, 07:57 PM   #1
xthel
LQ Newbie
 
Registered: Jun 2004
Posts: 6

Rep: Reputation: 0
dhcp and multiple machines


I have just moved to Linux and have set up a small home network of 5 machines. All machines receive IP addresses from a (non-linux) DHCP server. This works fine as far as it goes.

However, if the power fails or machines reboot, they all come back up with different IP addresses, and this begins my infuriating time. It seems that the IP addresses of the other machines on the local network are stored in various places in the filesystems - not only /etc/hosts, but other places such as ssh configuration files and so forth. This all breaks when the machines reboot! I end up spending an hour hunting down all the places I have to update the new set of IP addreses.

Is there some way I can configure my machines so that when they come back up with different IPs, they keep working fine (as they used to do under 'doze)?

It's fine to point me at a FAQ - although so far all the googling I've done has only pointed me to info on either (1) setting up a Linux DHCP server, or (2) configuring a single machine to get its IP from DHCP, neither of which is my problem.

Thanks,

xthel
 
Old 06-15-2004, 08:02 PM   #2
xthel
LQ Newbie
 
Registered: Jun 2004
Posts: 6

Original Poster
Rep: Reputation: 0
I should also mention: this is mandrake 9.2, boxed set with latest patches.
 
Old 06-15-2004, 08:16 PM   #3
AltF4
Member
 
Registered: Sep 2002
Location: .at
Distribution: SuSE, Knoppix
Posts: 532

Rep: Reputation: 31
To solver your problem you might want to
a) instruct your dhcp server to give out static ip addresses based on NIC hardware address (simple)
b) set up your a private dns server with dynamic updates allowed (more comlicated)

windows does not need this because it tries to resolve local ip addresses by "asking" for the hostname/ip info on the LAN (google for "broadcast name resolution")
 
Old 06-15-2004, 08:44 PM   #4
xthel
LQ Newbie
 
Registered: Jun 2004
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by AltF4

a) instruct your dhcp server to give out static ip addresses based on NIC hardware address (simple)
b) set up your a private dns server with dynamic updates allowed (more comlicated)
Thanks for the reply. Alas, my DHCP server is a dumb linksys consumer hardware thing, and I'm not sure it supports static IP address assignment based on MAC addrss. At least, I haven't found a way to do it. I can see the mapping table of MACs to IPs, but that's it.

I'd rather not go through the bother of running a local DNS either. Am I then out of luck?

xthel

Last edited by xthel; 06-15-2004 at 08:45 PM.
 
Old 06-15-2004, 09:32 PM   #5
xthel
LQ Newbie
 
Registered: Jun 2004
Posts: 6

Original Poster
Rep: Reputation: 0
Hmm, I have just discovered that nmblookup works fine to come up with the IP addresses. If only I had a way to make that happen by default when gethostbyname() is called! Would solve my problem handily, I think.
 
Old 06-15-2004, 10:00 PM   #6
xthel
LQ Newbie
 
Registered: Jun 2004
Posts: 6

Original Poster
Rep: Reputation: 0
nsswitch.conf

Ok, I hate to follow up to my own post too many times in a row, but I have found /etc/nsswitch.conf, which appears to let me specify wins for name resolution. It seems to pretty much do what I want.

My only concerns now are:

(1) It takes a lot of extra time to open windows in X, presumably due to an initial gethostbyname call having to go out to the network. I can fix this by adding each hostname to /etc/hosts pointing to 127.0.0.1, but then I can't sync my /etc/hosts files between all my machines (since they'd all be different).

(2) I'm still worried that ssh will misbehave, since it seems to stick hostnames in its config files by itself. They'll become wrong after the next reboot, and this seems to cause complaints about "man in the middle" attacks from ssh.

Sorry for my newbiness!
 
Old 06-16-2004, 07:07 AM   #7
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
Do you have a BEFSR41 or similar linksys router/switch? If so, you can set the starting IP address. The default is 192.168.1.100, so you don't even need to change it. Just give your computers IP address below this one with static configurations.
 
Old 06-16-2004, 08:32 PM   #8
xthel
LQ Newbie
 
Registered: Jun 2004
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by jschiwal
Do you have a BEFSR41 or similar linksys router/switch? If so, you can set the starting IP address.
Yeah. I know I can use static IPs - was just hoping not to.

I have successfully got most things working with WINS. However, alas, emacs seems to segfault when I start it that way. Most other things are OK (gnome, at least). Ssh still embeds fixed IPs, which I wish I could make it stop doing.

IMHO, this is an area that could stand a bit of improvement.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compiling on multiple machines at once kenneho Programming 3 10-12-2005 02:27 AM
Multiple Machines Compiling RemusX2 Linux - General 4 07-06-2005 11:54 AM
Multiple Machines Compiling RemusX2 Linux - General 2 07-06-2005 04:44 AM
5 DHCP addresses and 7 machines GAVollink Linux - Networking 2 01-25-2003 04:23 PM
Seti on multiple machines. Sean Moores Linux - General 5 08-22-2002 11:32 AM


All times are GMT -5. The time now is 11:16 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration