3b9e0e2
.\"	dhclient.8
3b9e0e2
.\"
3b9e0e2
.\" Copyright (c) 2004,2007 by Internet Systems Consortium, Inc. ("ISC")
3b9e0e2
.\" Copyright (c) 1996-2003 by Internet Software Consortium
3b9e0e2
.\"
3b9e0e2
.\" Permission to use, copy, modify, and distribute this software for any
3b9e0e2
.\" purpose with or without fee is hereby granted, provided that the above
3b9e0e2
.\" copyright notice and this permission notice appear in all copies.
3b9e0e2
.\"
3b9e0e2
.\" THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
3b9e0e2
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
3b9e0e2
.\" MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR
3b9e0e2
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
3b9e0e2
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
3b9e0e2
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
3b9e0e2
.\" OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
3b9e0e2
.\"
3b9e0e2
.\"   Internet Systems Consortium, Inc.
3b9e0e2
.\"   950 Charter Street
3b9e0e2
.\"   Redwood City, CA 94063
3b9e0e2
.\"   <info@isc.org>
3b9e0e2
.\"   http://www.isc.org/
3b9e0e2
.\"
3b9e0e2
.\" Support and other services are available for ISC products - see
3b9e0e2
.\" http://www.isc.org for more information.
3b9e0e2
.\"
3b9e0e2
.\" $Id: dhclient.8,v 1.18.116.4 2007/05/23 23:30:32 each Exp $
3b9e0e2
.\"
3b9e0e2
.TH dhclient 8
3b9e0e2
.SH NAME
3b9e0e2
dhclient - Dynamic Host Configuration Protocol Client
3b9e0e2
.SH SYNOPSIS
3b9e0e2
.B dhclient
3b9e0e2
[
3b9e0e2
.B -p
3b9e0e2
.I port
3b9e0e2
]
3b9e0e2
[
3b9e0e2
.B -d
3b9e0e2
]
3b9e0e2
[
3b9e0e2
.B -e
3b9e0e2
.I VAR=value
3b9e0e2
]
3b9e0e2
[
3b9e0e2
.B -q
3b9e0e2
]
3b9e0e2
[
3b9e0e2
.B -1
3b9e0e2
]
3b9e0e2
[
3b9e0e2
.B -r
3b9e0e2
]
3b9e0e2
[
3b9e0e2
.B -x
3b9e0e2
]
3b9e0e2
[
3b9e0e2
.B -lf
3b9e0e2
.I lease-file
3b9e0e2
]
3b9e0e2
[
3b9e0e2
.B -pf
3b9e0e2
.I pid-file
3b9e0e2
]
3b9e0e2
[
3b9e0e2
.B -cf
3b9e0e2
.I config-file
3b9e0e2
]
3b9e0e2
[
3b9e0e2
.B -sf
3b9e0e2
.I script-file
3b9e0e2
]
3b9e0e2
[
3b9e0e2
.B -s
3b9e0e2
server
3b9e0e2
]
3b9e0e2
[
3b9e0e2
.B -g
3b9e0e2
relay
3b9e0e2
]
3b9e0e2
[
3b9e0e2
.B -n
3b9e0e2
]
3b9e0e2
[
3b9e0e2
.B -nw
3b9e0e2
]
3b9e0e2
[
3b9e0e2
.B -w
3b9e0e2
]
3b9e0e2
[
3b9e0e2
.B -B
3b9e0e2
]
3b9e0e2
[
3b9e0e2
.B -I
3b9e0e2
.I dhcp-client-identifier
3b9e0e2
]
3b9e0e2
[
3b9e0e2
.B -H
3b9e0e2
.I host-name
3b9e0e2
.R |
3b9e0e2
.B -F fqdn.fqdn
3b9e0e2
]
3b9e0e2
[
3b9e0e2
.B -V
3b9e0e2
.I vendor-class-identifier
3b9e0e2
]
3b9e0e2
[
3b9e0e2
.B -R
3b9e0e2
.I request option list
3b9e0e2
]
3b9e0e2
[
3b9e0e2
.B -T
3b9e0e2
.I timeout
3b9e0e2
]
3b9e0e2
[
3b9e0e2
.I if0
3b9e0e2
[
3b9e0e2
.I ...ifN
3b9e0e2
]
3b9e0e2
]
3b9e0e2
.SH DESCRIPTION
3b9e0e2
The Internet Systems Consortium DHCP Client, dhclient, provides a
3b9e0e2
means for configuring one or more network interfaces using the Dynamic
3b9e0e2
Host Configuration Protocol, BOOTP protocol, or if these protocols
3b9e0e2
fail, by statically assigning an address.
3b9e0e2
.SH OPERATION
3b9e0e2
.PP
3b9e0e2
The DHCP protocol allows a host to contact a central server which
3b9e0e2
maintains a list of IP addresses which may be assigned on one or more
3b9e0e2
subnets.   A DHCP client may request an address from this pool, and
3b9e0e2
then use it on a temporary basis for communication on network.   The
3b9e0e2
DHCP protocol also provides a mechanism whereby a client can learn
3b9e0e2
important details about the network to which it is attached, such as
3b9e0e2
the location of a default router, the location of a name server, and
3b9e0e2
so on.
3b9e0e2
.PP
3b9e0e2
On startup, dhclient reads the
3b9e0e2
.IR dhclient.conf
3b9e0e2
for configuration instructions.   It then gets a list of all the
3b9e0e2
network interfaces that are configured in the current system.   For
3b9e0e2
each interface, it attempts to configure the interface using the DHCP
3b9e0e2
protocol.
3b9e0e2
.PP
3b9e0e2
In order to keep track of leases across system reboots and server
3b9e0e2
restarts, dhclient keeps a list of leases it has been assigned in the
3b9e0e2
dhclient.leases(5) file.   On startup, after reading the dhclient.conf
3b9e0e2
file, dhclient reads the dhclient.leases file to refresh its memory
3b9e0e2
about what leases it has been assigned.
3b9e0e2
.PP
3b9e0e2
When a new lease is acquired, it is appended to the end of the
3b9e0e2
dhclient.leases file.   In order to prevent the file from becoming
3b9e0e2
arbitrarily large, from time to time dhclient creates a new
3b9e0e2
dhclient.leases file from its in-core lease database.  The old version
3b9e0e2
of the dhclient.leases file is retained under the name
3b9e0e2
.IR dhclient.leases~
3b9e0e2
until the next time dhclient rewrites the database.
3b9e0e2
.PP
3b9e0e2
Old leases are kept around in case the DHCP server is unavailable when
3b9e0e2
dhclient is first invoked (generally during the initial system boot
3b9e0e2
process).   In that event, old leases from the dhclient.leases file
3b9e0e2
which have not yet expired are tested, and if they are determined to
3b9e0e2
be valid, they are used until either they expire or the DHCP server
3b9e0e2
becomes available.
3b9e0e2
.PP
3b9e0e2
A mobile host which may sometimes need to access a network on which no
3b9e0e2
DHCP server exists may be preloaded with a lease for a fixed
3b9e0e2
address on that network.   When all attempts to contact a DHCP server
3b9e0e2
have failed, dhclient will try to validate the static lease, and if it
3b9e0e2
succeeds, will use that lease until it is restarted.
3b9e0e2
.PP
3b9e0e2
A mobile host may also travel to some networks on which DHCP is not
3b9e0e2
available but BOOTP is.   In that case, it may be advantageous to
3b9e0e2
arrange with the network administrator for an entry on the BOOTP
3b9e0e2
database, so that the host can boot quickly on that network rather
3b9e0e2
than cycling through the list of old leases.
3b9e0e2
.PP
3b9e0e2
The names of the network interfaces that dhclient should attempt to
3b9e0e2
configure may be specified on the command line.  If no interface names
3b9e0e2
are specified on the command line dhclient will normally identify all
3b9e0e2
network interfaces, eliminating non-broadcast interfaces if
3b9e0e2
possible, and attempt to configure each interface.
3b9e0e2
.PP
3b9e0e2
It is also possible to specify interfaces by name in the
3b9e0e2
.B dhclient.conf(5)
3b9e0e2
file.   If interfaces are specified in this way, then the client will
3b9e0e2
only configure interfaces that are either specified in the
3b9e0e2
configuration file or on the command line, and will ignore all other
3b9e0e2
interfaces.
3b9e0e2
.SH OPTIONS
3b9e0e2
.TP
3b9e0e2
.BI \-p\ <port\ number>
3b9e0e2
The UDP port number the DHCP client should listen and transmit on.  If
3b9e0e2
unspecified,
3b9e0e2
.B dhclient
3b9e0e2
uses the default port 68.  This option is mostly useful for debugging
3b9e0e2
purposes.  If a different port is specified for the client to listen and
3b9e0e2
transmit on, the client will also use a different destination port - one
3b9e0e2
greater than the specified destination port.
3b9e0e2
3b9e0e2
.TP
3b9e0e2
.BI \-d
3b9e0e2
Force
3b9e0e2
.B dhclient
3b9e0e2
to run as a foreground process.  This is useful when running the client
3b9e0e2
under a debugger, or when running it out of inittab on System V systems.
3b9e0e2
3b9e0e2
.TP
3b9e0e2
.BI \-e\ VAR=value
3b9e0e2
Define additional environment variables for the environment where
3b9e0e2
dhclient-script executes.  You may specify multiple
3b9e0e2
.B \-e
3b9e0e2
options on the command line.
3b9e0e2
3b9e0e2
.TP
3b9e0e2
.BI \-q
3b9e0e2
Suppress all terminal and log output except error messages.
3b9e0e2
3b9e0e2
.TP
3b9e0e2
.BI \-1
3b9e0e2
Try one to get a lease.  On failure, exit with code 2.
3b9e0e2
3b9e0e2
.TP
3b9e0e2
.BI \-r
3b9e0e2
Tell
3b9e0e2
.B dhclient
3b9e0e2
to release the current lease it has from the server.  This is not required
3b9e0e2
by the DHCP protocol, but some ISPs require their clients to notify the
3b9e0e2
server if they wish to release an assigned IP address.
3b9e0e2
3b9e0e2
.TP
3b9e0e2
.BI \-lf\ <lease-file>
3b9e0e2
Path to the lease database file.  If unspecified, the default
3b9e0e2
.B DBDIR/dhclient.leases
3b9e0e2
is used.
3b9e0e2
3b9e0e2
.TP
3b9e0e2
.BI \-pf\ <pid-file>
3b9e0e2
Path to the process ID file.  If unspecified, the default
3b9e0e2
.B RUNDIR/dhclient.pid
3b9e0e2
is used.
3b9e0e2
3b9e0e2
.TP
3b9e0e2
.BI \-cf\ <config-file>
3b9e0e2
Path to the client configuration file.  If unspecified, the default
3b9e0e2
.B ETCDIR/dhclient.conf
3b9e0e2
is used.
3b9e0e2
3b9e0e2
.TP
3b9e0e2
.BI \-sf\ <script-file>
3b9e0e2
Path to the network configuration script invoked by
3b9e0e2
.B dhclient
3b9e0e2
when it gets a lease.  If unspecified, the default
3b9e0e2
.B CLIENTBINDIR/dhclient-script
3b9e0e2
is used.
3b9e0e2
3b9e0e2
.TP
3b9e0e2
.BI \-s\ <server>
3b9e0e2
Specifiy the server IP address or fully qualified domain name to transmit
3b9e0e2
DHCP protocol messages to.  Normally,
3b9e0e2
.B dhclient
3b9e0e2
transmits these messages to 255.255.255.255 (the IP limited broadcast
3b9e0e2
address).  Overriding this is mostly useful for debugging purposes.
3b9e0e2
3b9e0e2
.TP
3b9e0e2
.BI \-g\ <relay>
3b9e0e2
Only for debugging.  Set the giaddr field of all packets the client
3b9e0e2
sends to the IP address specified.  This should not be expected to work
3b9e0e2
in any consistent or useful way.
3b9e0e2
3b9e0e2
.TP
3b9e0e2
.BI \-n
3b9e0e2
Do not configure any interfaces.  Most useful combined with the
3b9e0e2
.B -w
3b9e0e2
option.
3b9e0e2
3b9e0e2
.TP
3b9e0e2
.BI \-nw
3b9e0e2
Become a daemon process immediately (nowait) rather than waiting until an IP
3b9e0e2
address has been acquired.
3b9e0e2
3b9e0e2
.TP
3b9e0e2
.BI \-w
3b9e0e2
Keep running even if no network interfaces are found.  The
3b9e0e2
.B omshell
3b9e0e2
program can be used to notify the client when a network interface has been
3b9e0e2
added or removed so it can attempt to configure an IP address on that
3b9e0e2
interface.
3b9e0e2
3b9e0e2
.TP
3b9e0e2
.BI \-B
3b9e0e2
Set the BOOTP broadcast flag in request packets so servers will always
3b9e0e2
broadcast replies.
3b9e0e2
3b9e0e2
.TP
3b9e0e2
.BI \-I\ <dhcp-client-identifier>
3b9e0e2
Specify the dhcp-client-identifier option to send to the DHCP server.
3b9e0e2
3b9e0e2
.TP
3b9e0e2
.BI \-H\ <host-name>
3b9e0e2
Specify the host-name option to send to the DHCP server.  The host-name
3b9e0e2
string only contains the client's hostname prefix, to which the server will
3b9e0e2
append the ddns-domainname or domain-name options, if any, to derive the
3b9e0e2
fully qualified domain name of the client.  The
3b9e0e2
.B -H
3b9e0e2
option cannot be used with the
3b9e0e2
.B -F
3b9e0e2
option.
3b9e0e2
3b9e0e2
.TP
3b9e0e2
.BI \-F\ <fqdn.fqdn>
3b9e0e2
Specify the fqdn.fqdn option to send to the DHCP server.  This option cannot
3b9e0e2
be used with the
3b9e0e2
.B -H
3b9e0e2
option.  The fqdn.fqdn option must specify the complete domain name of the
3b9e0e2
client host, which the server may use for dynamic DNS updates.
3b9e0e2
3b9e0e2
.TP
3b9e0e2
.BI \-V\ <vendor-class-identifier>
3b9e0e2
Specify the vendor-class-identifier option to send to the DHCP server.
3b9e0e2
3b9e0e2
.TP
3b9e0e2
.BI \-R\ <option>[,<option>...]
3b9e0e2
Specify the list of options the client is to request from the server.  The
3b9e0e2
option list must be a single string consisting of option names separated
3b9e0e2
by at least one command and optional space characters.  The default option
3b9e0e2
list is:
3b9e0e2
3b9e0e2
.BR
3b9e0e2
    subnet-mask, broadcast-address, time-offset, routers,
