Previous | Next (tftpd) | Next (nfs) | Table of Contents

Setting up the dhcpd server, Diskless NetBSD HOW-TO

The Internet Dynamic Host Configuration Protocol is used by the boot ROM in some workstations to request IP addresses and boot loader filenames. dhcpd typically runs as a standalone daemon. Many DHCP servers will handle BOOTP requests. If you find your bootpd causing trouble, dhcpd will serve in its stead. Make sure that your system is not currently running bootpd as it will prevent dhcpd from running.

There are two common dhcp packages, one from ISC and from CMU. NetBSD ships with the ISC implementation, since it is actively supported and runs on a wide variety of OSes. Many OSes ship with this server pre-installed.

The /etc/dhcpd.conf file has a standard format across all platforms. The formatting is very flexible. We provide a simple version that functions for serving a client with a fixed (i.e. pre-determined) address. For a more thorough understanding of how to configure the ISC dhcpd we suggest reading the man pages: dhcpd(8), dhpcpd.conf(5), and dhcpd-options(5). You might also want to read the NetBSD DHCP HOW-TO. You might also want to poke around the official ISC DHCP website.

Be careful when using next-server directive when using tftp as the next stage of bootloading. The client will assume that this next-server handles both tftp and nfs.

The sample dhcpd.conf includes comments. We suggest you save this into your /etc directory and modify the addresses for your site. Not all of the options listed in this file are necessary for most clients, however, it is best if you leave them in and remove the options if they get in the way.

Setting up dhcpd, NetBSD
Setting up dhcpd, ISC's DHCPD (NetBSD, OpenBSD, FreeBSD, MacOS X, Darwin, Linux, SunOS, Solaris, NEXTSTEP, HP-UX, BSD/OS, OSF/1, and Ultrix)
Setting up dhcpd, CMU's DHCPD (older versions of SunOS, Solaris, HP-UX, IRIX, and AIX)
Setting up dhcpd, Solaris

[If you have details for any other platform, please let us know]

If your OS isn't listed here, you can try compiling it from one of these source packages:


NetBSD

If you have your own kernel, make sure you have the following in your config file:
pseudo-device   bpfilter       4
The GENERIC kernel distributed with NetBSD has this compiled in.

  1. # touch /var/db/dhcpd.leases
    dhcpd complains if there is no existing file to store lease information in.

  2. If you don't already have an /etc/dhcpd.conf, install the sample dhcpd.conf and edit it for your site.

  3. # ps -aux | grep dhcpd
    kill that process. Note that kill -HUP does not force dhcpd 2 to re-read its configuration file.

  4. # /usr/sbin/dhcpd -d -f

This will start dhcpd in debugging mode. When dhcpd gets a request, it will print the following message:

BOOTREQUEST from CC:CC:CC:CC:CC:CC via le0 (non-rfc1048)
BOOTREPLY for 192.168.1.10 to client.test.net
(CC:CC:CC:CC:CC:CC) via le0
DHCPDISCOVER from CC:CC:CC:CC:CC:CC via le0
DHCPOFFER on 192.168.1.10 to CC:CC:CC:CC:CC:CC via le0
DHCPREQUEST for 192.168.1.10 from CC:CC:CC:CC:CC:CC via le0
DHCPACK on 192.168.1.10 to CC:CC:CC:CC:CC:CC via le0
The bootloaders typically do not give any feedback, but when the kernel is looking for a root filesystem, it will print the following message:
boot device: <unknown>
nfs_boot: trying DHCP/BOOTP
nfs_boot: DHCP server: 0xC0A80105
nfs_boot: my_name=client
nfs_boot: my_domain=test.net
nfs_boot: my_addr=0xC0A8010A
nfs_boot: my_mask=0xffffff00
nfs_boot: gateway=0xC0A80101
root on :/export/client/root

Continue on to setting up tftpd or nfs


Compiling and installing the ISC DHCPD

