Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ dhcpagent(1M) — SunOS 5.6

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

dhcpinfo(1)

ifconfig(1M)

init(1M)

syslog(3)

attributes(5)

dhcpagent(1M)

NAME

dhcpagent − daemon for client Dynamic Host Configuration Protocol (DHCP)

SYNOPSIS

dhcpagent [ −dn ] [ −f ] [ −ln ]

DESCRIPTION

dhcpagent implements the client half of the DHCP protocol for workstations with a local disk. 

The DHCP protocol, among other things, permits a client to establish an endpoint for communication with a network by delivering an IP address of one or more of the client’s network interfaces, and a "lease" on that address.  The lease specifies the interval that the address remains valid; it may be infinite or of fixed duration.  If it appears that the client wishes to continue using the IP address after its expiration, the DHCP protocol must negotiate an extension.  For this reason, the DHCP client code must run as a daemon, only terminating when the client powers down. 

Communication with the dhcpagent daemon is effected through the agency of ifconfig(1M) in much the same way that the init(1M) daemon is controlled by telinit(1M).  dhcpagent may be invoked as a user process (albeit one requiring root privileges), but this is not necessary, as ifconfig(1M) will start it implicitly. 

When started, dhcpagent enters a passive state while awaiting instructions to be passed to it by ifconfig(1M).  When a command is received to configure an interface, the DHCP protocol is started.  If successful, the interface is configured and brought up.  The configuration received is stored in a file named interface.dhc located under the directory /etc/dhcp.  The agent will then sleep until it needs to renew the lease, which will happen well before the lease expires.  Upon wakeup, if the interface is found to be down or to have a different IP address, dhcpagent considers that the interface is no longer under its control and will drop it from future consideration, until a further explicit request arrives from ifconfig(1M).  If the lease cannot be renewed, dhcpagent will take the interface down when it expires, as required by the DHCP protocol.  The user should consult Dynamic Host Configuration Protocol (RFC 2131) for details. 

The DHCP protocol also acts as a mechanism to configure other information needed by the client (for example, name domain, addresses of routers, and so forth).  The agent does not directly configure the workstation with this information but instead acts as a database which may be interrogated by other programs, and in particular by dhcpinfo(1).  This approach is more flexible; it may eventually allow third party software access to the data through a published API, and allows system administrators more control over client configuration by editing startup scripts to permit various aspects of the client and its software to be customized in a specific order. 

On clients with a single interface, this is quite straightforward.  Clients with multiple interfaces may present difficulties, as there exists the possibility that some information arriving on different interfaces may need to be merged, or indeed that it may be inconsistent.  Furthermore, the configuration of the interfaces is asynchronous, so requests may arrive while some or all of the interfaces are still unconfigured.  The agent resolves these problems by permitting one interface, referred to as the primary, to be designated as special in that, in the absence of any other information, it is the only interface to be regarded as authoritative for global parameters. If a request for the value of the parameter is received which is not contained in the repository for the primary interface, the request fails. dhcpinfo(1) allows this behavior to be overridden by insisting that the global data sought be associated with a particular interface.  (See dhcpinfo(1) for details.) 

Messages

dhcpagent writes informational and error messages in four categories: errors, warnings, log, and debug.  Errors are severe, usually unrecoverable, events due to resource exhaustion and other unexpected failure of system calls.  An error is also generated if the client’s lease on an IP address is in imminent danger of expiring.  Warnings are less severe, and in most cases describe unusual or incorrect datagrams received from servers, or requests for service that cannot be provided.  Informatory messages simply provide a human readable transcription of (correct) actions performed by the agent.  Debug messages, if dhcpagent was built to generate them, may be generated at various levels of verbosity from 0 (not at all) through 9, as controlled by the −d option.  They are chiefly of benefit to persons having access to source code. 

The disposition of messages is (by default) as follows: warning, log, and debug messages are discarded; errors are written to /dev/console and are sent to the system logger syslog(3) at priority LOG_ERR and with a facility identifier, LOG_DAEMON.  If warnings have been enabled, they also are written to the system console and syslog with the same facility, but at priority LOG_WARNING.  The creation and disposition of messages is controlled by the −d, −f, and −l command line flags (see OPTIONS) and the environment variable DHCPLOG.  When present, DHCPLOG should name a file to which messages are sent in preference to the system console.  Note that until the root file system is mounted read-write, no ordinary file can be used for this purpose. 

OPTIONS

−dn Set debug level to n. If debug is turned on, log messages are also enabled.

−f Run in the foreground instead of as a daemon process. 

−ln Enable warning (n > 0) and log (n > 1) messages.  If n is not explicitly given, the value 1 is assumed, that is, warnings are turned on. 

FILES

dhcpagent writes the configurations received into files in the directory /etc/dhcp. 

interface.dhc Contains the configuration for interface. The mere existence of this file does not imply that the configuration is correct, since the lease may have expired.

ATTRIBUTES

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE ATTRIBUTE VALUE
Availability SUNWcsr

SEE ALSO

dhcpinfo(1), ifconfig(1M), init(1M), syslog(3), attributes(5)

Droms, R., Dynamic Host Configuration Protocol, RFC 2131, Bucknell University, March 1997.

DIAGNOSTICS

Receipt of SIGUSR1 signals dhcpagent to dump to stdout the contents of its scheduling table and the status of each of the interfaces under its control. 

SunOS 5.6  —  Last change: 9 May 1997

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026