man dhcpcd-bin (Administration système) - DHCP client daemon

NAME

dhcpcd - DHCP client daemon

SYNOPSIS

dhcpcd %[-dknoprBCDHNRSTY] %[-t <timeout>] %[-c <ExecFilePath>] %[-h <hostname>] %[-i <vendorClassID>] %[-I <clientID>] %[-l <leasetime>] %[-s [ipaddr]] %[-F none|ptr|both] %[-G [gateway]] %[-w <windowsize>] %[-L <ConfigDir>] %[-e <etcDir>] %[-m <routeMetric>] %[interface]

DESCRIPTION

dhcpcd is an implementation of the DHCP client specified in RFC2131 (when -r option is not specified) and RFC1541 (when -r option is specified). Support for draft-ietf-dhc-fqdn-option in use in many systems (particularly networks using Microsoft DHCP servers) is also provided.

It gets the host information (IP address, netmask, broadcast address, etc.) from a DHCP server and configures the network interface of the machine on which it is running. It also tries to renew the lease time according to RFC2131 or RFC1541 (obsolete).

OPTIONS

-d
With this flag dhcpcd will syslog(LOG_DEBUG,...) messages for about every step it does. It's recommended to use this option since it doesn't really produce too much output but will greatly help in resolving a problems if any. dhcpcd uses LOCAL0 syslog facility for its output. To catch dhcpcd debugging output add the following line to /etc/syslog.conf file:

local0.* /var/log/dhcpcd.log

and then refresh syslogd daemon:

kill -1 `cat /var/run/syslogd.pid`

-k
Sends SIGHUP signal to the dhcpcd process associated with the specified interface if one is currently running. If dhcpcd receives SIGHUP it will send DCHP_RELEASE message to the server and destroy dhcpcd cache. In a case dhcpcd receives SIGTERM which is normally used by shutdown(8) when rebooting the system dhcpcd will not send DHCP_RELEASE and will not destroy cache. When system boots dhcpcd will use cache to request the same IP address from DHCP server which was assigned before the system went down. (see also -p )
-m <routeMetric>
routes will be added with the given metric. The default is 0.
-n
Sends SIGALRM signal to the dhcpcd process that is currently running which forces dhcpcd to try to renew the lease. If dhcpcd is not running, the flag is ignored and dhcpcd follows the normal startup procedure.
-o
Stops dhcpcd from bringing the interface down when it is terminated with the SIGTERM signal. This is useful when the interace is controlled by another daemon such as ifplugd or wpa_supplicant and the daemon requires the interface to remain up.
-p
Stops dhcpcd from bringing the interface down when it is terminated with the SIGTERM signal. This is useful when a host is running with an NFS-mounted root filesystem over an interface controlled by DHCP. It should not be used except in those circumstances, since if dhcp is stopped it can no longer down an interface at the end of its lease period when the lease is not renewed. Unlike the -o option, the address remains on the interface.
-r
Makes dhcpcd RFC1541 (obsolete) compliant. dhcpcd is RFC2131 compliant unless this option is specified.
-B
Requests broadcast response from DHCP server.
-C
Forces dhcpcd to calculate checksum on received packets.
-D
Forces dhcpcd to set domainname of the host to the domainname option supplied by DHCP server.
-F none|ptr|both
Forces dhcpcd to request the DHCP server update the DNS using the FQDN option instead of the Hostname option. The name used by this option is specified with the -h switch, which must be present. If the -h switch is not present, the FQDN option is ignored. The name should be fully qualified, although servers usually accept a simple name. both requests that the DHCP server update both the A and PTR records in the DNS. ptr requests that the DHCP server updates only the PTR record in the DNS. none requests that the DHCP server perform no updates. dhcpcd does not perform any DNS update, even when the server is requested to perform no updates. This can be easily implemented outside the client; all the necessary information is recorded in the <ConfigDir>/dhcpcd-<interface>.info file.
-H
Forces dhcpcd to set hostname of the host to the hostname option supplied by DHCP server. By default dhcpcd will NOT set hostname of the host to the hostname option received from DHCP server.
-L <ConfigDir>
dhcpcd will use <ConfigDir> directory instead of default /var/lib/dhcpc to store configuration information.
-S
Forces dhcpcd to send second DHCP_DISCOVER message even after receiving DHCP_OFFER on the first one. Some DHCP servers expect the client to send second DHCP_DISCOVER message before replying on DHCP_REQUEST.
-R
Prevents dhcpcd from replacing existing <etcDir>/resolv.conf file.
-Y
Prevents dhcpcd from replacing existing <etcDir>/yp.conf file. Domainname is not updated unless -D is specified.
-N
Prevents dhcpcd from replacing existing <etcDir>/ntp.conf file.
-T
Test case, when dhcpcd goes through the DHCP negotiation sequence but doesn't actually configure the interface. It does however write the <ConfigDir>/dhcpcd-<interface>.info and <ConfigDir>/dhcpcd-<interface>.cache files and it does attempt to execute the script defined by the -c <ExecFilePath> option. -T option is used primarily for testing DHCP servers, for obtaining multiple IP addresses for the same dummy interface, and/or configuring virtual interfaces in conjunction with -L <ConfigDir> and -I <ClientID> options.
-t <timeout>
Specifies (in seconds ) for how long dhcpcd will try to get an IP address. The default is 60 seconds. dhcpcd will not fork into background until it gets a valid IP address in which case dhcpcd will return 0 to the parent process. In a case dhcpcd times out before receiving a valid IP address from DHCP server dhcpcd will return exit code 1 to the parent process. Setting the timeout to zero disables it: dhcp will keep trying forever to get a lease, and if the lease is lost, it will try forever to get another.
-c <ExecFilePath>
dhcpcd will try to execute <ExecFilePath> script instead of default /etc/dhcpc/dhcpcd.exe script every time it configures or brings down the interface. See the description of dhcpcd.exe script in FILES section below.
-h <hostname>
specifies a string used for the hostname option field when dhcpcd sends DHCP messages. Some DHCP servers, notably those used by @Home Networks, require the hostname option field containing a specific string in the DHCP messages from clients. When combined with the -F switch, specifies the string used for the FQDN option field instead of the hostname option field.
-i <vendorClassID>
Specifies the vendor class identifier string. dhcpcd uses the default vendor class identifier string (system name, system release, and machine type) if it is not specified.
-I <ClientID>
Specifies the client identifier string. dhcpcd uses the default client identifier (MAC address of the network interface) if it is not specified.
-l <leasetime>
Specifies (in seconds) the recommended lease time to the server. (Note that the server can override this value if it sees fit). This value is used in the DHCP_DISCOVER message. The default is infinite (0xffffffff).
-s [ipaddr]
Sends DHCP_INFORM message to DHCP server using ipaddr. The optional ipaddr parameter must be in the form xxx.xxx.xxx.xxx. If no ipaddr parameter is given on the command line dhcpcd will use the IP address currently assigned to the interface. If there is no IP address currently assigned to the interface dhcpcd will use previously obtained IP address stored in <ConfigDir>/dhcpcd-<interface>.cache file.
-G [gateway]
Prevents dhcpcd from installing default routes provided by DHCP server. If optional gateway ip address parameter is supplied then use it for default route.
-w <windowsize>
Specifies the window size for the gateway route. Default = 32768.
-e <etcDir>
Specifies where dhcpcd should create resolv.conf, ntp.conf and yp.conf. Default is the /etc directory.
interface
Specifies the network interface name (eth0, eth1, etc.).
dhcpcd
uses the network interface eth0 unless an explicit name is specified.

