Running DHCP

The basic DHCP process is a straightforward two-phase process involving a single DHCP client and at least one DHCP server. When the DHCP client (dhcpagent) is started on a client, it broadcasts a DHCPDISCOVER request for an IP address on the local network, which is received by all available servers running a DHCP server (in.dhcpd). Next, all DHCP servers that have spare IP addresses answer the client s request through a DHCPOFFER message, which contains an IP address, a subnet mask, a default router name , and a DNS server IP address. If there are multiple DHCP servers that have IP addresses available, it is possible that multiple servers will respond to the client request. The client simply accepts the first DHCPOFFER that it receives, upon which it broadcasts a DHCPREQUEST message indicating that a lease has been obtained. Once the server has received this second request, it confirms the lease with a DHCPACK message. After a client has finished using the IP address, a DHCPRELEASE message is sent to the server.

In the situation where a server has proposed a lease in the first phase that it is unable to fulfill in the second phase, it must respond with a DHCPNACK message. This means that the client will then broadcast a DHCPDISCOVER message, and the process will start again. A DHCPNACK message is usually sent if a timeout has occurred between the original DHCPDISCOVER request and the subsequent reception at the server side of a DHCPREQUEST message. This is often due to network outages or congestion. The list of all possible DHCP messages is shown in Table 38-1.

Table 38-1: DHCP Codes and Their Meanings

Code

Description

DHCPDISCOVER

Broadcast from client to all reachable servers.

DHCPOFFER

Server responds to DHCPDISCOVER requests .

DHCPREQUEST

Client accepts lease proposal from only one server.

DHCPACK

Server acknowledges lease.

DHCPNACK

Server refuses to accept DHCPREQUEST.

DHCPRELEASE

Lease no longer required.

The DHCPOFFER message specifies the lease period, after which the lease will be deemed to have expired and made available to other clients. However, clients also have the option of renewing an existing lease so that their existing IP address can be retained. The DHCP protocol defines fixed intervals prior to actual lease expiry, at which time a client should indicate whether or not it wishes to extend the lease. If these renewals are not made in time, a DHCPRELEASE message will be broadcast and the lease will be invalid.

DHCP has three ways to allocate leases to client. Automatic allocation grants an IP address permanently to a client. This is useful for granting IP addresses to servers that require a static IP address. A DNS server typically requires a static IP address that can be registered in host records lodged with InterNIC. The majority of clients will have addresses assigned dynamically by the server, which allows the greatest reuse of addresses. Alternatively, an administrator may manually assign an address to a specific client.

The process of allocating a DHCP lease is shown in Figure 38-1.

click to expand
Figure 38-1: How DHCP leases IP addresses.
 
 
   


Sun Certified Solaris 9.0 System and Network Administrator
Sun Certified Solaris(tm) 9 System and Network Administrator All-in-One Exam Guide
ISBN: 0072225300
EAN: 2147483647
Year: 2003
Pages: 265
Authors: Paul Watters

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net