How does dhcp(d) choose an IP address?

Todd Zullinger tmz at pobox.com
Sat Oct 13 21:49:22 UTC 2007


Timothy Murphy wrote:
> The laptop I am using now, which should be 192.168.2.11
> (according to /etc/hosts)

What's in /etc/hosts doesn't have any control over what's the DHCP
server will hand out.

> has been given the address 192.168.2.101, although I don't see any
> mention of this address anywhere on the desktop running dhcpd, or on
> the laptop, except in /var/lib/dhclient/dhclient-eth0.leases .  (The
> correct MAC address for the laptop, and its desired IP address, is
> given in /etc/dhcpd.conf , but for some reason this is ignored.)

Are you sure that there isn't another dhcp server running on the
network?  Have you checked in /var/log/messages for dhcp logs from the
time the ip was assigned to your laptop?

> I should say that WiFi works perfectly well with this wrong address.
> But it has made me realize that I am very hazy about how dhcp works,
> and how exactly dhcpd determines the addresses it will give out.  Is
> there a reasonably clear account of this anywhere?

Maybe the DHCP FAQ will be useful?

http://www.dhcp-handbook.com/dhcp_faq.html

I have my dhcp server give out specific addresses to some systems
based on the mac address and that's worked well for me.  So I know the
software isn't universally broken.  The trick is in finding out why
it's not working on your system.  Hopefully your logs will provide
some clues to you.  If not, perhaps post your dhcpd.conf.

> I saw incidentally that something or someone (I assume a yum update)
> had moved /etc/dhclient.conf to dhclient.conf.bak

I have no dhclient.conf (or .bak) on my system.  I do have a
dhclient-eth0.conf.  

> just leaving what looked like a fairly useless dhclient.conf.sample
> , confirming my view that the people who write sample files for
> Fedora are somewhat lacking in common sense.

If you're sure of that, please find out what overwrote the file and
file a bug report.  Just taking stabs in the dark and saying someone
else is lacking in common sense doesn't do anything to get real
problems fixed. :-)

-- 
Todd        OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Honesty is the best policy, but insanity is a better defense.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 542 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20071013/818812b9/attachment-0001.sig>


More information about the fedora-list mailing list