The majority of problems that will be found on a DHCP client involve a DHCP server that can't be reached or is not responding, or a problem with the configuration of the DHCP server itself. The main troubleshooting tools available to the administrator include the following actions:
Run the DHCP Client in Debug Mode to View MessagesTo see more detailed messages about the client IP allocation process, you can run the client DHCP daemon, dhcpagent , in debug mode. The following session proceeds through these steps:
The lines of interest appear in bold. ultra5# ifconfig hme0 dhcp release ultra5# pkill dhcpagent ultra5# /sbin/dhcpagent -d1 -f & ultra5# ifconfig hme0 dhcp start /sbin/dhcpagent: debug: set_packet_filter: set filter 0x2e648 (DHCP filter) /sbin/dhcpagent: debug: init_ifs: initted interface hme0 /sbin/dhcpagent: debug: insert_ifs: hme0: sdumax 1500, optmax 1260, \ hwtype 1, hwlen 6 /sbin/dhcpagent: debug: insert_ifs: inserted interface hme0 /sbin/dhcpagent: debug: set_packet_filter: set filter 0x2e648 (DHCP filter) /sbin/dhcpagent: debug: init_ifs: initted interface hme0 /sbin/dhcpagent: debug: dhcp_selecting: DF_REQUEST_HOSTNAME /sbin/dhcpagent: debug: select_best: OFFER had 42 points /sbin/dhcpagent: debug: select_best: most points: 42 /sbin/dhcpagent: debug: register_acknak: registered acknak id 5 /sbin/dhcpagent: debug: unregister_acknak: unregistered acknak id 5 /sbin/dhcpagent: debug: set_packet_filter: set filter 0x2c640 (ARP reply filter) /sbin/dhcpagent: info: setting IP netmask on hme0 to 255.255.255.0 /sbin/dhcpagent: info: setting IP address on hme0 to 192.168.28.32 /sbin/dhcpagent: info: setting broadcast address on hme0 to 192.168.28.255 /sbin/dhcpagent: info: added default router 192.168.28.28 on hme0 /sbin/dhcpagent: debug: set_packet_filter: set filter 0x2e6d4 (blackhole filter) /sbin/dhcpagent: debug: configure_if: bound ifsp->if_sock_ip_fd /sbin/dhcpagent: info: hme0 acquired lease, expires Tue Jun 24 00:59: 09 2003 /sbin/dhcpagent: info: hme0 begins renewal at Tue Jun 24 00:29:46 2003 /sbin/dhcpagent: info: hme0 begins rebinding at Tue Jun 24 00:50:33 2003 ultra5# ifconfig hme0 dhcp release /sbin/dhcpagent: info: releasing interface hme0 /sbin/dhcpagent: debug: free_ifs: freeing interface hme0 ultra5# pkill dhcpagent /sbin/dhcpagent: info: received SIGTERM, shutting down... The following options to dhcpagent were used in the preceding example:
The example debug session shows a successful IP address being obtained by a client. You can see that the client assesses the offer of an address, scores it (42 points), and then selects it. The network mask, IP address, broadcast address, and default router are also set from the DHCP server and finally the lease is acquired. snoopUse the snoop command to monitor network traffic between the DHCP client and the server. It can often provide useful information when you are trying to diagnose a problem. The following snapshot from snoop captures packets when a client requests an IP address. Note that only the DHCP protocol items are shown here: ultra10# snoop -i /tmp/sn.log DHCP: ----- Dynamic Host Configuration Protocol ----- DHCP: DHCP: Hardware address type (htype) = 1 (Ethernet (10Mb)) DHCP: Hardware address length (hlen) = 6 octets DHCP: Relay agent hops = 0 DHCP: Transaction ID = 0x6372d201 DHCP: Time since boot = 0 seconds DHCP: Flags = 0x0000 DHCP: Client address (ciaddr) = 0.0.0.0 DHCP: Your client address (yiaddr) = 0.0.0.0 DHCP: Next server address (siaddr) = 0.0.0.0 DHCP: Relay agent address (giaddr) = 0.0.0.0 DHCP: Client hardware address (chaddr) = 08:00:20:8E:48:CE DHCP: DHCP: ----- (Options) field options ----- DHCP: DHCP: Message type = DHCPDISCOVER DHCP: Maximum DHCP Message Size = 1472 bytes DHCP: IP Address Lease Time = -1 seconds DHCP: Client Class Identifier = "SUNW.SPARCstation-5" DHCP: Requested Options: DHCP: 1 (Subnet Mask) DHCP: 3 (Router) DHCP: 12 (Client Hostname) DHCP: 43 (Vendor Specific Options) DHCP: ----- Dynamic Host Configuration Protocol ----- DHCP: DHCP: Hardware address type (htype) = 1 (Ethernet (10Mb)) DHCP: Hardware address length (hlen) = 6 octets DHCP: Relay agent hops = 0 DHCP: Transaction ID = 0x6372d201 DHCP: Time since boot = 0 seconds DHCP: Flags = 0x0000 DHCP: Client address (ciaddr) = 0.0.0.0 DHCP: Your client address (yiaddr) = 192.168.28.40 DHCP: Next server address (siaddr) = 0.0.0.0 DHCP: Relay agent address (giaddr) = 0.0.0.0 DHCP: Client hardware address (chaddr) = 08:00:20:8E:48:CE DHCP: DHCP: ----- (Options) field options ----- DHCP: DHCP: Message type = DHCPOFFER DHCP: DHCP Server Identifier = 192.168.28.28 DHCP: UTC Time Offset = 0 seconds DHCP: RFC868 Time Servers at = 192.168.28.28 DHCP: IP Address Lease Time = 86400 seconds DHCP: DNS Domain Name = xyz.com DHCP: DNS Servers at = 192.168.28.28 DHCP: TFTP Server Name = 192.168.28.28 DHCP: Broadcast Address = 192.168.28.255 DHCP: Router at = 192.168.28.28 DHCP: Subnet Mask = 255.255.255.0 DHCP: Client Hostname = ultra10-40 DHCP: ----- Dynamic Host Configuration Protocol ----- DHCP: DHCP: Hardware address type (htype) = 1 (Ethernet (10Mb)) DHCP: Hardware address length (hlen) = 6 octets DHCP: Relay agent hops = 0 DHCP: Transaction ID = 0x180271a2 DHCP: Time since boot = 0 seconds DHCP: Flags = 0x0000 DHCP: Client address (ciaddr) = 0.0.0. 0 DHCP: Your client address (yiaddr) = 0.0.0.0 DHCP: Next server address (siaddr) = 0.0.0.0 DHCP: Relay agent address (giaddr) = 0.0.0.0 DHCP: Client hardware address (chaddr) = 08:00:20:8E:48:CE DHCP: DHCP: ----- (Options) field options ----- DHCP: DHCP: Message type = DHCPREQUEST DHCP: IP Address Lease Time = 86400 seconds DHCP: Maximum DHCP Message Size = 1472 bytes DHCP: Requested IP Address = 192.168.28.40 DHCP: DHCP Server Identifier = 192.168.28.28 DHCP: Client Class Identifier = "SUNW.SPARCstation-5" DHCP: Requested Options: DHCP: 1 (Subnet Mask) DHCP: 3 (Router) DHCP: 12 (Client Hostname) DHCP: 43 (Vendor Specific Options) DHCP: ----- Dynamic Host Configuration Protocol ----- DHCP: DHCP: Hardware address type (htype) = 1 (Ethernet (10Mb)) DHCP: Hardware address length (hlen) = 6 octets DHCP: Relay agent hops = 0 DHCP: Transaction ID = 0x180271a2 DHCP: Time since boot = 0 seconds DHCP: Flags = 0x0000 DHCP: Client address (ciaddr) = 0.0.0.0 DHCP: Your client address (yiaddr) = 192.168.28.40 DHCP: Next server address (siaddr) = 0.0.0.0 DHCP: Relay agent address (giaddr) = 0.0.0.0 DHCP: Client hardware address (chaddr) = 08:00:20:8E:48:CE DHCP: DHCP: ----- (Options) field options ----- DHCP: DHCP: Message type = DHCPACK DHCP: DHCP Server Identifier = 192.168.28.28 DHCP: UTC Time Offset = 0 seconds DHCP: RFC868 Time Servers at = 192.168.28.28 DHCP: IP Address Lease Time = 86400 seconds DHCP: DNS Domain Name = xyz.com DHCP: DNS Servers at = 192.168.28.28 DHCP: TFTP Server Name = 192.168.28.28 DHCP: Broadcast Address = 192.168.28.255 DHCP: Router at = 192.168.28.28 DHCP: Subnet Mask = 255.255.255.0 DHCP: Client Hostname = ultra10-40 Notice how each of the message types is present, namely:
Problems Acquiring HostnamesThe majority of problems with clients trying to acquire hostnames involve the use of DNS. Table 12.3 identifies some of the more common problems and their resolutions . Table 12.3. Common Hostname Acquisition Problems
Obtaining a Lease ManuallyWhen a client is unable to use the normal dynamic mechanism to obtain a lease for an IP address, it is worthwhile trying to obtain a lease manually. Use the following ifconfig command to do this for a client with an hme0 interface: ultra10# ifconfig hme0 dhcp Verify that a lease has been obtained by using the ifconfig command to view the interface status. There should now be an IP address assigned to the interface. Checking Client StatusAt any time you can check the current status of the DHCP client by using the ifconfig command on the network interface being managed by DHCP. Execute the following command to examine the status of the hme0 interface: ultra5# ifconfig hme0 dhcp status Interface State Sent Recv Declined Flags hme0 BOUND 2 2 0 (Began, Expires, Renew) = (06/24/2003 00:41, 06/25/2003 00:41, 06/24/2003 \ 13:03) The State field shows that the interface is BOUND to an address. The lease information gives details of when the lease for the IP address was assigned, when it will expire, and when it can be renewed. |