DHCP Help Again

Justin Moore justin at cs.duke.edu
Thu Apr 11 20:54:16 PDT 2002

Hello all,
   Part of a project I've been working on deals some with boot management
and DHCP specifically.  I'm not familiar with the NPACI solution/codebase,
but I hacked a version of proxydhcp to work with a MySQL backend.  It has
some nice hooks in it which let you know if the machine is booting PXE or
booting from dhclient/pump/whatever.  I think having the DB backend is a
little nicer than having to worry about the leases file (XML or not) since
it gives you more fine-grained control over who has access to the
information and how that information gets parsed.  Plus it can detect when
a new host is coming up and add a mapping to the DB without requiring you
to parse through /var/log/messages. :)

   Obviously my code has some parts which are somewhat project-specific
for me (I don't think everyone wants to boot off the same ramdisk I do by
default :)) but I could post the code in a few weeks (deadlines coming up)
if anyone's interested in such a beast.

   Another nice part of the DB backend is that generating a future
dhcpd.conf file is pretty easy:

mysql_query("SELECT HWaddr,IPaddr FROM nics ORDER BY IPaddr");

and then spew the output to a file as desired. :)


Department of Computer Science, Duke University, Durham, NC 27708-0129
Email:  justin at cs.duke.edu

On Thu, 11 Apr 2002, Robert G. Brown wrote:

> On Wed, 10 Apr 2002 tegner at nada.kth.se wrote:
> > Very helpful! Thanks!
> >
> > But I'm still curious about how you make - automagically - the hardware ethernet
> > line in dhcpd.conf initially. Say you have 100 machines. One way I would think
> > of would be to use kickstart and:
> >
> > Install the machines and boot them up in sequence and using the range statement
> > in dhcpd.conf (so that the first machine gets, the second
> > ...)
> >
> > Once all nodes are up use some script to extract the mac addresses for all the
> > nodes and either modify dhcpd.conf - or - discard of dhcp completely and
> > hardwire the ip-addresses to each node.
> >
> > But I'm sure there are better ways to do this?
> Not that I know of.  Maybe somebody else knows of one.  I'd just use
> perl or bash (either would probably work, although parsing is generally
> easier in perl), parse e.g.
> Apr 11 08:18:09 lucifer dhcpd: DHCPREQUEST for from 00:20:e0:6d:a0:05 via eth0
> Apr 11 08:18:09 lucifer dhcpd: DHCPACK on to 00:20:e0:6d:a0:05 via eth0
> from /var/log/messages on the dhcp server, and write an output routine
> to generate
> # golem (Linux/Windows laptop lilith, second/100BT interface)
> host golem {
>         hardware ethernet       00:20:e0:6d:a0:05;
>         fixed-address ;
>         next-server   ;
>         option routers;
>         option domain-name      "rgb.private.net";
>         option host-name        "golem";
> }
> and
>   golem.rgb.private.net   golem
> and append them to /etc/dhcpd.conf and /etc/hosts respectively, and then
> distribute copies of the resulting /etc/hosts -- as Josip made
> eloquently clear your private internal network should resolve
> consistently on all PIN hosts and probably should have SOME sort of
> domainname defined so that software the might include a
> getdomainbyname() call and might not include an adequate check and
> handle of a null value can cope.  It's hard to know what assumptions
> were made by the designer of every single piece of network software you
> might want to run...
> Of coures you'll probably want to do the b01, b02, b03... hostname
> iteration -- I'm just pulling an example at random out of my own log
> tables.
>    rgb
> --
> Robert G. Brown	                       http://www.phy.duke.edu/~rgb/
> Duke University Dept. of Physics, Box 90305
> Durham, N.C. 27708-0305
> Phone: 1-919-660-2567  Fax: 919-660-2525     email:rgb at phy.duke.edu
> _______________________________________________
> Beowulf mailing list, Beowulf at beowulf.org
> To change your subscription (digest mode or unsubscribe) visit http://www.beowulf.org/mailman/listinfo/beowulf

More information about the Beowulf mailing list