FILES

/var/lib/dhcpc
Default <ConfigDir> directory used for storing files created by dhcpcd. See option -L <ConfigDir> above.
<ConfigDir>/dhcpcd-<interface>.info
file in which dhcpcd saves the host information. The word <interface> is actually replaced with the network interface name like eth0 to which dhcpcd is attached.
/etc/dhcpc/dhcpcd.exe
script file, which dhcpcd will try to execute whenever it configures or brings down the interface. The path to this executable script can be changed with -c <ExecFilePath> option. Dhcpcd passes 3 parameters to dhcpcd.exe script:
dhcpcd.exe <HostInfoFilePath> <up|down|new> [-d]
The first parameter <HostInfoFilePath> is path to dhcpcd-<interface>.info file. The word <interface> is actually replaced with interface name dhcpcd is attached to, e.g. "eth0". The second parameter values <up|down|new> mean the interface has been brought up with the same IP address as before ("up"), or with the new IP address ("new"), or the interface has been brought down ("down"). Parameter -d is passed in a case dhcpcd has been started with -d debug flag.
<ConfigDir>/dhcpcd-<interface>.cache
Cache file containing the previously assigned IP address and some other things. The word <interface> is actually replaced with the network interface name like eth0 to which dhcpcd is attached.
<etcDir>/resolv.conf
file created by dhcpcd when the client receives DNS and domain name options. The old <etcDir>/resolv.conf file is renamed to <etcDir>/resolv.conf.sv and will be restored back when dhcpcd exits for any reason.
<etcDir>/yp.conf
file created by dhcpcd when the client receives NIS options. The old <etcDir>/yp.conf file is renamed to <etcDir>/yp.conf.sv and is restored back when dhcpcd exits for any reason.
<etcDir>/ntp.conf
file created by dhcpcd when the client receives NTP options. The old <etcDir>/ntp.conf file is renamed to <etcDir>/ntp.conf.sv and is restored back when dhcpcd exits for any reason.
/var/run/dhcpcd-<interface>.pid
file containing the process id of dhcpcd. The word <interface> is actually replaced with the network interface name like eth0 to which dhcpcd is attached.

SEE ALSO

dig(1), nslookup(8), nsupdate(8)

Dynamic Host Configuration Protocol, RFC2131 and RFC1541 (obsolete)

DHCP Options and BOOTP Vendor Extensions, RFC2132

Draft DHC FQDN Option specification, draft-ietf-dhc-fqdn-option

BUGS

dhcpcd uses time(3) to calculate the lease expiration time. If the system time is changed while the client is running, the lease expiration time may not be predictable.

AUTHORS

v.<1.3

Yoichi Hariguchi <yoichi@fore.com>

v.1.3

Sergei Viznyuk <sv@phystech.com>

v.>1.3

Roy Marples <uberlord@gentoo.org>

Simon Kelley <simon@thekelleys.org.uk>