324fcf
The /etc/dhcp/dhclient.d directory allows other packages and system
324fcf
administrators to create application-specific option handlers for dhclient.
324fcf
324fcf
When dhclient is run, any option listed in the dhcp-options(5) man page can
324fcf
be requested.  dhclient-script does not handle every option available
324fcf
because doing so would make the script unmaintainable as the components
324fcf
using those options might change over time.  The knowledge of how to handle
324fcf
those options should be under the responsibility of the package maintainer
324fcf
for that component (e.g., NTP options belong in a handler in the ntp
324fcf
package).
324fcf
324fcf
To make maintenance easier, application specific DHCP options can be handled
324fcf
by creating a bash script with two functions and placing it in /etc/dhcp/dhclient.d
324fcf
324fcf
The script must follow a specific form:
324fcf
324fcf
(1) The script must be named NAME.sh.  NAME can be anything, but it makes
324fcf
    sense to name it for the service it handles.  e.g., ntp.sh
324fcf
324fcf
(2) The script must provide a NAME_config() function to read the options and
324fcf
    do whatever it takes to put those options in place.
324fcf
324fcf
(3) The script must provide a NAME_restore() function to restore original
324fcf
    configuration state when dhclient stops.
324fcf
324fcf
(4) The script must be 'chmod +x' or dhclient-script will ignore it.
324fcf
324fcf
The scripts execute in the same environment as dhclient-script.  That means
324fcf
all of the functions and variables available to it are available to your
324fcf
NAME.sh script.  Things of note:
324fcf
324fcf
    ${SAVEDIR} is where original configuration files are saved.  Save your
324fcf
    original configuration files here before you take the DHCP provided
324fcf
    values and generate new files.
324fcf
324fcf
    Variables set in /etc/sysconfig/network, /etc/sysconfig/networking/network,
324fcf
    and /etc/sysconfig/network-scripts/ifcfg-$interface are available to
324fcf
    you.
324fcf
324fcf
See the scripts in /etc/dhcp/dhclient.d for examples.
324fcf
324fcf
NOTE:  Do not use functions defined in /usr/sbin/dhclient-script.  Consider
324fcf
dhclient-script a black box.  This script may change over time, so the
324fcf
dhclient.d scripts should not be using functions defined in it.
324fcf
324fcf
-- 
324fcf
David Cantrell <dcantrell@redhat.com>