The ISC DHCPD supports the following platforms:
NetBSD, OpenBSD, FreeBSD, MacOS X, Darwin, Linux, SunOS, Solaris, NEXTSTEP, HP-UX, BSD/OS, OSF/1, and Ultrix

Some platforms ship with the ISC DHCPD pre-installed (such as NetBSD, OpenBSD, FreeBSD, and Linux). You should check to see if it is pre-installed on your system and use that version instead of compiling a new version from scratch. The setup procedure is essentially the same, and the configuration file is identical.

  1. Download dhcpd-3.0.1 or later from ISC.org.

  2. Follow the directions in the README file, taking note of the limits of your platform. Briefly, the procedure is:
    # ./configure
    # make
    # make install
    If you get compilation errors be certain that cc is actually gcc, as many of the commercial unices ship with broken C compilers.

  3. # touch /var/db/dhcpd.leases
    dhcpd complains if there is no existing file to store lease information in. Depending on your platform, dhcpd looks for the lease file in different locations.

  4. If you don't already have an /etc/dhcpd.conf, install the sample dhcpd.conf and edit it for your site.

  5. # ps -aux | grep dhcpd
    kill that process. Note that kill -HUP does not force dhcpd 2 to re-read its configuration file.

  6. # /usr/sbin/dhcpd -d -f
    or wherever make install placed dhcpd.

This will start dhcpd in debugging mode. When dhcpd gets a request, it will print the following message:

BOOTREQUEST from CC:CC:CC:CC:CC:CC via le0 (non-rfc1048)
BOOTREPLY for 192.168.1.10 to client.test.net
(CC:CC:CC:CC:CC:CC) via le0
DHCPDISCOVER from CC:CC:CC:CC:CC:CC via le0
DHCPOFFER on 192.168.1.10 to CC:CC:CC:CC:CC:CC via le0
DHCPREQUEST for 192.168.1.10 from CC:CC:CC:CC:CC:CC via le0
DHCPACK on 192.168.1.10 to CC:CC:CC:CC:CC:CC via le0
The bootloaders typically do not give any feedback, but when the kernel is looking for a root filesystem, it will print the following message:
boot device: <unknown>
nfs_boot: trying DHCP/BOOTP
nfs_boot: DHCP server: 0xC0A80105
nfs_boot: my_name=client
nfs_boot: my_domain=test.net
nfs_boot: my_addr=0xC0A8010A
nfs_boot: my_mask=0xffffff00
nfs_boot: gateway=0xC0A80101
root on :/export/client/root

Continue on to setting up tftpd or nfs


CMU's DHCPD

CMU's dhcp is known to work on older versions of SunOS, Solaris, IRIX, HPUX, and AIX. I failed to get it to compile on Solaris 2.6 and HP-UX 10.20.

  1. download and extract into its own directory dhcp-3.3.7.tar.gz

  2. # ./configure

  3. # make

  4. # make install

  5. You're on your own here, as far as setting it up.

The bootloaders typically do not give any feedback, but when the kernel is looking for a root filesystem, it will print the following message:

boot device: <unknown>
nfs_boot: trying DHCP/BOOTP
nfs_boot: DHCP server: 0xC0A80105
nfs_boot: my_name=client
nfs_boot: my_domain=test.net
nfs_boot: my_addr=0xC0A8010A
nfs_boot: my_mask=0xffffff00
nfs_boot: gateway=0xC0A80101
root on :/export/client/root

Continue on to setting up tftpd or nfs


Solaris

Solaris 2.6 and later have a native dhcpd. For earlier versions, you'll need to compile dhcpd from sources.

  1. Coming soon.
    For now, follow the directions in the Linux on the Sun JavaStation NC HOWTO

Continue on to setting up tftpd or nfs


Previous | Next (tftpd) | Next (nfs) | Table of Contents
NetBSD Home Page
NetBSD Documentation top level

(Contact us) $NetBSD: dhcpd.html,v 1.25 2004/10/30 22:33:31 jschauma Exp $
Copyright © 1998-2004 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.