INtime SDK Help
dhclient configuration


The dhclient.cfg file contains configuration information for dhclient, the Internet Software Consortium DHCP Client.

The dhclient.cfg file is a free-form ASCII text file. It is parsed by the recursive-descent parser built into dhclient(8). The file may contain extra tabs and newlines for formatting purposes. Keywords in the file are case-insensitive. Comments may be placed anywhere within the file (except within quotes). Comments begin with the `#' character and end at the end of the line.

The dhclient.cfg file can be used to configure the behaviour of the client in a wide variety of ways: protocol timing, information requested from the server, information required of the server, defaults to use if the server does not provide certain information, values with which to override information provided by the server, or values to prepend or append to information provided by the server. The configuration file can also be preinitialized with addresses to use on networks that do not have DHCP servers.

Protocol timing

The timing behaviour of the client need not be configured by the user. If no timing configuration is provided by the user, a fairly reasonable timing behaviour will be used by default - one which results in fairly timely updates without placing an inordinate load on the server.

The following statements can be used to adjust the timing behaviour of the DHCP client if required, however:

Lease requirements and requests

The DHCP protocol allows the client to request that the server send it specific information, and not send it other information that it is not prepared to accept. The protocol also allows the client to reject offers from servers if they do not contain information the client needs, or if the information provided is not satisfactory.

There is a variety of data contained in offers that DHCP servers send to DHCP clients. The data that can be specifically requested is what are called DHCP Options. DHCP Options are defined in dhcp-options(5).

Option modifiers

In some cases, a client may receive option data from the server which is not really appropriate for that client, or may not receive information that it needs, and for which a useful default value exists. It may also receive information which is useful, but which needs to be supplemented with local information. To handle these needs, several option modifiers are available.

Lease declarations

The lease declaration:

lease { lease-declaration [... lease-declaration] }

The DHCP client may decide after some period of time (see PROTOCOL TIMING) that it is not going to succeed in contacting a server. At that time, it consults its own database of old leases and tests each one that has not yet timed out by pinging the listed router for that lease to see if that lease could work. It is possible to define one or more fixed leases in the client configuration file for networks where there is no DHCP or BOOTP service, so that the client can still automatically configure its address. This is done with the lease statement.

NOTE: the lease statement is also used in the dhclient.leases file in order to record leases that have been received from DHCP servers. Some of the syntax for leases as described below is only needed in the dhclient.leases file. Such syntax is documented here for completeness.

A lease statement consists of the lease keyword, followed by a left curly brace, followed by one or more lease declaration statements, followed by a right curly brace. The following lease declarations are possible:

These declarations are automatically set in leases acquired by the DHCP client, but must also be configured in predefined leases - a predefined lease whose expiry time has passed will not be used by the DHCP client.

Dates are specified as follows:

_weekday_ _year_/_month_/_day__hour_:_minute_:_second_

The weekday is present to make it easy for a human to tell when a lease expires - it is specified as a number from zero to six, with zero being Sunday. When declaring a predefined lease, it can always be specified as zero. The year is specified with the century, so it should generally be four digits except for really long leases. The month is specified as a number starting with 1 for January. The day of the month is likewise specified starting with 1. The hour is a number between 0 and 23, the minute a number between 0 and 59, and the second also a number between 0

Alias declarations

alias { declarations ... }

Some DHCP clients running TCP/IP roaming protocols may require that in addition to the lease they may acquire via DHCP, their interface also be configured with a predefined IP alias so that they can have a permanent IP address even while roaming. The Internet Software Consortium DHCP client does not support roaming with fixed addresses directly, but in order to facilitate such experimentation, the DHCP client can be set up to configure an IP alias using the alias declaration.

The alias declaration resembles a lease declaration, except that options other than the subnet-mask option are ignored by the standard client configuration script, and expiry times are ignored. A typical alias declaration includes an interface declaration, a fixed-address declaration for the IP alias address, and a subnet-mask option declaration. A medium statement should never be included in an alias declaration.

Other declarations


The following configuration file is used on a laptop which has an IP alias of, and has one interface, ep0 (a 3Com 3C589C). Booting intervals have been shortened somewhat from the default, because the client is known to spend most of its time on networks with little DHCP activity. The laptop does roam to multiple networks.

       timeout 60;
           retry 60;
           reboot 10;
           select-timeout 5;
           initial-interval 2;

           interface "ep0" {
               send host-name "";
               send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
               send dhcp-lease-time 3600;
               supersede domain-name "";
               prepend domain-name-servers;
               request subnet-mask, broadcast-address, time-offset, routers,
                       domain-name, domain-name-servers, host-name;
               require subnet-mask, domain-name-servers;
               script "/etc/dhclient-script";
               media "media 10baseT/UTP", "media 10base2/BNC";

           alias {
             interface "ep0";
             option subnet-mask;

This is a very complicated dhclient.cfg file - in general, yours should be much simpler. In many cases, it is sufficient to just create an empty dhclient.cfg file - the default configuration is usually acceptable.


Versions Link to
INtime 4.0 clib.rsl
See Also