DYNAMIC HOST CONFIGURATION PROTOCOL. (DHCP)

Introduction. *

Definations. *

Installing DHCP. *

Configuring DHCP *

Configuring DHCP Scope. *

Configuring The DHCP Server. *

Configuring a DHCP client *

Introduction.

The Dynamic Host Configuration Protocol (DHCP) is a service that runs on Windows NT/2000 servers and is used to automatically assign IP addresses and any other TCP/IP configuration information to clients. Every computer on a TCP/IP network must have a unique computer name and IP address. The IP address (together with its related subnet mask) identifies both the host computer and the subnet to which it is attached. When you move a computer to a different subnet, the IP address must be changed. DHCP allows you to dynamically assign an IP address to a client from a DHCP server IP address database on your local network.

DHCP is based on the following RFCs

RFC 2131: Dynamic Host Configuration Protocol (obsoletes RFC 1541)

RFC 2132: DHCP Options and BOOTP Vendor Extensions

The following RFCs might also be helpful for understanding how DHCP is used with other services on your network:

RFC 951: The Bootstrap Protocol (BOOTP)

RFC 1534: Interoperation Between DHCP and BOOTP

RFC 1542: Clarifications and Extensions for the Bootstrap Protocol

RFC 2136: Dynamic Updates in the Domain Name System (DNS UPDATE)

RFC 2241: DHCP Options for Novell Directory Services

RFC 2242: Netware/IP Domain Name and Information

This article is aimed at describing the process of installing and configuring the DHCP service on a Windows 2000 Server or Advanced Server.

Definitions.

Before we get into the details of DHCP, there are some definitions that you need to understand.

Scope

A scope is the full consecutive range of possible IP addresses for a network. Scopes typically define a single physical subnet on your network to which DHCP services are offered. Scopes also provide the primary way for the server to manage distribution and assignment of IP addresses and any related configuration parameters to clients on the network.

Superscope

A superscope is an group of scopes that can be used to support multiple logical IP subnets on the same physical subnet. Superscopes help to ease administration and contain a list of member scopes or child scopes that can be activated together. Superscopes are not used to configure other details about scope usage. For configuring most properties used within a superscope, you need to configure member scope properties individually.

Exclusion range

An exclusion range is a limited sequence of IP addresses within a scope, excluded from DHCP service offerings. Exclusion ranges assure that any addresses in these ranges are not offered by the server to DHCP clients on your network.

Address pool

After you define a DHCP scope and apply exclusion ranges, the remaining addresses form the available address pool within the scope. Pooled addresses are eligible for dynamic assignment by the server to DHCP clients on your network.

Lease

A lease is a length of time that a DHCP server specifies, during which a client computer can use an assigned IP address. When a lease is made to a client, the lease is active. Before the lease expires, the client typically needs to renew its address lease assignment with the server. A lease becomes inactive when it expires or is deleted at the server. The duration for a lease determines when it will expire and how often the client needs to renew it with the server.

Reservation

You use a reservation to create a permanent address lease assignment by the DHCP server. Reservations assure that a specified hardware device on the subnet can always use the same IP address.

Option types

Option types are other client configuration parameters a DHCP server can assign when serving leases to DHCP clients. For example, some commonly used options include IP addresses for default gateways (routers), WINS servers, and DNS servers. Typically, these option types are enabled and configured for each scope. The DHCP console also permits you to configure default option types that are used by all scopes added and configured at the server. Most options are predefined through RFC 2132, but you can use the DHCP console to define and add custom option types if needed.

Options class

An options class is a way for the server to further manage option types provided to clients. When an options class is added to the server, clients of that class can be provided class-specific option types for their configuration. For Windows 2000, client computers can also specify a class ID when communicating with the server. For earlier DHCP clients that do not support the class ID process, the server can be configured with default classes to use instead when placing clients in a class. Options classes can be of two types: vendor classes and user classes.

Installing DHCP.

DHCP can be installed on any Windows NT Server on your network as long as it TCP/IP installed and a static IP address.

It can be installed as a service during installation or later by accessing the Add/Remove Programs applet in the Control Panel.

Below is a procedure of installing the DHCP service on a Windows 2000 Server.

  1. Access the Control Panel by clicking on Start - Settings - Control Panel - Add/Remove Programs.
  2. Click on add remove Windows Components.
  3. The Windows Components Wizard appears as shown below.
  4. Scroll down and Select Networking Services.
  5. TheNetworking Services Dialogue Box appears Check the box next to Dynamic Host Configuration Protocol
  6. Click on OK then go back to the Windows Components Wizard Screen and click Next.

After making the necessary changes, The Wizard will indicate that you have successfully completed then click finish.

Configuring DHCP

