DHCPXD(8) DHCP Client DHCPXD(8)NAME
DHCPXD - Client for the DHCP protocol defined in RFC2131, RFC2132
SYNOPSISdhcpxd -k|--kill [interface] | -l|--renew [interface] | [-abcdehinprt‐
wABCDHIOR] interface
DESCRIPTIONdhcpxd is a client for the DHCP protocol.
OPTIONS
-a --replybroadcasted
Always request broadcasted replies.
This option is necessary if the low-level network layer dictates
that the IPless hosts must receive packets via broadcast. Usu‐
ally necessary under WAN or ATM networks.
-b --requestbroadcasted
Always broadcast requests.
Necessary if the situation is as in -a, or if the use of the ARP
protocol is being avoided. Commonly use would be on a transient
network where the retransmittion of IPless packets is disal‐
lowed.
-c --checkip
Checks if IP address already in use.
Every time the session initializes, it will perform this check.
If it finds that the IP is in use, it will send a DHCPDECLINE
message to the server and proceed to obtain a different IP.
-d --ignoreipcache
Discover any IP address.
This simply ignores the cached IP address for the initial
requesting sequence.
-e --scriptext extension
Use the specified extension for script execution.
Useful if people wish to write their own shell scripts (DESCIBED
BELOW) for configuring interfaces. Default is "def".
-h --help
Displays the help screen.
-i --inform
Initiate inform session.
Sets up a non-requesting session that merely queries the server
for information concerning the network. Useful for in situations
involving statically configured IPs.
--kill [interface]
If an interface is specified, the process running that interface
will be killed; otherwise, the default multi-session process is
killed. A SIGTERM is sent to the process which will return when
it has finished freeing all the addresses and closing the inter‐
faces.
-n --replyunicasted
Never request broadcasted replies.
Suggested technique for cable modems. However, this mode of
operation is preferrable anyways and HIGHLY recommended.
The DHCP protocol has a strict set of rules dictating when a
client SHOULD or SHOULD NOT request broadcasted replies. This
option tells the client to ignore this specification and expect
to have the replies always uni-casted. Using this mode of oper‐
taion is desireable since it provides a means of having a
tighter protocol.
-p --setscriptvar VAR=VALUE
Supply the specified parameter(s) to scripts.
When each shell script is executed, dhcpxd writes the parameters
to the .pars file for the device being processed. This is use‐
ful if one wishes to override certain defaults. Typical format
-
-p "VARIABLE=VALUE"
-r --leasetime number
Supply the specified renew time (hours) in requests.
This option is almost always overridden by the server. Default
is 24.
-t --test
Test DHCP mechanisms on specific interface.
Useful for determining the operating mode of the DHCP server.
-w --wait
Wait for the session to succeed or timeout.
Tells dhcpxd to put off returning the thread of execution to the
parent until it either obtains an IP or critically timesout.
-A --appendclientid xx:xx:xx:xx:xx...
Append the specified client identifier to default client identi‐
fier (MAC address of base adapter).
Useful for obtaining multiple IPs. Detailed discussion below...
Append identifer/Client identifiers are given as so:
xx:xx:xx:xx:xx:xx
12:56:89:AB:CD:EF is a valid append/client ID
01 is a valid append identifier
02:03 is a valid append identifer
-B --baseinterface real_interface
Use the specified base interface for requests.
Used if the session is configuring an alias interface. (ie
'eth0:1') Default is the specified target interface.
Use ful for obtaining multiple IPs. Detailed discussion below...
-C --clientid xx:xx:xx:xx:xx...
Use the specified client identifier.
Useful if one wishes to do lease masquerading. Default is the
hardware MAC address.
-D --deleteipcache
Delete the cached IP before starting session.
-H --hostname hostname
Supply the specified host name in requests.
-I --classid string
Supply the specified class identifier in requests.
-O --dhcpoption op_number string
Supply the specified option in requests.
Usage: -O 89 "Jerry Walker"
-R --norelease
Do not release the IP address, and if desired renew lease just
before termination.
This is useful for keeping the same IP address. If this option
is specified more than once, the client will renew the address
before shutting down.
-W --nocollectoffers
Do not wait when collecting DHCPOFFER responses. Useful for mak‐
ing the protocol "speedy".
FILES
/etc/dhcpxd/dhcpxd.conf
Contains run configuration for dhcpxd Each line represents a
command-line which is read in and processed on a per-session
basis. Braces ("{" and "}") can be used to group sessions that
have a common attribute--such as the -w. A comma can be placed
after the interface followed by a number to allow the automatic
configuration on that interface. (eg eth0,1)
/etc/dhcpxd/ifcfg.def
Shell script that executes various actions on the interface.
It is executed with the syntax:
/etc/dhcpxd/ifcfg.def action interface [base_interface
main_path]
action can be init , open , update , or close
/etc/dhcpxd/cfg.def
Script that is run by ALL default scripts. Contains settings
that dictate what and/or how interfaces get configured.
ADDHOST indicates which interfaces' IPs get put into the
/etc/hosts file.
ADDNETWORK indicates which interfaces' networks get added to the
routing table.
ADDGATEWAY indicates which interfaces' gateways get added to the
routing table.
ADDNAMESERVER indicates which interfaces' nameservers are added
to the /etc/resolv.conf.
CFGHOSTNAME indicates which interface is used to configure the
machines hostname.
CFGSEARCH indicates which interface is used to configure the
'search' field in the /etc/resolv.conf.
CFGDOMAINNAME indicates which interface is used to configure the
domain.
CFGDNSDOMAINNAME Indicates which interface is used to configure
the dnsdomainname. This tells the scripts to put the entry in
/etc/hosts at the beginning rather than at the end.
/etc/dhcpxd/INTERFACE.ifcfg
/etc/dhcpxd/INTERFACE.ifcfg.*
/etc/dhcpxd/ifcfg.def.*
Mini-scripts that, if they exist, are executed before and after
every action that the ifcfg.def script is run with. These
scripts are invoked with the following syntax:
source SCRIPT_FILE [pre | post] $*
/etc/dhcpxd/INTERFACE.pars
Where the user supplied parameters go so that scripts can get to
them.
/etc/dhcpxd/INTERFACE.cache
Where the previously leased IP address is stored.
/var/dhcpxd/dhcpxd.pid
File containing the PID for the active dhcpxd.
MULTIPLE SESSIONS PER INTERFACE
In order to use this feature, alias support must be compiled into the
kernel look in /usr/src/linux/Documentation for information on how to
do this. Secondly, no DHCP sessions must be running on the desired base
interface; however, if wished there can be a statically configured net‐
work on that interface. Each session initialized on the interface must
go something like this:
-nwABH 01 eth0 Experimental1 eth0:1
-nwABH 02 eth0 Experimental2 eth0:2
-nw eth0,2
This tells the client to append XX on to the client ID, use the eth0
interface for traffic, and the ExperimentalX for the hostname.
SESSION MASQUERADING
To manage sessions for someone else, you just simply do something like
this:
-benBCR masq eth0 xx:xx:xx:xx:xx:xx:xx... masq0
Where the masq is the extension for the do-nothing scripts, and where
x's the client ID. Client IDs are typically the hardware type (1 in
most cases) appended with the hardware MAC address.
01:00:12:34:45:AB:CD:EF would be typical
CONFORMING TO
The protocol described in RFC2131 and based on RFC2132.
COMMENTS
Why another DHCP client?
All other DHCP clients are basically toys - dinky little hacked out
utilities. I put a lot of effort into this one, and it can be custom‐
ized with ease. For future considerations, unlike the other DHCP
clients, the use of the ioctl() C function for managing the interface
is not used with the exception of getting the MAC address. This way,
the client can be easily ported and changed.
Why use this client?
1 This client gives the user an abundant set of options.
2 This client services more than one session with one process.
3 Output or log the activity of the managed sessions.
4 Because it runs as a single process, more than one packet socket
is never opened by dhcpxd. Kernel people frown on programs which
open more than one packet socket; doing such things is consid‐
ered evil.
5 The use of multiple gateways and/or nameservers are supported.
6 Retry mechanisms are built into the client allowing for protocol
failure or packet loss.
7 The use of ARP and GATEWAYING are built into the client, so the
code need not change if the kernel code changes.
BUGS
The UNARP protocol is used. Some servers may not support the UNARP pro‐
tocol. However, this shouldn't be a problem.
Each input parameter is limited to 128 characters.
The total length of the parameters to the -p options cannot exceed 128
characters.
SEE ALSO
RFC2131 - Dynamic Host Configuration Protocol (DRAFT STANDARD)
RFC2132 - BOOTP Options
AUTHOR
Garth Pickell (ArchDragon@SoftHome.net)
Garth Pickell May 5, 1999 DHCPXD(8)