Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How do you get local machine IP addresses under dhcp??
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
ghawkins
n00b
n00b


Joined: 29 Mar 2004
Posts: 6

PostPosted: Thu Apr 01, 2004 2:21 am    Post subject: How do you get local machine IP addresses under dhcp?? Reply with quote

I've searched the Gentoo forums and posted the question once before; all to no
avail. So I'll try rephrasing it one more time in the hope that somebody might
be able to provide an answer.

I am running a number of Linux and Windows machines in a home wireless network
using a Linksys wireless router that uses dhcp. For each Linux machine, I have
set a hostname via /etc/hostname, the relevent network portion of
/etc/conf.d/net is as follows:

iface_eth0="dhcp"
dhcp_eth0="-h <hostname>"
wireless_essid_eth0="ghawkins"
wireless_mode_eth0="managed"
wireless_rate_eth0="auto"

where <hostname>'s are the various hostnames of my Gentoo Linux machines.

Let's say, for example,that I have two Linux machines named gentoo and genthree.
What I'd like to be able to do is determine gentoo's IP address from the
genthree machine (and, similarly, to determine genthree's IP address from the
gentoo machine).

It's no problem getting gentoo's IP address from gentoo (I just execute
ifconfig) - but how do I get it from genthree??????

The really frustrating thing is that I can determine the Linux machine's IP
addresses from Windows, but not from Linux itself. For example, if I want to
get gentoo's IP address from a Windows machine, I just execute
"ping gentoo" andWindows (or ping) is smart enough to perform reverse
name resolution and reply with something like: "Reply from 192.168.1.101:....."
If I try this same command from the Linux genthree machine, ping dies
and tells me the host is unreachable. (Score one for Bill Gates, I guess.)

Anyhow, if you have any idea how I can accomplish this seemingly simple feat,
I'd be very appreciative.

George
Back to top
View user's profile Send private message
YopWongSapn
l33t
l33t


Joined: 26 Jan 2004
Posts: 627

PostPosted: Thu Apr 01, 2004 2:39 am    Post subject: Reply with quote

Well, you could set up a caching dns server on your local network, otherwise you may have to edit each machine's /etc/hosts file with the relavent info, but then you'd need to have your dhcp dish out static ip's. :?
Back to top
View user's profile Send private message
ghawkins
n00b
n00b


Joined: 29 Mar 2004
Posts: 6

PostPosted: Thu Apr 01, 2004 3:30 am    Post subject: Reply with quote

The caching dns server would not help in my case because I want to be able to establish connections between any two Linux machines regardless of which machines are up - but the having the dhcp give static ip's would do it. Do you know (or can you refer me to a reference) as to what dhcp command(s) would be used in the /etc/conf.d/net file to do this? :?:
Back to top
View user's profile Send private message
YopWongSapn
l33t
l33t


Joined: 26 Jan 2004
Posts: 627

PostPosted: Thu Apr 01, 2004 3:43 am    Post subject: Reply with quote

Well, you would have to set up your dhcp server to readthe mac addresses of each machine getting an address from the server and gives an ip that is assigned to that mac address.

I've did a quick search for dhcp -> mac address mapping, but didn't find much. I found the following, which may or may not help you...
http://www.progsoc.uts.edu.au/lists/lias/2001/June/msg00000.html

I would imagine with a little effort you will find a good source. :wink:
Back to top
View user's profile Send private message
moby
n00b
n00b


Joined: 17 Dec 2002
Posts: 29

PostPosted: Thu Apr 01, 2004 4:25 am    Post subject: Reply with quote

Couple questions:

1. Who/where is the DHCP server running. Is it one of your servers or someon elssees. Or are these machines getting IP address from a firewall/gateway/wap/hardare device that is handing out addresses?

2. IF DHCP server is a firewall/gateway/wap device does it also provide DNS servcies?

What you are looking for is to have your DNS server allow dynamic updates from DHCP. If it's a hardware device it probably doesn't provide that service.

I suggest you setup DNS/DHCP on one of your gentoo boxes. You can then setup Dynamic update. I'm pretty sure there are a few threads in this forum that discusses how to do that.

There are applications that do "DNS" serving, I'm most familiar with BIND(also known as named).

As far as static addresses, if you are working with a hardware device, I'm not sure that device will allow you to do static addresses. And, yes to static you must enter the mac address for each workstation in the DHCP server config.

I suggest you look into Dynamic update, it's easier.

Good luck

-moby
Back to top
View user's profile Send private message
Kihaji
Apprentice
Apprentice


Joined: 12 Sep 2002
Posts: 230

PostPosted: Thu Apr 01, 2004 4:45 am    Post subject: Reply with quote

Maybe just set up the machines with static IP's, turn off the DHCP on the router, and set the router to the Gateway.
Back to top
View user's profile Send private message
smart
Guru
Guru