You have now successfully installed the DHCP Protocol however before your server can be able to assign IP addresses and TCP/IP Configuration information to clients, you must first authorize your server in the Active Directory. If you opted to install DHCP during setup of the operating system and you also installed the Active directory during Setup, the DHCP Server will be authorized automatically.

Below is the Procedure for Authorizing a DHCP Server in the Active Directory.

  1. Access the DHCP Manager by clicking on Start - Programs - Administrative Tools – DHCP.
  2. The DHCP Manager appears as shown below.
  3. as indicated in the DHCP manager snap in, The Server appears with a red arrow pointing downwards. This indicates that the service is not running.

  4. To authorize the DHCP server, right click on the server and select Authorize from the menu that appears.
  5. Once the DHCP Server is authorized, a Green arrow that points upwards is displayed. This is an indicator that the service is running.

Now that the DHCP service is running on your server you can now specify a range of IP addresses to be assigned to clients and any other TCP/IP configuration Information that you would like to make accessible to your DHCP clients.

To create a Scope, Right click on the Server and select New Scope.

The New Scope Wizard begins.

Click Next and type in a name and a description of your scope and click Next

In the IP address range tab (shown Below),

Enter the Range of IP addresses that you wish to assign to clients.

Input the length of your subnet mask in bits or just enter the subnet mask in the area provided and then click Next

If you wish to exclude any address that is part of the range you have just specified probably because it belongs to a machine with a static IP address like a server or router, you can do so in the Add Exclusions Dialogue box.

To exclude a single IP address, type it as the Start and also as the End IP address. If you don’t wish to exclude any IP addresses click next.

In the Lease Duration Dialogue Box, indicate the duration that the specific client can have that IP address.

Duration could be in Days, Hours and Minutes. When through click Next

In the Configure DHCP options dialogue box, choose whether to configure more tcp/ip parameters now or later. Then click Next

If you selected ‘No, I will configure this options later’, the completing the new scope wizard screen appears and then you can click finish.

Note you can go back through the stages of installation process by clicking on the back button.

If you selected ‘Yes, I want to configure this options now’, the Router (Default Gateway) dialogue box appears as shown below.

You can specify the routers in your subnet that clients in this scope will respond to.

If you are using the Domain Name System (DNS) in your network, you can make DNS servers available for clients in this scope.

You can also specify the parent domain that you want clients in this network to use for host name resolution.

If you know the name of the server but do not have it’s IP address, type in its host name under the server name box and click ‘Resolve’ the host name is resolved to the IP address of the machine and it is indicated. Click on ‘add’. When through, click on ‘Next’

If you are using NETBIOS computer names for your client machines, have a Windows Internet Name Server to resolve this names to their respective IP addresses. To enable the clients in this scope to query the WINS server for NETBIOS name resolution, enter the IP address of the WINS server or enter it’s host name and click on resolve to have it resolved to an IP address.

Entering this option enables a client computer to query the WINS server however this is done after broadcasting over the network. Broadcasting can cause a toil on your network hence it should be avoided. To prevent the clients from first broadcasting and have them query the WINS server first, you will have to modify the option 046, WINS/NBT Node Type in the scope options. This will be covered later in manually configuring a DHCP scope.

Click ‘Next’ to continue.

The Windows Internet Name Service is a Windows 2000 Server service that covers more on NETBIOS name resolution in a network environment.

Client machines cannot receive IP addresses or any information from your scope unless you activate it. Choose whether to have it active in the ‘Activate Scope’ dialogue box. You can activate your scope later if you so wish. This will be discussed later.

Click Next and then Finish to close the Wizard.

Configuring DHCP Scope.

You can use the DHCP snap in to manually configure the scopes you create or change your previous configuration and also any options for your DHCP server.

The DHCP snap in appears as shown below.

On the console tree, you can view the DHCP server(s) expand the server to view the scope and server options. You can further expand your scope to view it’s contents which include: Address pool, Address leases, Reservations and Scope options.

In the Address Pool section you can view the reserved IP addresses, and any scopes you have created.

By right clicking on the Address pool folder in the console tree, you can add a new exlusion range by using the add exclusion dialogue box.

By clicking on the Address Leases folder, you can view a list of all addresses that have been leased out to clients. You can delete a leased address by right clicking on it and selecting deleting.

In the Scope options folder (shown below), you can view any options you have configured for your scope.

To configure scope options, right click on the Scope Options folder and select ‘Configure Options’ the scope options dialogue box appears as shown below.

you can use this dialogue box to configure TCP/IP parameters for you DHCP clients.

For example,

To enable your clients to receive a default gateway/ router’s IP address, access the scope options dialogue box and check the box next to ‘003 Router’ in the Available Options section.

In the Data Entry area, enter the host name of the router that clients in that subnet will be used and click on ‘Resolve’ to have it resolved to it’s IP address. Click on Add. If you want clients to access more than one router add them and arrange them in order of preference using the ‘up’ and ‘down’ buttons with the most preferred on top.

