dhcpcd参数详解与总结

dhcpcd是一个实现DHCP和BOOTP客户端的程序,用于获取网络接口的IP地址、路由等信息并配置网络。它可以管理多个接口,并通过运行脚本进行DNS配置、主机名设置。dhcpcd提供了丰富的命令行选项,允许用户进行如请求特定选项、设置主机名、限制接口行为等精细化操作。此外,它还支持IPv4LL、接口管理和DHCP事件的钩子脚本。
摘要由CSDN通过智能技术生成

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, --

  • 1
    点赞
  • 19
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值