SYNOPSIS
dhcpcd [-bdeknpqABDEGKLTV] [-c, --script script] [-f, --config file]
[-h, --hostname hostname] [-i, --vendorclassid vendorclassid]
[-l, --leasetime seconds] [-m, --metric metric]
[-o, --option option] [-r, --request address]
[-s, --inform address[/cidr]] [-t, --timeout seconds]
[-u, --userclass class] [-v, --vendor code, value]
[-y, --reboot seconds] [-z, --allowinterfaces pattern]
[-C, --nohook hook] [-F, --fqdn FQDN] [-I, --clientid clientid]
[-O, --nooption option] [-Q, --require option]
[-S, --static value] [-X, --blacklist address[/cidr]]
[-Z, --denyinterfaces pattern] [interface] [...]
dhcpcd -k, --release [interface]
dhcpcd -x, --exit [interface]
DESCRIPTION
dhcpcd is an implementation of the DHCP client specified in RFC 2131.
dhcpcd gets the host information (IP address, routes, etc) from a DHCP
server and configures the network interface of the machine on which it is
running. dhcpcd then runs the configuration script which writes DNS
information to resolvconf(8), if available, otherwise directly to
/etc/resolv.conf. If the hostname is currenly blank, (null) or localhost
then dhcpcd sets the hostname to the one supplied by the DHCP server.
dhcpcd then daemonises and waits for the lease renewal time to lapse.
Then it attempts to renew its lease and reconfigure if the new lease
changes.
dhcpcd is also an implementation of the BOOTP client specified in RFC
951.
Local Link configuration
If dhcpcd failed to obtain a lease, it probes for a valid IPv4LL address
(aka ZeroConf, aka APIPA). Once obtained it restarts the process of
looking for a DHCP server to get a proper address.
When using IPv4LL, dhcpcd nearly always succeeds and returns an exit code
of 0. In the rare case it fails, it normally means that there is a
reverse ARP proxy installed which always defeats IPv4LL probing. To dis-
able this behaviour, you can use the -L, --noipv4ll option.
Multiple interfaces
dhcpcd can be run per interface or as a single instance to manage all
interfaces. If a list of interfaces are given on the command line, then
dhcpcd only works with those interfaces, otherwise dhcpcd discovers
available interfaces. If link management is enabled and no interfaces
are given on the command line, dhcpcd forks to the background right away.
Interfaces are preferred by carrier, DHCP lease/IPv4LL and then lowest
metric. For systems that support route metrics, each route will be
tagged with the metric, otherwise dhcpcd changes the routes to use the
interface with the same route and the lowest metric. See options below
for controlling what interfaces we allow and deny through the use of pat-
terns. Also, see the BUGS section if dhcpcd runs on a BSD system.
Hooking into DHCP events
dhcpcd runs /libexec/dhcpcd-run-hooks, or the script specified by the -c,
--script option. This script runs each script found in
/libexec/dhcpcd-hooks in a lexical order. The default installation sup-
plies the scripts 01-test, 10-mtu, 20-resolv.conf and 30-hostname. You
can disable each script by using the -C, --
dhcpcd参数详解与总结
最新推荐文章于 2025-02-22 10:38:30 发布