dhcpd(1M) TCP/IP R4.11 dhcpd(1M)
NAME
dhcpd - run Internet Dynamic Host Configuration Server
SYNOPSIS
dhcpd [-d] ...
where:
-d Debug level.
DESCRIPTION
Dhcpd implements an Internet Dynamic Host Configuration Protocol
server as defined in RFC1541 and RFC1533. Additionally implements the
Bootp Protocol Server as defined in RFC951 and RFC1048.
Options
-d Increase the level of debugging output. Specifying -d
followed by an integer value increases the number of debugging
output. 4 is the hightest level.
Configuration File
Upon startup, dhcpd first reads its configuration files, and then
begins listening for BOOTREQUEST/DHCPDISCOVER packets. The
configuration files for dhcpd are located in the /var/dhcp directory.
These files are dhcp.params and dhcp.clients.{dir,pag}. The
dhcp.params file contains configuration information for the dhcpd
daemon. The dhcp.clients.{dir,pag} files contain configuration
information about both BOOTP and DHCP clients.
The dhcp.params configuration file has a format similar to that of
termcap(5) in which two-character case-sensitive tags represent host
parameters. These parameter declarations are separated by colons (:).
The dhcp.clients also uses a similar format but uses dbm as it's
storage and retrieval mechanism. The general format is:
hostname{:tg=value}...
where hostname is the name of a bootp or dhcp client, tg is a two-
character tag, and value is the value of the parameter represented by
the tag. Most tags must be followed by an equals sign and a value as
above. Some may also appear in a boolean form with no value (i.e.,
:tg:). The recognized tags are:
ad Address Range Template Name (DHCP Only)
ba Begin Address of Managed Address Range (DHCP only)
bf Bootfile
bs Bootfile Size in 512-Octet size blocks
bt Base Time DHCP lease request was established (DHCP only)
ci Client ID. Key used for building client DB
cs Cookie server address list
df Dump Filename
dn Domain Name
ds Domain Server
ea Ending Address of Managed Address Range (DHCP only)
ef Extension File
fn Forwarding Server Name
gw Gateway address list
ha Host hardware address
hd Bootfile home directory
hn Send host name
ht Host hardware type (see Assigned Numbers RFC)
if Interface Address.
im Impress server address list
ip Host IP address
lg Log server address list
lp LPR server address list
lt Lease Time. Time interval (minutes) that a client's lease is valid for (DHCP only)
ms Message size
mw Minimum Wait
nb NetBIOS Name Server
nd NetBIOS Datagram Distribution Server
nm Name Server
nn NetBIOS Node Type
ns NetBIOS Scope Option
nt NTP Server
ra Reply Address
rl Resource location protocol server address list
rp Root Path
ry Relay Server
sa Boot server address
sm Host subnet mask
sv Server Address
sw Swap Server
tc Table continuation (points to similar "template" host entry)
td TFTP Directory
to Time offset in seconds from UTC
ts Time server address list
ty Client Type. Internal use only
vm Vendor Information format (magic cookie) selector
yd NIS Domain
ys NIS Server
There is also a generic tag, Tn, where n is an RFC1048 vendor field
tag number. Thus it is possible to immediately take advantage of
future extensions to RFC1048 without being forced to modify bootpd
first. Generic data may be represented as either a stream of
hexadecimal numbers or as a quoted string of text characters. The
length of the generic data is automatically determined and inserted
into the proper field(s) of the RFC1048-style bootp reply.
The following tags take a space- or tab-separated list of IP
addresses: cs, ds, gw, im, lg, lp, ns, rl, sv, sw, and ts. The ip,
sa, and sm tags each take a single IP address. All IP addresses are
specified in standard Internet "dot" notation and may use decimal,
octal, or hexadecimal numbers (octal numbers begin with 0,
hexadecimal numbers begin with '0x' or '0X').
The ht tag specifies the hardware type code as either an unsigned
decimal, octal, or hexadecimal integer or one of the following
symbolic names: ethernet or ether for 10Mb Ethernet, ethernet3 or
ether3 for 3Mb experimental Ethernet, ieee802, tr, or token-ring for
IEEE 802 networks, pronet for Proteon ProNET Token Ring, or chaos,
arcnet, or ax.25 for Chaos, ARCNET, and AX.25 Amateur Radio networks,
respectively. The ha tag takes a hardware address that must be
specified in hexadecimal; optional periods and/or a leading '0x' may
be included for readability. The ha tag must be preceded by the ht
tag (either explicitly or implicitly; see tc below).
The host name, home directory, and bootfile are text strings that may
be optionally surrounded by double quotes ("). The client's request
and the values of the hd and bf symbols determine how the server
fills in the bootfile field of the bootp reply packet.
If the client specifies an absolute pathname and that file exists on
the server machine, that pathname is returned in the reply packet.
If the file cannot be found, the request is discarded; no reply is
sent. If the client specifies a relative pathname, a full pathname
is formed by prepending the value of the hd tag and testing for
existence of the file. If the hd tag is not supplied in the
configuration file or if the resulting boot file cannot be found,
then the request is discarded. If the sa tag is defined, no file
existence check is performed.
Clients that specify null boot files always elicit a reply from the
server. The exact reply depends upon the hd and bf tags. If the bf
tag gives an absolute pathname and the file exists, that pathname is
returned in the reply packet. Otherwise, if the hd and bf tags
together specify an accessible file, that filename is returned in the
reply. If a complete filename cannot be determined or the file does
not exist, the reply will contain a zeroed-out bootfile field.
In all these cases, existence of the file means that, in addition to
actually being present, the file must have its public read access bit
set, since this is required by tftpd(1M) to permit the file transfer.
Also, all filenames are first tried as filename.hostname and then
simply as filename, thus providing for individual per-host bootfiles.
The time offset to may be either a signed decimal integer specifying
the client's time zone offset in seconds from UTC, or the keyword
auto, which uses the server's time-zone offset. Specifying the to
symbol as a boolean has the same effect as specifying auto as its
value.
The bootfile size bs can be either a decimal, octal, or hexadecimal
integer specifying the size of the bootfile in 512-octet blocks, or
the keyword auto, which causes the server to automatically calculate
the bootfile size at each request. As with the time offset,
specifying the bs symbol as a boolean has the same effect as
specifying auto as its value.
The vendor information section of a bootp reply takes one of two
formats: DARPA's RFC1048 style or Carnegie Mellon University's style.
The vendor information format selector vm takes one of the following
keywords: auto (indicating that vendor information is determined by
the client's request), rfc1048 (which always forces an RFC1048-style
reply), or cmu (which always forces a CMU-style reply).
The hn tag is strictly a boolean tag; it does not take the usual
equals-sign and value. Its presence indicates that the host name
should be sent to RFC1048 clients. Dhcpd tries to send the entire
host name as it is specified in the configuration file; if this does
not fit into the reply packet, the name is shortened to just the host
field (up to the first period, if present) and then tried. In no
case is an arbitrarily-truncated host name sent (if nothing
reasonable fits, nothing is sent).
Often, many host entries share common values for certain tags (such
as name servers, etc.). Rather than repeatedly specifying these
tags, a full specification can be listed for one host entry and
shared by others via the tc (table continuation) mechanism. Often,
the template entry is a dummy host that doesn't actually exist and
never sends bootp requests. This feature is similar to the tc
feature of termcap(5) for similar terminals. Note that bootpd lets
the tc tag symbol appear anywhere in the host entry, unlike termcap,
which requires it to be the last tag. Information explicitly
specified for a host always overrides information implied by a tc tag
symbol, regardless of its location within the entry. The value of
the tc tag may be the host name or IP address of any host entry
previously listed in the configuration file.
The template host (tc tag) is provided so that the system
administrator can setup one or more entries in the
/var/dhcp/dhcp.params file that contain defaults for their system.
Items that would probably be included in these entries would be
gateway, subnet mask, time offset, time server, lease time, etc.
Dhcp Client templates would more than likely vary from Bootp Client
templates. Once these entries are setup, the system administrator
only needs to setup specific information for a client (e.g. IP
Address and hardware address) and include the appropriate template
host for the remainder of the information.
It is assumed that the system administrator knows what each of the
templates defines. When the system administrator is adding a client
and specifies a template host, they will then be asked if they want
to accept all of the remaining default values including those that
are part of the template. If they type no, then all of the value
from the template will be displayed they will not see a change in the
sysadm menus showing the fields and values that are defined in the
template host. The values in the template host will be applied to
the client when dhcpd is started and the /var/dhcp/dhcp.params is
read in.
Sometimes it is necessary to delete a specific tag after it has been
inferred via tc. This can be done using the construction tag@, which
removes the effect of tag as in termcap(5). For example, to
completely undo an IEN-116 name server specification, use ":ns@:" at
an appropriate place in the configuration entry. After removal with
@, a tag is eligible to be set again through the tc mechanism.
Blank lines and lines beginning with "#" are ignored in the
configuration file. Host entries are separated from one another by
newlines; a single host entry may be extended over multiple lines if
the lines end with a backslash (\). It is also acceptable for lines
to be longer than 80 characters. Tags may appear in any order, with
the following exceptions: the host name must be the very first field
in an entry, and the hardware type must precede the hardware address.
An example /var/dhcp/dhcp.params file follows:
# Sample dhcp.params file
#>STARTGLOBAL
default1:\
hd=/usr/boot:bf=null:\
ds=128.2.35.50 128.2.13.21:\
ns=0x80020b4d 0x80020ffd:\
ts=0x80020b4d 0x80020ffd:\
sm=255.255.0.0:gw=0x8002fe24:\
hn:vm=rfc1048:to=-18000:lt=0x0e10:
default2:\
hd=/usr/boot:bf=null:\
ds=128.2.15.10 128.2.8.21:\
ns=0x80020b4d 0x80020ffd:\
ts=0x80020b4d 0x80020ffd:\
sm=255.255.0.0:gw=0x8002fe24:\
hn:vm=rfc1048:to=-18000:lt=0xffffffff:
#>ENDGLOBAL
#>STARTRELAY
#>ENDRELAY
#>STARTMANAGED
ntclients:ba=128.2.11.100:ea=128.2.11.140:tc=default1
otherclients:ba=128.222.12.20:ea=128.222.12.30:tc=default2
#>ENDMANAGED
# Sample dhcp.clients file (what we would see if we executed
# a dbm dump /var/dhcp/dhcp.clients. The first 16 bytes of each line would
# show the clients database key. The remainder of the line would be)
carnegie:ci=067ff8100000AF:ht=6:ha=7FF8100000AF:ip=128.2.11.100:ad=ntclients:ty=1:
baldwin:ci=010800200159C3:ht=1:ha=0800200159C3:ip=128.2.11.101:ad=ntclients:ty=3:
wylie:ci=00DD00CADF0001:ht=1:ha=00DD00CADF00:ip=128.2.12.20:ad=otherclients::ty=3:
arnold:ci=010800200102AD:ht=1:ha=0800200102AD:ip=128.2.12.21:ad=otherclients:ty=1:
bairdford:ci=0108002B02A2F9:ht=1:ha=08002B02A2F9:ip=128.2.11.102:ad=ntclients:ty=3:
bakerstown:ci=0108002B0287C8:ht=1:ha=08002B0287C8:ip=128.2.11.103:ad=ntclients:ty=3:
# Special domain name server for next host
butlerjct:ci=0108002001560D:ht=1:ha=08002001560D:ip=128.2.11.104:ds=128.2.13.42:ad=ntclients:ty=1
Dhcpd looks in /etc/services to find the port numbers it should use.
Two entries are extracted: bootps--the bootp server listening port,
and bootpc--the destination port used to reply to clients. If the
port numbers cannot be determined this way, they are assumed to be 67
for the server and 68 for the client.
Dhcpd rereads its configuration file when it receives a hangup
signal, SIGHUP, or when it receives a bootp or dhcp request packet
and detects that the file has been updated. Hosts may be added,
deleted or modified when the configuration file is reread.
EXAMPLE
To run dhcpd:
/usr/bin/dhcpd
FILES
/var/dhcp/dhcp.params
/var/dhcp/dhcp.clients
/etc/services
SEE ALSO
admdhcpclient(1M), admdhcpmanaged(1M), admdhcpglobal(1M),
admdhcprelay(1M), tftpd(1M), termcap(5).
DARPA Internet Request For Comments RFC951, RFC1497, Assigned
Numbers.
DARPA Internet Request for Comments RFC1033, RFC1541, Assigned
Numbers
BUGS
Individual host entries must not exceed 1024 characters.
Licensed material--property of copyright holder(s)