3b9e0e2
.BR
3b9e0e2
    domain-name, domain-name-servers, host-name, nis-domain,
3b9e0e2
.BR
3b9e0e2
    nis-servers, ntp-servers
3b9e0e2
3b9e0e2
The
3b9e0e2
.B -R
3b9e0e2
option does not append options to the default request, it overrides the
3b9e0e2
default request list.  Keep this in mind if you want to request an
3b9e0e2
additional option besides the default request list.  You will have to
3b9e0e2
specify all option names for the
3b9e0e2
.B -R
3b9e0e2
parameter.
3b9e0e2
3b9e0e2
.TP
3b9e0e2
.BI \-T\ <timeout>
3b9e0e2
Specify the time after which
3b9e0e2
.B dhclient
3b9e0e2
will decide that no DHCP servers can be contacted when no responses have been
3b9e0e2
received.
3b9e0e2
3b9e0e2
.PP
3b9e0e2
If the client is killed by a signal (for example at shutdown or reboot)
3b9e0e2
it won't execute the
3b9e0e2
.B dhclient-script (8)
3b9e0e2
at exit. However if you shut the client down gracefully with
3b9e0e2
.B -r
3b9e0e2
or
3b9e0e2
.B -x
3b9e0e2
it will execute
3b9e0e2
.B dhclient-script (8)
3b9e0e2
at shutdown with the specific reason for calling the script set.
3b9e0e2
3b9e0e2
.PP
3b9e0e2
.SH CONFIGURATION
3b9e0e2
The syntax of the dhclient.conf(5) file is discussed separately.
3b9e0e2
.SH OMAPI
3b9e0e2
The DHCP client provides some ability to control it while it is
3b9e0e2
running, without stopping it.  This capability is provided using OMAPI,
3b9e0e2
an API for manipulating remote objects.  OMAPI clients connect to the
3b9e0e2
client using TCP/IP, authenticate, and can then examine the client's
3b9e0e2
current status and make changes to it. 
3b9e0e2
.PP
3b9e0e2
Rather than implementing the underlying OMAPI protocol directly, user
3b9e0e2
programs should use the dhcpctl API or OMAPI itself.   Dhcpctl is a
3b9e0e2
wrapper that handles some of the housekeeping chores that OMAPI does
3b9e0e2
not do automatically.   Dhcpctl and OMAPI are documented in \fBdhcpctl(3)\fR
3b9e0e2
and \fBomapi(3)\fR.   Most things you'd want to do with the client can
3b9e0e2
be done directly using the \fBomshell(1)\fR command, rather than
3b9e0e2
having to write a special program.
3b9e0e2
.SH THE CONTROL OBJECT
3b9e0e2
The control object allows you to shut the client down, releasing all
3b9e0e2
leases that it holds and deleting any DNS records it may have added.
3b9e0e2
It also allows you to pause the client - this unconfigures any
3b9e0e2
interfaces the client is using.   You can then restart it, which
3b9e0e2
causes it to reconfigure those interfaces.   You would normally pause
3b9e0e2
the client prior to going into hibernation or sleep on a laptop
3b9e0e2
computer.   You would then resume it after the power comes back.
3b9e0e2
This allows PC cards to be shut down while the computer is hibernating
3b9e0e2
or sleeping, and then reinitialized to their previous state once the
3b9e0e2
computer comes out of hibernation or sleep.
3b9e0e2
.PP
3b9e0e2
The control object has one attribute - the state attribute.   To shut
3b9e0e2
the client down, set its state attribute to 2.   It will automatically
3b9e0e2
do a DHCPRELEASE.   To pause it, set its state attribute to 3.   To
3b9e0e2
resume it, set its state attribute to 4.
3b9e0e2
.PP
3b9e0e2
.SH FILES
3b9e0e2
.B CLIENTBINDIR/dhclient-script,
3b9e0e2
.B ETCDIR/dhclient.conf, DBDIR/dhclient.leases, RUNDIR/dhclient.pid,
3b9e0e2
.B DBDIR/dhclient.leases~.
3b9e0e2
.SH SEE ALSO
3b9e0e2
dhcpd(8), dhcrelay(8), dhclient-script(8), dhclient.conf(5),
3b9e0e2
dhclient.leases(5), dhcp-eval(5).
3b9e0e2
.SH AUTHOR
3b9e0e2
.B dhclient(8)
3b9e0e2
has been written for Internet Systems Consortium
3b9e0e2
by Ted Lemon in cooperation with Vixie
3b9e0e2
Enterprises.  To learn more about Internet Systems Consortium,
3b9e0e2
see
3b9e0e2
.B http://www.isc.org
3b9e0e2
To learn more about Vixie
3b9e0e2
Enterprises, see
3b9e0e2
.B http://www.vix.com.
3b9e0e2
.PP
3b9e0e2
This client was substantially modified and enhanced by Elliot Poger
3b9e0e2
for use on Linux while he was working on the MosquitoNet project at
3b9e0e2
Stanford.
3b9e0e2
.PP
3b9e0e2
The current version owes much to Elliot's Linux enhancements, but
3b9e0e2
was substantially reorganized and partially rewritten by Ted Lemon
3b9e0e2
so as to use the same networking framework that the Internet Systems
3b9e0e2
Consortium DHCP server uses.   Much system-specific configuration code
3b9e0e2
was moved into a shell script so that as support for more operating
3b9e0e2
systems is added, it will not be necessary to port and maintain
3b9e0e2
system-specific configuration code to these operating systems - instead,
3b9e0e2
the shell script can invoke the native tools to accomplish the same
3b9e0e2
purpose.
3b9e0e2
.PP