⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dhclient.8

📁 DHCP服务器源码
💻 8
字号:
.\"	dhclient.8.\".\" Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC").\" Copyright (c) 1996-2003 by Internet Software Consortium.\".\" Permission to use, copy, modify, and distribute this software for any.\" purpose with or without fee is hereby granted, provided that the above.\" copyright notice and this permission notice appear in all copies..\".\" THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF.\" MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT.\" OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE..\".\"   Internet Systems Consortium, Inc..\"   950 Charter Street.\"   Redwood City, CA 94063.\"   <info@isc.org>.\"   http://www.isc.org/.\".\" $Id: dhclient.8,v 1.12.2.8 2004/06/10 17:59:12 dhankins Exp $.\".TH dhclient 8.SH NAMEdhclient - Dynamic Host Configuration Protocol Client.SH SYNOPSIS.B dhclient[.B -p.I port][.B -d][.B -q][.B -1][.B -r][.B -lf.I lease-file][.B -pf.I pid-file][.B -cf.I config-file][.B -sf.I script-file][.B -sserver][.B -grelay][.B -n][.B -nw][.B -w][.I if0[.I ...ifN]].SH DESCRIPTIONThe Internet Systems Consortium DHCP Client, dhclient, provides ameans for configuring one or more network interfaces using the DynamicHost Configuration Protocol, BOOTP protocol, or if these protocolsfail, by statically assigning an address..SH OPERATION.PPThe DHCP protocol allows a host to contact a central server whichmaintains a list of IP addresses which may be assigned on one or moresubnets.   A DHCP client may request an address from this pool, andthen use it on a temporary basis for communication on network.   TheDHCP protocol also provides a mechanism whereby a client can learnimportant details about the network to which it is attached, such asthe location of a default router, the location of a name server, andso on..PPOn startup, dhclient reads the.IR dhclient.conffor configuration instructions.   It then gets a list of all thenetwork interfaces that are configured in the current system.   Foreach interface, it attempts to configure the interface using the DHCPprotocol..PPIn order to keep track of leases across system reboots and serverrestarts, dhclient keeps a list of leases it has been assigned in thedhclient.leases(5) file.   On startup, after reading the dhclient.conffile, dhclient reads the dhclient.leases file to refresh its memoryabout what leases it has been assigned..PPWhen a new lease is acquired, it is appended to the end of thedhclient.leases file.   In order to prevent the file from becomingarbitrarily large, from time to time dhclient creates a newdhclient.leases file from its in-core lease database.  The old versionof the dhclient.leases file is retained under the name.IR dhclient.leases~until the next time dhclient rewrites the database..PPOld leases are kept around in case the DHCP server is unavailable whendhclient is first invoked (generally during the initial system bootprocess).   In that event, old leases from the dhclient.leases filewhich have not yet expired are tested, and if they are determined tobe valid, they are used until either they expire or the DHCP serverbecomes available..PPA mobile host which may sometimes need to access a network on which noDHCP server exists may be preloaded with a lease for a fixedaddress on that network.   When all attempts to contact a DHCP serverhave failed, dhclient will try to validate the static lease, and if itsucceeds, will use that lease until it is restarted..PPA mobile host may also travel to some networks on which DHCP is notavailable but BOOTP is.   In that case, it may be advantageous toarrange with the network administrator for an entry on the BOOTPdatabase, so that the host can boot quickly on that network ratherthan cycling through the list of old leases..SH COMMAND LINE.PPThe names of the network interfaces that dhclient should attempt toconfigure may be specified on the command line.  If no interface namesare specified on the command line dhclient will normally identify allnetwork interfaces, eliminating non-broadcast interfaces ifpossible, and attempt to configure each interface..PPIt is also possible to specify interfaces by name in the.B dhclient.conf(5)file.   If interfaces are specified in this way, then the client willonly configure interfaces that are either specified in theconfiguration file or on the command line, and will ignore all otherinterfaces..PPIf the DHCP client should listen and transmit on a port other than thestandard (port 68), the.B -pflag may used.  It should be followed by the udp port number thatdhclient should use.  This is mostly useful for debugging purposes.If a different port is specified for the client to listen on andtransmit on, the client will also use a different destination port -one greater than the specified destination port..PPThe DHCP client normally transmits any protocol messages it sendsbefore acquiring an IP address to, 255.255.255.255, the IP limitedbroadcast address.   For debugging purposes, it may be useful to havethe server transmit these messages to some other address.   This canbe specified with the .B -sflag, followed by the IP address or domain name of the destination..PPFor testing purposes, the giaddr field of all packets that the clientsends can be set using the.B -gflag, followed by the IP address to send.   This is only useful for testing,and should not be expected to work in any consistent or useful way..PPThe DHCP client will normally run in the foreground until it hasconfigured an interface, and then will revert to running in thebackground.   To run force dhclient to always run as a foregroundprocess, the.B -dflag should be specified.  This is useful when running the clientunder a debugger, or when running it out of inittab on System Vsystems..PPThe client normally prints a startup message and displays theprotocol sequence to the standard error descriptor until it hasacquired an address, and then only logs messages using the.B syslog (3)facility.   The.B -qflag prevents any messages other than errors from being printed to thestandard error descriptor..PPThe client normally doesn't release the current lease as it is notrequired by the DHCP protocol.  Some cable ISPs require their clientsto notify the server if they wish to release an assigned IP address.The.B -rflag explicitly releases the current lease, and once the lease has beenreleased, the client exits..PPThe.B -1flag cause dhclient to try once to get a lease.  If it fails, dhclient exitswith exit code two..PPThe DHCP client normally gets its configuration information from.B ETCDIR/dhclient.conf,its lease database from.B DBDIR/dhclient.leases,stores its process ID in a file called.B RUNDIR/dhclient.pid,and configures the network interface using.B CLIENTBINDIR/dhclient-scriptTo specify different names and/or locations for these files, use the.B -cf,.B -lf,.B -pfand.B -sfflags, respectively, followed by the name of the file.   This can beparticularly useful if, for example,.B DBDIRor.B RUNDIRhas not yet been mounted when the DHCP client is started..PPThe DHCP client normally exits if it isn't able to identify anynetwork interfaces to configure.   On laptop computers and othercomputers with hot-swappable I/O buses, it is possible that abroadcast interface may be added after system startup.   The.B -wflag can be used to cause the client not to exit when it doesn't findany such interfaces.   The.B omshell (8)program can then be used to notify the client when a network interfacehas been added or removed, so that the client can attempt to configure an IPaddress on that interface..PPThe DHCP client can be directed not to attempt to configure any interfacesusing the.B -nflag.   This is most likely to be useful in combination with the.B -wflag..PPThe client can also be instructed to become a daemon immediately, ratherthan waiting until it has acquired an IP address.   This can be done bysupplying the.B -nwflag..SH CONFIGURATIONThe syntax of the dhclient.conf(5) file is discussed separately..SH OMAPIThe DHCP client provides some ability to control it while it isrunning, without stopping it.  This capability is provided using OMAPI,an API for manipulating remote objects.  OMAPI clients connect to theclient using TCP/IP, authenticate, and can then examine the client'scurrent status and make changes to it. .PPRather than implementing the underlying OMAPI protocol directly, userprograms should use the dhcpctl API or OMAPI itself.   Dhcpctl is awrapper that handles some of the housekeeping chores that OMAPI doesnot do automatically.   Dhcpctl and OMAPI are documented in \fBdhcpctl(3)\fRand \fBomapi(3)\fR.   Most things you'd want to do with the client canbe done directly using the \fBomshell(1)\fR command, rather thanhaving to write a special program..SH THE CONTROL OBJECTThe control object allows you to shut the client down, releasing allleases that it holds and deleting any DNS records it may have added.It also allows you to pause the client - this unconfigures anyinterfaces the client is using.   You can then restart it, whichcauses it to reconfigure those interfaces.   You would normally pausethe client prior to going into hibernation or sleep on a laptopcomputer.   You would then resume it after the power comes back.This allows PC cards to be shut down while the computer is hibernatingor sleeping, and then reinitialized to their previous state once thecomputer comes out of hibernation or sleep..PPThe control object has one attribute - the state attribute.   To shutthe client down, set its state attribute to 2.   It will automaticallydo a DHCPRELEASE.   To pause it, set its state attribute to 3.   Toresume it, set its state attribute to 4..PP.SH FILES.B CLIENTBINDIR/dhclient-script,.B ETCDIR/dhclient.conf, DBDIR/dhclient.leases, RUNDIR/dhclient.pid,.B DBDIR/dhclient.leases~..SH SEE ALSOdhcpd(8), dhcrelay(8), dhclient-script (8), dhclient.conf(5),dhclient.leases(5)..SH AUTHOR.B dhclient(8)has been written for Internet Systems Consortiumby Ted Lemon in cooperation with VixieEnterprises.  To learn more about Internet Systems Consortium,see.B http://www.isc.orgTo learn more about VixieEnterprises, see.B http://www.vix.com..PPThis client was substantially modified and enhanced by Elliot Pogerfor use on Linux while he was working on the MosquitoNet project atStanford..PPThe current version owes much to Elliot's Linux enhancements, butwas substantially reorganized and partially rewritten by Ted Lemonso as to use the same networking framework that the Internet SystemsConsortium DHCP server uses.   Much system-specific configuration codewas moved into a shell script so that as support for more operatingsystems is added, it will not be necessary to port and maintainsystem-specific configuration code to these operating systems - instead,the shell script can invoke the native tools to accomplish the samepurpose..PP

⌨️ 快捷键说明

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