Joined: 19 Nov 2002
Posts: 455

PostPosted: Thu Apr 01, 2004 3:00 pm    Post subject: Reply with quote

moby is perfectly correct. the right way to solve this is dynamic DNS updates, but there's a big chance if you use the router as DHCP source, it probably won't support that.
For the miracles of your windows server to find the address, i would not be surprised if you are running samba servers on your linuxen. in that case, windows is cheating cause it in an technically invalid assumption thinks it can generally just use your NetBIOS name with your IP ping so that this success is more or less an accident, though, i must admit, an accident not too improbable to happen, but still invalid and not related. Linux is TCP/IP.
Let us know a bit more about your setup to give a good suggestion.
Back to top
View user's profile Send private message
ghawkins
n00b
n00b


Joined: 29 Mar 2004
Posts: 6

PostPosted: Fri Apr 02, 2004 2:37 am    Post subject: Reply with quote

First of all I'd like to thank everyone for providing insight as to how to solve this problem. I think I have found what (for me, at least) is an optimal solution and would like to share it in case anyone else has a similar need.

I have a number of Linux (2 Fedora, 4 Gentoo) and Windows (4) machines at home all connected to the internet via a Linksys wireless router that uses dhcp. What I wanted to do was to use the router to connect all of the machines together to allow data transmission across any two machines. I also wanted the solution to be totally dynamic in that, no matter what two machines happened to be running at any time - I could always send data from one to the other.

Given any pair of machines, there are then three scenarios:

1) Two Windows machines: No problem here. I simply create a share folder on each Windows machine and use the "Computers Near Me" under "My Network Places" in the Windows explorer (I'm using Windows 2K Pro on all of the Windows machines.).

2) A Linux machine and a Windows machine: No problem here either. I simply set up Samba on the Linux machines and the Windows machine thinks it's talking to a Windows server.

3) Two Linux machines: Here I have a solution with NFS, but the problem is I can't determine the IP address of the Linux NFS server from the Linux NFS client. I have to go to the server and execute ifconfig to get the IP address and then key this address into the client using the mount command. I'm incredibly lazy and the thought of having to move from one machine to the other (even if it's through a KVM switch) is abhorrent to me;-)

I got a number of good suggestions as to how to solve the problem, most of which resolved into either a) have the dhcp server assign a static IP address and b) set up some kind of DNS and/or dhcp server. Solution a) is viable for me but no one seemed to know exactly how it could be done and (even if it could) I'm not sure my Linksys router would honor the request. The problem with solution b) is that I'd always have to have a given Linux machine active - which sort of defeats my initial goal.

Anyhow, the solution was incredibly simple - all I had to do was to take advantage of the "alias" capability in /etc/conf.d/net. My router (for example) always seems to start assigning IP addresses at 192.168.1.100 - so all I needed to do was pick a sufficiently high starting IP address (e.g., 192.168.1.110) for the first Linux machine, assign the next higher alias number for the next Linux machine, etc. When I do the NFS mount from the client, I simply use the alias IP address for the machine rather than the dhcp assigned address. Works like a champ.

Again, thanks to all, and I hope someone else will find this solution useful as well.

George

P.S. - One final note regarding the last response - the Windows ping works even if Samba is not running. I'd be really interested in knowing how the Windows ping does this - but, at this point, it's merely intellectual curiousity since I've now resolved the probelm
Back to top
View user's profile Send private message
moby
n00b
n00b


Joined: 17 Dec 2002
Posts: 29

PostPosted: Fri Apr 02, 2004 5:43 am    Post subject: Reply with quote

I'm glad you found a solution that works for you.

Another thing I thought about after reading one of the other posts, if these machines truly are on one network, you could go with Samba for file sharing and then use a utility to browse for all the shares using NETBIOS (windows network stuff) this should work on samba or windows shares.

I use the utility xfsamba it works like a champ.

Only catch I can see in this, is all machines will need to be in the same "workgroup", both windows and linux/samba.

-moby

P.S. this will only work if all the machines are on the same network (same switch/hub). Windows networking doesn't by default propogate accross routers.
Back to top
View user's profile Send private message
smart
Guru
Guru


Joined: 19 Nov 2002
Posts: 455

PostPosted: Fri Apr 02, 2004 5:05 pm    Post subject: Reply with quote

Hi again,
if we had actually know that you'd accept a static assignment by your DHCP server, then well, that would also have been a not too complicated option. All you need to do (given the router(dhcp server supports it) is to make the dhcp server aware of your NICs MAC address and tie it to a specific IP address. That's not too uncommonly supported.
In respect to samba not running... there is a possibilitry that "samba" was running when you thought it actually isn't. It's made up of two parts. smbd and nmbd. So if you stopped smbd and nmbd was/is still running, then the exercise of stopping samba defeated the purpose for this context.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum