This section describes techniques and tools you can use to
troubleshoot problems found with the DHCP server.
Troubleshooting Techniques |
 |
You can use one of four techniques for monitoring DHCP:
Syslog with debugging turned up
Trace DHCP packets flowing in and out
Dump the internal state of the daemon
Review the contents of /etc/dhcpdb
Using Syslog with Debugging Turned On
Syslog collects the most detailed information about operations.
You will get the most direct, real-time information when you use
syslog. However, this method is only good for monitoring short periods
of time because syslog grows quickly.
Open the /etc/inetd.conf file in an editor.
Insert the -d3 option in the bootp line in the /etc/inetd.conf file.
bootps dgram udp wait root /usr/lbin/bootpd bootpd -d3
|
Reconfigure inetd with inetd -c.
Type inetd -c on the command line.
Terminate bootpd. The next time bootp comes up, the new command
line option will be available.
Tail the syslog by typing the following command:
tail -f /var/adm/syslog/syslog.log | grep bootp
You should be looking for the following:
Is the client request reaching the
server at all?
Does the server make a reply to the client?
Is the reply appropriate for the client?
Table 6-1 “Common Errors Found in Syslog” lists some
of the common error messages you may see in the syslog when a client
fails to get an address lease.
Table 6-1 Common Errors Found in Syslog
Error | Cause |
---|
304 | A client requests an address on a subnet not
available or accessible from this DHCP server. The client gets no
response from this server. |
305 | The pool or device group is full. That is the
DHCP server has handed out all the addresses available. The client
gets no response from this server. |
308 | An illegal packet received. |
316 | The DHCP server knows nothing about the client
lease or forgot about the lease. In this case, the client will fall
back to request a brand new lease. |
Dumping the Internal State of the Daemon
Use the dhcptools to cause the daemon to dump. Type the following command:
/usr/sbin/dhcptools -d
This command dumps dynamic information into the file /tmp/dhcp.dump.other. Other information is dumped into the files /tmp/dhcp.dump.bootptab and /tmp/dhcp.dump.dhcptab.
Review the contents of /tmp/dhcpdb, which is a less verbose version of /tmp/dhcp.dump.dhcptab. The file /tmp/dhcpdb is continually updated by the daemon.
DHCP Troubleshooting Tools |
 |
The HP-UX DHCP server has tools that will help you debug problems and
make adjustments while the server is running.
When building the files /etc/bootptab and /etc/dhcptab, you need a tool that will automatically discover illegal
entries and typographical errors. The command-line tool
known as
dhcptools(1M) is available to provide access to DHCP-related
options for the bootpd server. The options provide control for dumping
internal data structures, generating a host file, previewing client
address assignment, reclaiming unused addresses, tracing packets,
and validating configuration files.
Refer to the dhcptools(1M) man page for detailed information about the various
options. The -v option should be used after you have completed configuration
to verify that no detectable errors exist in either the bootptab or dhcptab configuration files.
If communication problems exist between the server and client
at a protocol level, and you have verified that no errors exist
in the configuration files, you may want to use the -t option of the dhcptools command. This option performs packet tracing.
You may want to use this option in conjunction with the -d option of the bootpd(1M) command. Refer to the bootpd(1M) man page for details.
Here are some of the tools available and appropriate reason
for using them.
Automatically discovers illegal entries and typographical
errors in bootptab and dhcp tab.
Allows you to review a lease for a particular client. You
can use it to make sure the client is responding correctly.
/usdhcptools -p ht=hardware_type ha=hardware_address\ sn=subnet_identifier [lt=lease_time][rip=requested_IP_address]
|
Allows you to reclaim an individual lease address, making
it available for a new client.
dhcptools -r ip=IP_address ht=hardware_type ha=hardware\ _address
|
dhcptools -R ip=IP_address ci=client_identifier
Callbacks |
 |
HP-UX DHCP server provides a powerful facility that enables
you to customize the DHCP server, known as callbacks. These are
user-defined actions that are executed for different types of transaction
successes and failures. These callbacks are defined in /etc/dhcptab as follows:
DHCP_SERVER_SETTINGS:\ call-on-unrequited="/etc/script.unrequited":\ callback_style="NEW":
|
call-on-unrequited="/etc/script.unrequited":\ call-on-assignment=/etc/script.assignment:\ call-on-decline=/etc/script.decline:\ call-on-release=/etc/script.release:\ call-on-lease-extend=/etc/script.extend:\ call-on-discard=/etc/script.discard:
|
Each callback passes some command line parameters (such as
client hardware address, client IP address, class-id, etc.) to the
executable file named in /etc/dhcptab. The executable is typically a shell script, but it can
be any executable file. This is commonly used to send mail to the network
administrator or store data in a file about DHCP clients that have
succeeded or failed in negotiating a lease. The following is an example
callback script: