diff -up dhcp-4.0.0/client/dhclient-script.8.manpages dhcp-4.0.0/client/dhclient-script.8 --- dhcp-4.0.0/client/dhclient-script.8.manpages 2006-02-24 13:16:27.000000000 -1000 +++ dhcp-4.0.0/client/dhclient-script.8 2008-10-23 09:58:40.000000000 -1000 @@ -47,16 +47,16 @@ customizations are needed, they should b exit hooks provided (see HOOKS for details). These hooks will allow the user to override the default behaviour of the client in creating a .B /etc/resolv.conf -file. +file, and to handle DHCP options not handled by default. .PP No standard client script exists for some operating systems, even though the actual client may work, so a pioneering user may well need to create a new script or modify an existing one. In general, customizations specific to a particular computer should be done in the -.B ETCDIR/dhclient.conf +.B /usr/local/etc/dhclient.conf file. If you find that you can't make such a customization without customizing -.B ETCDIR/dhclient.conf +.B /usr/local/etc/dhclient.conf or using the enter and exit hooks, please submit a bug report. .SH HOOKS When it starts, the client script first defines a shell function, @@ -68,33 +68,53 @@ the enter hook script. .PP On after defining the make_resolv_conf function, the client script checks for the presence of an executable -.B ETCDIR/dhclient-enter-hooks +.B /usr/local/etc/dhclient-enter-hooks script, and if present, it invokes the script inline, using the Bourne shell '.' command. The entire environment documented under OPERATION is available to this script, which may modify the environment if needed to change the behaviour of the script. If an error occurs during the execution of the script, it can set the exit_status variable to a nonzero value, and -.B CLIENTBINDIR/dhclient-script +.B /sbin/dhclient-script will exit with that error code immediately after the client script exits. .PP After all processing has completed, -.B CLIENTBINDIR/dhclient-script +.B /sbin/dhclient-script checks for the presence of an executable -.B ETCDIR/dhclient-exit-hooks +.B /usr/local/etc/dhclient-exit-hooks script, which if present is invoked using the '.' command. The exit status of dhclient-script will be passed to dhclient-exit-hooks in the exit_status shell variable, and will always be zero if the script succeeded at the task for which it was invoked. The rest of the environment as described previously for dhclient-enter-hooks is also present. The -.B ETCDIR/dhclient-exit-hooks +.B /usr/local/etc/dhclient-exit-hooks script can modify the valid of exit_status to change the exit status of dhclient-script. +.PP +Immediately after dhclient brings an interface UP with a new IP address, +subnet mask, and routes, in the REBOOT/BOUND states, it will check for the +existence of an executable +.B /usr/local/etc/dhclient-up-hooks +script, and source it if found. This script can handle DHCP options in +the environment that are not handled by default. A per-interface. +.B /usr/local/etc/dhclient-${IF}-up-hooks +script will override the generic script and be sourced when interface +$IF has been brought up. +.PP +Immediately before dhclient brings an interface DOWN, removing its IP +address, subnet mask, and routes, in the STOP/RELEASE states, it will +check for the existence of an executable +.B /usr/local/etc/dhclient-down-hooks +script, and source it if found. This script can handle DHCP options in +the environment that are not handled by default. A per-interface +.B /usr/local/etc/dhclient-${IF}-down-hooks +script will override the generic script and be sourced when interface +$IF is about to be brought down. .SH OPERATION When dhclient needs to invoke the client configuration script, it defines a set of variables in the environment, and then invokes -.B CLIENTBINDIR/dhclient-script. +.B /sbin/dhclient-script. In all cases, $reason is set to the name of the reason why the script has been invoked. The following reasons are currently defined: MEDIUM, PREINIT, BOUND, RENEW, REBIND, REBOOT, EXPIRE, FAIL, STOP, RELEASE, diff -up dhcp-4.0.0/client/dhclient.8.manpages dhcp-4.0.0/client/dhclient.8 --- dhcp-4.0.0/client/dhclient.8.manpages 2007-10-04 07:13:25.000000000 -1000 +++ dhcp-4.0.0/client/dhclient.8 2008-10-23 09:58:40.000000000 -1000 @@ -91,6 +91,33 @@ relay .B -w ] [ +.B -B +] +[ +.B -I +.I dhcp-client-identifier +] +[ +.B -H +.I host-name +] +[ +.B -F +.I fqdn.fqdn +] +[ +.B -V +.I vendor-class-identifier +] +[ +.B -R +.I request-option-list +] +[ +.B -T +.I timeout +] +[ .B -v ] [ @@ -118,16 +145,6 @@ important details about the network to w the location of a default router, the location of a name server, and so on. .PP -If given the -4 command line argument (default), dhclient will use the -DHCPv4 protocol to obtain an IPv4 address and configuration parameters. -.PP -If given the -6 command line argument, dhclient will use the DHCPv6 -protocol to obtain whatever IPv6 addresses are available along with -configuration parameters. Information-request is not yet supported. -.PP -If given the --version command line argument, dhclient will print its -version number and exit. -.PP On startup, dhclient reads the .IR dhclient.conf for configuration instructions. It then gets a list of all the @@ -181,67 +198,183 @@ file. If interfaces are specified in t only configure interfaces that are either specified in the configuration file or on the command line, and will ignore all other interfaces. -.PP -If the DHCP client should listen and transmit on a port other than the -standard (port 68), the -.B -p -flag may used. It should be followed by the udp port number that -dhclient should use. This is mostly useful for debugging purposes. -If a different port is specified for the client to listen on and -transmit on, the client will also use a different destination port - -one greater than the specified destination port. -.PP -The DHCP client normally transmits any protocol messages it sends -before acquiring an IP address to, 255.255.255.255, the IP limited -broadcast address. For debugging purposes, it may be useful to have -the server transmit these messages to some other address. This can -be specified with the -.B -s -flag, followed by the IP address or domain name of the destination. -.PP -For testing purposes, the giaddr field of all packets that the client -sends can be set using the -.B -g -flag, 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. -.PP -The DHCP client will normally run in the foreground until it has -configured an interface, and then will revert to running in the -background. To run force dhclient to always run as a foreground -process, the -.B -d -flag should be specified. This is useful when running the client -under a debugger, or when running it out of inittab on System V -systems. -.PP -The dhclient daemon creates its own environment when executing the -dhclient-script to do the grunt work of interface configuration. -To define extra environment variables and their values, use the -.B -e -flag, followed by the environment variable name and value assignment, -just as one would assign a variable in a shell. Eg: -.B -e -.I IF_METRIC=1 -.PP -The client normally prints no output during its startup sequence. It -can be made to emit verbose messages displaying the startup sequence events -until it has acquired an address by supplying the -.B -v -command line argument. In either case, the client logs messages using -the -.B syslog (3) -facility. A -.B -q -command line argument is provided for backwards compatibility, but since -dhclient is quiet by default, it has no effect. -.PP -The client normally doesn't release the current lease as it is not -required by the DHCP protocol. Some cable ISPs require their clients -to notify the server if they wish to release an assigned IP address. +.SH OPTIONS +.TP +.BI \-4 +Use the DHCPv4 protocol to obtain an IPv4 address and configuration +parameters. + +.TP +.BI \-6 +Use the DHCPv6 protocol to obtain whatever IPv6 addresses are available +along with configuration parameters. Information-request is not yet +supported. + +.TP +.BI \-p\ +The UDP port number the DHCP client should listen and transmit on. If +unspecified, +.B dhclient +uses the default port 68. This option is mostly useful for debugging +purposes. If a different port is specified for the client to listen and +transmit on, the client will also use a different destination port - one +greater than the specified destination port. + +.TP +.BI \-d +Force +.B dhclient +to run as a foreground process. This is useful when running the client +under a debugger, or when running it out of inittab on System V systems. + +.TP +.BI \-e\ VAR=value +Define additional environment variables for the environment where +dhclient-script executes. You may specify multiple +.B \-e +options on the command line. + +.TP +.BI \-q +Suppress all terminal and log output except error messages. + +.TP +.BI \-1 +Try one to get a lease. On failure, exit with code 2. + +.TP +.BI \-r +Tell +.B dhclient +to release the current lease it has from the server. This is not required +by the DHCP protocol, but some ISPs require their clients to notify the +server if they wish to release an assigned IP address. + +.TP +.BI \-lf\ +Path to the lease database file. If unspecified, the default +.B /private/var/db/dhclient/dhclient.leases +is used. + +.TP +.BI \-pf\ +Path to the process ID file. If unspecified, the default +.B /private/var/run/dhclient.pid +is used. + +.TP +.BI \-cf\ +Path to the client configuration file. If unspecified, the default +.B /usr/local/etc/dhclient.conf +is used. + +.TP +.BI \-sf\ +Path to the network configuration script invoked by +.B dhclient +when it gets a lease. If unspecified, the default +.B /sbin/dhclient-script +is used. + +.TP +.BI \-s\ +Specifiy the server IP address or fully qualified domain name to transmit +DHCP protocol messages to. Normally, +.B dhclient +transmits these messages to 255.255.255.255 (the IP limited broadcast +address). Overriding this is mostly useful for debugging purposes. + +.TP +.BI \-g\ +Only for debugging. Set the giaddr field of all packets the client +sends to the IP address specified. This should not be expected to work +in any consistent or useful way. + +.TP +.BI \-n +Do not configure any interfaces. Most useful combined with the +.B -w +option. + +.TP +.BI \-nw +Become a daemon process immediately (nowait) rather than waiting until an IP +address has been acquired. + +.TP +.BI \-w +Keep running even if no network interfaces are found. The +.B omshell +program can be used to notify the client when a network interface has been +added or removed so it can attempt to configure an IP address on that +interface. + +.TP +.BI \-B +Set the BOOTP broadcast flag in request packets so servers will always +broadcast replies. + +.TP +.BI \-I\ +Specify the dhcp-client-identifier option to send to the DHCP server. + +.TP +.BI \-H\ +Specify the host-name option to send to the DHCP server. The host-name +string only contains the client's hostname prefix, to which the server will +append the ddns-domainname or domain-name options, if any, to derive the +fully qualified domain name of the client. The +.B -H +option cannot be used with the +.B -F +option. + +.TP +.BI \-F\ +Specify the fqdn.fqdn option to send to the DHCP server. This option cannot +be used with the +.B -H +option. The fqdn.fqdn option must specify the complete domain name of the +client host, which the server may use for dynamic DNS updates. + +.TP +.BI \-V\ +Specify the vendor-class-identifier option to send to the DHCP server. + +.TP +.BI \-R\