dhcpd.8

来自「minix操作系统最新版本(3.1.1)的源代码」· 8 代码 · 共 209 行

8
209
字号
.TH DHCPD 8.SH NAMEdhcpd \- dynamic host configuration protocol daemon.SH SYNOPSIS.in +.5i.ti -.5i.B dhdpd.RB [ \-qar ].RB [ \-t [\fIlevel\fP]].RB [ \-d [\fIlevel\fP]].RB [ \-f.IR configfile ].RB [ \-c.IR cachefile ].RB [ \-p.IR poolfile ].RI [ host " ...]".in -.5i.SH DESCRIPTION.de SP.if t .sp 0.4.if n .sp...B Dhcpdis a client and a server for the Dynamic Host Configuration Protocol.  As aclient it collects DHCP data to configure the Ethernet networks with, and asa server it answers DHCP queries from other machines..PPThis manual page describes the operation of.BR dhcpd ,the associated configuration file is described in.BR dhcp.conf (5).(The latter, together with.BR boot (8),is of more practical value when it comes to getting a machine's networksinterfaces up and running.  See the options section below for debugging DCHPproblems.).SS InitializationOn a normal startup, i.e. none of the.BR \-q ,.BR \-aor.BR \-roptions are given,.B dhcpddetermines what IP devices are present, and which of those are Ethernets.For each network it looks for information in the configuration file as ifit were a server answering a query for that network.  If any information isfound then the IP address is configured and the information stored in thecache file..SS "Client Operation"For each still unconfigured network a DHCP DISCOVER request is broadcast onthat network.  If a DHCP OFFER reply is received then a DHCP REQUEST isbroadcast for the IP address offered, and if a DHCP ACK is received then thenetwork is configured and the information stored in the cache file..PPIf no reply is received then another query is sent after 4 seconds, and thenagain after 8 seconds, doubling each time until 64 seconds.  Every 64seconds thereafter a request is broadcast until a reply is received..PPOnce configured the DHCP lease, rebind and renew times are computed.  At therenew time a DHCP REQUEST is sent to the DHCP server to extend the lease.Normally we get an answer and refresh our information, but if no reply isreceived we wait for half the remaining time until the rebind time and keepretrying and halving the remaining time.  When the rebind time is reachedthe DHCP REQUEST is broadcast to try and reach some other DHCP server.Halving the remaining time again and again until the lease expires.  At thatpoint we go back to square one and broadcast a DHCP DISCOVER..PPIf at any point a DHCP NAK is received we start over completely.  After aDHCP OFFER an ARP request is transmitted just before the DHCP REQUEST tocheck if the address offered is already in use.  If an ARP reply is receivedbefore the DHCP ACK then after the ACK we send a DHCP DECLINE to the serverto tell that the address isn't what we want and again we start over..SS "Router Discovery"The gateway offered by the DHCP server is made known to the TCP/IP server bysending an ICMP router advertisement to the local interface with a shortlifetime and a low priority.  Then up to three router solicitations arebroadcast three seconds apart to look for a router.  If a router answerswith a router advertisement then we no longer worry about routing for thatinterface.  Otherwise the router information is refreshed before it expiresand another solicitation is sent out.  This happens about twice an hour..SS "Server Operation"Once all networks so marked are configured the daemon starts answeringrequests by other machines or relaying requests to other DHCP servers.DHCP requests are answered if information for a clientcan be found in the configuration file, or if a free address can be found inthe pool file, or if a client rerequests an address it already owns..PPIf the daemon is both a server and a relay for a network then it will tryto answer a request and only relay if it has no answer..SS "Nothing more to do?"If the daemon finds out that all networks have an infinite lease (configuredwith a fixed address), there is no router information to keep warm, andit isn't a server then it simply exits..SS "Asynchronous I/O?"MINIX 3 doesn't have the asynchronous I/O that Minix-vmd has, so under MINIX 3the daemon only works with one network at a time.  If it's stuck on the samenetwork for 32 seconds then that network is closed and another network istried for 32 seconds.  This usually works ok as a client, but as a server itcan only handle one network..SH OPTIONS.TP.B \-qRead and print the cache and pool file contents, showing DHCP informationfor each network, and the IP addresses in the pool with lease times andcurrent/last owners of those addresses..TP.B \-aAdd the named hosts (or IP addresses) to the pool file..TP.B \-rRemove hosts from the pool file..TP.RB [ \-t [\fIlevel\fP]]Set the test level (by default 1).  At test level 1 all networks are seen asunconfigured, will not be configured and no data will be put in the cache.The program will just act as-if.  At test level 2 the interfaces will not beconfigured from the configuration file, the data must come from a remoteserver.  At level 3 the renewal, rebind and lease time will be 60, 120and 180 seconds.  At level 4 these times will be 60, 60, and 120.  Atlevel 5 these times will be 60, 60, and 60.  These test levels are meantto debug the DHCP client code, and are best used with a high debug level..TP.RB [ \-d [\fIlevel\fP]]Set the debug level (by default 1).  At debug level 1 the program showsEthernet and IP addresses as they are determined or configured, DHCPmessages sent and received with little detail (one line per message), andmemory use.  At debug level 2 each DHCP packet is decoded and shown indetail.  At debug level 3 device opens and closes are shown.  The debugginglevel may also be increased by 1 at runtime by sending signal.BR SIGUSR1or turned off (set to 0) with.BR SIGUSR2 ..TP.BI \-f " configfile"Names the configuration file, by default.BR /etc/dhcp.conf ..TP.BI \-c " cachefile"Names the cache file, by default.BR /usr/adm/dhcp.cache ..TP.BI \-p " poolfile"Names the IP address pool, by default.BR /usr/adm/dhcp.pool ..SH "SEE ALSO".BR RFC-2131 ,.BR RFC-1533 ,.BR dhcp.conf (5),.BR hosts (5),.BR ifconfig (8),.BR inet (8),.BR boot (8),.BR inetd (8),.BR nonamed (8)..SH DIAGNOSTICS.TP"'/etc/dhcp.conf', line ..."The program exits on any configuration file error.  You have to correct theerror and restart the program..TP"No lease set for address ..."There must be a lease time defined for addresses in the pool.  Correct andrestart the program..TP"###### declines #.#.#.# saying '...'"A client with the given client identifier (usually 01 followed by the client'sEthernet address) declines an IP address, hopefully with a message tellingwhy.  This usually means that the IP address is already in use by anotherhost.  This program, acting as a client, will tell what other host in itsmessage, but Windows has no additional info alas..TP"Got a NAK from #.#.#.# [through #.#.#.#] saying '...'"The server with the given IP address doesn't want us to have or keep the IPaddress we were offered or are rerequesting.  This could mean that the serverhas forgotten about us and has given our address to another machine.  Thisis bad if our lease hasn't yet expired.  There may be a relay involved, andthere may even be a text message with precise information..TP"#.#.#.# offered by #.#.#.# is already in use by #:#:#:#:#:#"We got an ARP reply for an offered address.  We won't accept it, and sendout a DECLINE when we get an ACK..TP"DHCP packet too big, ..."You've got way to much information in the configuration file, more than fitsin a minimum size DHCP packet.  (Notify the author if you really need to sendmore information.  He doesn't think anyone needs to.).TP"Pool table is corrupt"You will have to remove and refill the pool file.  Chaos may ensue ifthere are active clients and they don't use ARP to detect each other.(Most do.).SH BUGSThere is no randomization of timers.  Modern systems don't blink under theload of several clients broadcasting a few packets in sync..PPThere is no extra time spent waiting for an ARP reply.  It is assumed thatany IP stack will immediately respond, so that the DHCP server can'tpossibly beat it at sending out an ACK.  (The DHCP server has to commit thelease to stable storage first anyway.).PPWay more nonsense can be sent in a DHCP packet that MINIX 3 could dosomething with, but nobody does so we don't bother..PPDHCP was invented by a rabid gerbil on speed..SH AUTHORKees J. Bot <kjb@cs.vu.nl>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?