|DHCLIENT(8)||System Manager's Manual||DHCLIENT(8)|
dhclientutility is used.
dhclientis run on the command line with the name of the interface to be configured.
dhclientcan also be run at boot time from hostname.if(5), in which case netstart(8) reads the hostname files and runs
dhclientfor each interface that is to be configured via DHCP. The options are as follows:
dhclientwill run in the foreground and log to stderr.
dhclientwill ignore any values provided by leases for the options specified. This list will override any ignore statements in dhclient.conf(5). options must be a comma separated list of valid option names. Invalid option names will cause the entire list to be discarded.
dhclientto write two pseudo-leases, “offered” and “effective”, to the specified file. “offered” will be the lease offered by the DHCP server; “effective” will be the modified lease bound to the interface.
dhclientexits after removing the active lease from /var/db/dhclient.leases.⟨IFNAME⟩, deleting the address the lease caused to be added to the interface, truncating any option file specified by
-Land sending a DHCPRELEASE packet to the server that supplied the lease. If there is no
dhclientcontrolling the specified interface, or
dhclienthas no active lease configured, no action is performed.
dhclientto log more information.
-vis implied if either
dhclientreads /etc/dhclient.conf for configuration instructions. It then attempts to configure the network interface interface with DHCP. The special value “egress” may be used instead of a network interface name. In this case
dhclientwill look for the network interface currently in the interface group “egress” and configure it with DHCP. If there is more than one network interface in the egress group
dhclientwill exit with an error. When configuring the interface,
dhclientattempts to remove any existing addresses, gateway routes that use the interface, and non-permanent arp(8) entries.
dhclientautomatically exits whenever a new
dhclientis run on the same interface. Once the interface is configured,
dhclientconstructs a resolv.conf(5) file. It does this only when one or both of the options
domain-name-serversare present (note that these options may be offered by the DHCP server but suppressed by dhclient.conf(5)). If a resolv.conf is constructed,
dhclientappends any contents of the resolv.conf.tail(5) file, which are read once at start up. The constructed resolv.conf is copied into /etc/resolv.conf whenever the default route goes out the interface
dhclientis running on.
dhclientmonitors the system for changes to the default route and re-checks whether it should write its resolv.conf when possible changes are detected. In order to keep track of leases across system reboots and server restarts,
dhclientkeeps a list of leases it has been assigned in the /var/db/dhclient.leases.⟨IFNAME⟩ file. IFNAME represents the network interface of the DHCP client (e.g. em0), one for each interface. On startup, after reading the dhclient.conf(5) file,
dhclientreads the leases file to refresh its memory about what leases it has been assigned. Old leases are kept around in case the DHCP server is unavailable when
dhclientis first invoked (generally during the initial system boot process). In that event, old leases from the dhclient.leases.⟨IFNAME⟩ file which have not yet expired are tested, and if they are determined to be valid, they are used until either they expire or the DHCP server becomes available. A mobile host which may sometimes need to access a network on which no DHCP server exists may be preloaded with a lease for a fixed address on that network. When all attempts to contact a DHCP server have failed,
dhclientwill try to validate the static lease, and if it succeeds, it will use that lease until it is restarted. A mobile host may also travel to some networks on which DHCP is not available but BOOTP is. In that case, it may be advantageous to arrange with the network administrator for an entry on the BOOTP database, so that the host can boot quickly on that network rather than cycling through the list of old leases.
dhclientwill restart itself, reading dhclient.conf(5) and obtaining a new lease.
dhclientwas written by Ted Lemon <email@example.com> and Elliot Poger <firstname.lastname@example.org>. The current implementation was reworked by Henning Brauer <email@example.com>.
|May 19, 2018||OpenBSD-current|