Configuring The DHCP Server.

There are various properties you can configure on your DHCP server by right clicking on it in the console and selecting properties. The properties of your server appear as shown below.

In the General tab, you can configure your server to automatically update statistics regularly after the interval that you set.

In the DNS tab, (shown below) configure your server to automatically update DNS servers regularly for host name and address resolutions. A Windows 2000 DHCP server is capable of updating a DNS server’s database dynamically saving the Administrator a lot of time in configuration and also improving the general performance of the network. Clients running Windows 2000 are capable of updating their records dynamically but other clients cannot. You can use the DHCP server to update the information for all clients by selecting ‘Enable updates for clients that do not support dynamic updates’ if all your clients are running Windows 2000, you can have them update their respective DNS records by selecting ‘Update DNS only if client requests’. It is also important to enable your DHCP server to discard IP address information in your DNS servers database that is no longer in use to avoid the client receiving incorrect responses.

In the Advanced tab, you can configure your server to detect conflicts before assigning an IP address. You can also set the path to your log file which contains activity and auditing information on your DHCP. You can also set the path to your database file which contains client information on their IP addresses and any scope configuration settings.

You can also set the connections that this DHCP server will serve by clicking on the ‘Bindings’ button and checking the box next to the connections you want this server to serve. The bindings dialogue box is shown below.

Configuring a DHCP client

The DHCP is now installed and running on the server however to enable clients to receive IP addresses and any other TCP/IP configuration information, they must be configured to request for it from a DHCP server. For Windows 95 and 98 clients, TCP/IP is not installed by default. To install it access the Network applet in the Control Panel, (shown below)

Click on add Select protocols, in the Protocol Selection dialogue box, selcet Microsoft the TCP/IP. Click OK

clients are configured to receive their IP address information from a DHCP server automatically so after file copying, reboot the machine and it should be able to receive an IP address automatically.

In the case of Windows NT Servers and Workstations, during the network installation, you

may choose to install TCP/IP however if not installed, access the Network applet in the Control Panel, (shown below) click on the protocols tab then add select TCP/IP.

Setup prompts you on whether you wish to use DHCP click ‘Yes’ and after the file copying reboot your machine.

In the case of Windows 2000 clients, TCP/IP is referred to as the Internet Protocol and it is installed by default when you install your network. To configure a client to access a DHCP server, open the Network and Dialup Connections in the Control Panel and then right click on any connection and select properties. The properties dialogue box appears (shown below)

click on Internet Protocol and then click on Properties.

On the Properties Dialogue box, click the ‘Obtain an IP address automatically radio button.

DHCP is now running on your network however clients on a different subnet from yours cannot access this DHCP server unless there is a DHCP relay agent in their subnet.

A DHCP relay agent small program that relays DHCP/BOOTP messages between clients and servers on different subnets they are part of the DHCP and BOOTP standards and function according to the RFCs, standard documents that describe protocol design and related behavior. For more information, see DHCP RFCs. Listed above

To understand how relay agents work, it is necessary to understand the process a client goes through to receive an IP address.

    1. The client broadcasts over the network requesting for a DHCP server this broadcast is referred to as DHCPDISCOVER..
    2. A DHCP server in the subnet responds with a DHCPOFFER which contains an offered IP address and lease.
    3. The DHCP client on reception of the offer, replies with a request
    4. The server responds with a DHCPACK (DHCP acknowledgement) this is a message sent by the DHCP server to a client to acknowledge and complete a client’s request for leased configuration. This message will contain a committed IP address for the client to use for a stated period of time along with other optional client parameters.
    5. After receiving the acknowledgement the client then configures it’s TCP/IP parameters as received.

A DHCP relay agent responds to client’s DHCPDISCOVER broadcasts similarly to a DHCP server and uses it to request for IP address information for the client from the remote server.

If a DHCP server or relay agent is not available, the client continues performing broadcasts 4 times every 5 minutes. However if this client is a Windows 98 or 2000 client, it can automatically assign itself an IP address using the APIPA (Automatic Private IP Addressing)

This is a feature of the TCP/IP protocol that self-configures an IP address and subnet mask in the absence of a static configuration and a DHCP server.

APIPA randomly selects a unique IP address from the range 169.254.0.1 through 169.254.255.254 and sets the subnet mask to 255.255.0.0. APIPA allows home users and small business users to create a functioning, single subnet TCP/IP network without having to manually configure the TCP/IP protocol or set up a DHCP server.


This article sought to inform readers and MCSE want to be’s on the DHCP protocol and it’s configuration on Microsoft Windows 2000 Servers and Advanced Servers and on Windows clients.


Kenneth Ndirangu, seeks comments on the above article and any other in this site he can be reached by e-mail kendirangu at hotmail dot com.