You are on page 1of 14

The following information is supplied to help explain what the Dynamic Host

Configuration Protocol (DHCP) is, how to configure the DHCP server and enable a
Windows NT as well as Windows for Workgroups DHCP client.
Back to the top

MORE INFORMATION
Implementing DHCP eliminates some of the
configuration problems associated with...
Implementing DHCP eliminates some of the configuration problems associated with
manually configuring TCP/IP. DHCP centralizes TCP/IP configurations and manages the
allocation of TCP/IP configuration information by automatically assigning IP addresses
to computers configured to use DHCP.
Back to the top

DHCP Requirements

The following requirements need to be met by the DHCP server:

• The DHCP server service is running on a Windows NT Server on at least one


computer within the TCP/IP internetwork.

NOTE: Your IP routers must support RFC 1542, otherwise you need a DHCP
server or a DHCP Relay agent on each subnet.
• A DHCP scope exists on the DHCP server.

A DHCP scope consists of a pool of IP addresses the DHCP server can assign or
lease to DHCP clients. For example:

xxx.107.3.51 through xxx.107.3.200

where xxx is any valid number for the first octet of the IP address.

The following requirements need to be met by the DHCP client:

• The client computer has a DHCP supported operating system. The following
operating systems are capable of being a DHCP client with DHCP enabled at the
client:

- Windows NT Server 3.5, 3.51, and 4.0


- Windows NT Workstation 3.5, 3.51, and 4.0
- Windows 95
- Windows for Workgroups 3.11 with the Microsoft TCP/IP-32 for Windows for
Workgroups installed
- MS Network Client 3.0 for MS-DOS with the real mode TCP/IP driver installed
- LAN Manager 2.2c

Back to the top

Installing the DHCP Server Service

Prior to installing the DHCP service, you must log on as administrator from the
primary domain controller. To install the DHCP Server service, follow these steps:

1. Run Control Panel and choose Network.


2. Choose Add Software.
3. In the Add Network Software dialog box, select TCP/IP Protocol And Related
Components, and then choose Continue.

The Windows NT TCP/IP Installation Options dialog box appears, displaying the
TCP/IP components available to be installed.
4. Select DHCP Server Service, and then choose Continue.

The Windows NT setup box appears, prompting you for the full path of the
Windows NT distribution files.

NOTE: You may be prompted with the following message:

At least one of your adapters has automatic DHCP configuration enabled. In order
to correctly install the DHCP server, setup will disable automatic DHCP
configuration. Are you sure you want to install the DHCP Server?

Choose Continue.
5. Type the path to the location of Windows NT Server distribution files, and choose
Continue.

If you install from compact disc, the path is under the \I386 directory.

The TCP/IP configuration Box appears.


6. Enter the static IP address of the DHCP Server as well as the subnet mask and the
default gateway. If you use Windows Internet Name Service (WINS), add the
primary and secondary WINS addresses here.

The appropriate files are copied to your server, and then the Network Settings
dialog box appears.
7. Choose OK.

A Network Settings Change dialog box appears, indicating that the system must
be restarted to initialize the new configuration.
8. Save any unsaved work in other windows and choose Restart Now to restart
Windows NT Server.
9. Log on as Administrator.

Back to the top

Configuring a DHCP Scope

Be sure to install and initialize the DHCP Server before completing the next step.

To configure the DHCP scope, you must log on as administrator. Configuring the DHCP
scope supplies the DHCP client with the range of IP addresses from which the server
draws from and a subnet mask to be assigned to clients.

The DHCP Server provides:

• Default gateway address


• Domain Name
• Service server addresses
• WINS server addresses
• NETBIOS name resolution type.

For additional information, please see the following article(s) in the Microsoft
Knowledge Base:
ARTICLE-ID: 121005 (http://support.microsoft.com/kb/121005/EN-US/ )
TITLE : DHCP Options Supported by Clients

1. From the Network Administration group, start DHCP Manager.

The DHCP Manager window appears.


2. Under DHCP Servers, select *Local Machine*

Local Machine indicates that you are configuring the local DHCP server, and not
a remote DHCP server.
3. From the Scope menu, choose Create.

The Create Scope dialog box appears.


4. Complete the scope configuration.

The DHCP server cannot be a DHCP client. It must have a static IP address,
subnet mask, and default gateway address. You also have the option of assigning
an exclusion range or specific excluded addresses as well as lease duration and a
name.
5. Choose OK when done.
6. Choose Yes to activate the scope.

The DHCP Manager window appears with the new scope added. Notice the
yellow light bulb next to the IP address. This indicates an active scope.
7. Close the DHCP Manager.

Back to the top

Enabling DHCP at the Client

To enable the Windows NT DHCP client, you must log on as administrator at the
Windows NT client.

Normally, you enable DHCP as part of the installation procedure for Microsoft TCP/IP,
however, you can use this procedure if you have manually configured TCP/IP:

1. Run Control Panel and choose Network.

The Network Settings dialog box appears.


2. Under Installed Network Software, select TCP/IP Protocol and then choose
configure.

The TCP/IP configuration dialog box appears.


3. Select Enable Automatic DHCP Configuration.

A Microsoft (MS) TCP/IP message appears, indicating that the DHCP Protocol
attempts to configure the server automatically during system initialization.
4. Choose Yes.

A MS TCP/IP Configuration dialog box appears, displaying current TCP/IP


configuration parameters. The IP Address and Subnet Mask boxes are not
available (grayed out) and the manually configured values are no longer
displayed.
5. Choose OK to return to the Network Settings dialog box.
6. Choose OK again.
7. Shut down and restart the computer.

To enable DHCP on a Windows for Workgroups client if TCP/IP is not installed yet:

1. Use Network Setup to install the MS TCP/IP-32 3.11 protocol.


2. In the MS TCP/IP Configuration dialog box, select the Enable Automatic DHCP
Configuration check box, and choose Continue.
3. Restart the computer to initialize TCP/IP using DHCP.

To enable DHCP on a Windows for Workgroups client if TCP/IP is installed:


1. To access the Network Drivers dialog box, run Network Setup.
2. Select Microsoft TCP/IP-32 3.11, and then choose Setup.
3. In the MS TCP/IP Configuration dialog box, select the Enable Automatic DHCP
Configuration check box, and choose continue.

A message box appears indicating that the configuration of DHCP overrides any
values established locally.
4. Choose Yes.

To initializeConfiguring scopes

Updated: January 21, 2005

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003
with SP1, Windows Server 2003 with SP2

Configuring scopes
A scope is an administrative grouping of IP addresses for computers on a subnet that use
the DHCP service. The administrator first creates a scope for each physical subnet and
then uses the scope to define the parameters used by clients. A scope has the following
properties:

• A range of IP addresses from which to include or exclude addresses used for


DHCP service lease offerings.

• A subnet mask, which determines the subnet for a given IP address.

• A scope name assigned when it is created.

• Lease duration values, which are assigned to DHCP clients that receive
dynamically allocated IP addresses.

• Any DHCP scope options configured for assignment to DHCP clients, such as
DNS server, router IP address, and WINS server address.

• Reservations, optionally used to ensure that a DHCP client always receives the
same IP address.

Before adding scopes


A DHCP scope consists of a pool of IP addresses on a given subnet, such as 192.168.0.1
to 192.168.0.254, that the DHCP server can lease to clients.
Each subnet can have only a single DHCP scope with a single continuous range of IP
addresses. To use several address ranges within a single scope or subnet for DHCP
service, you must first define the scope and then set any needed exclusion ranges.

• Defining the scope

Use the entire range of consecutive IP addresses that make up the local IP subnet
for which you are enabling DHCP service.

• Setting exclusion ranges

You should set exclusion ranges for any IP addresses within the scope that you do
not want the DHCP server to offer or use for DHCP assignment. For example,
you can exclude the first 10 addresses in the previous example scope by creating
an exclusion for 192.168.0.1 to 192.168.0.10.

By setting an exclusion for these addresses, you specify that DHCP clients are
never offered these addresses when they request leased configuration from the
server. Excluded IP addresses can be active on your network, but only by
manually configuring these addresses at hosts that do not use DHCP to obtain an
address.

Creating scopes
When you create a DHCP scope, you use the DHCP console to enter the following
required information:

• A scope name, assigned by you or the administrator who created the scope.

• A subnet mask used to identify the subnet to which an IP address belongs.

• A range of IP addresses contained within the scope.

• A time interval (known as a lease duration) that specifies how long a DHCP
client can use an assigned IP address before it must renew its configuration with
the DHCP server.

Using the 80/20 rule for scopes


For balancing DHCP server usage, a good practice is to use the "80/20" rule to divide the
scope addresses between the two DHCP servers. If Server 1 is configured to make
available most (approximately 80%) of the addresses, then Server 2 can be configured to
make the other addresses (approximately 20%) available to clients. The following
illustration is an example of the 80/20 rule:
Notes

• For detailed information on applying the 80/20 rule, see DHCP Best Practices.

• When creating a new scope, the IP address used to create it should not include
addresses of existing statically configured computers, such as the DHCP server.
Either these static addresses should be outside the range for the scope, or they
should be excluded from the scope address pool.

After scopes are added


After you define a scope, you can additionally configure the scope by performing the
following tasks:

• Set additional exclusion ranges.

You can exclude any other IP addresses that must not be leased to DHCP clients.
You should use exclusions for all devices that must be statically configured. The
excluded ranges should include all IP addresses that you assigned manually to
other DHCP servers, non-DHCP clients, diskless workstations, or Routing and
Remote Access and PPP clients.

• Create reservations.

You can choose to reserve some IP addresses for permanent lease assignment to
specified computers or devices on your network. You should make reservations
only for devices that are DHCP-enabled and that must be reserved for specific
purposes on your network (such as print servers).

• Adjust the length of lease durations.

You can modify the lease duration to be used for assigning IP address leases. The
default lease duration is eight days.

For most LANs, the default value is acceptable but can be further increased if
computers seldom move or change locations. Also, infinite lease times can be set
but should be used with caution. For information about circumstances under
which modifying this setting is most useful, see Managing leases.

• Configure options and classes to be used with the scope.

To provide full configuration for clients, DHCP options need to be configured and
enabled for the scope. For more information, see Setting Up Options.

For more advanced discrete management of scope clients, you can add or enable
user or vendor-defined option classes. For more information, see Using option
classes.

Notes

• After you define and configure a scope, the scope must be activated before the
DHCP server begins providing service to clients. However, you should not
activate a new scope until you have specified the DHCP options for it. For
information on how to activate a scope, see Activate a scope.

• After you activate a scope, you should not change the range of scope addresses.

5. TCP/IP using DHCP information, restart the computer.

Assigning options

Updated: January 21, 2005

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003
with SP1, Windows Server 2003 with SP2

Assigning options
You can manage DHCP options at several distinct levels:

• Predefined options. At this level, you control which types of options are
predefined for the DHCP server to expose as available options for assigning from
any of the option configuration dialog boxes (such as Server Options, Scope
Options, or Reservation Options) available through the DHCP console. You can
add or remove options to and from the predefined list of standard options as
needed. Although options are made available in this way, they are not assigned
values until administratively configured at either the server, scope, or reservation.

• Server options. Assign values here (using the General tab) for options that
should apply to or be inherited by all scopes and clients of the DHCP server as
defaults. Options configured here can have their values overridden by different
values if those values are set at either a scope, options class, or reserved client
level.

• Scope options. Assign values here (using the General tab) for options that
should apply only to clients of an applicable scope selected in the DHCP console
tree. Options configured here can have their values overridden by different values
if those values are set at either an options class or reserved client level.

• Reservation options. Assign values for options that should apply only to a
specific reserved DHCP client. To use this level of assignment, you must first add
a reservation for the applicable client to the applicable DHCP server and scope
where the client is to obtain its IP address. These options are set for an individual
DHCP client configured with an address reservation in a scope. Only properties
manually configured at the client computer can override options assigned at this
level.

• Class options. When using any of the option configuration dialog boxes (Server
Options, Scope Options or Reservation Options), you can click the Advanced
tab to configure and enable options for assignment to identifying member clients
of a specified user or vendor class.

Depending on the context, only those DHCP clients that identify themselves
according to the selected class are distributed options data you have configured
specifically for that class. For example, if a class-assigned option is set at a scope,
only clients of that scope that indicate class membership during leasing activity
are configured with class-assigned option values. Other non-member clients are
configured using scope option values set from the General tab.

Options configured here can override values assigned and set at the same context
(either server, scope, or reservation options) or values inherited from options
configured at a higher context. However, the ability of the client to indicate
membership in a specific options class is typically the decisive criteria for using
this level of options assignment. For more information, see Using option classes.

Guidelines for assigning options


The following guidelines can help you determine what level to assign the options you use
for clients on your network.
• Add or define new custom option types only if you have new software or
applications that require a nonstandard DHCP option.

• If your DHCP server manages many scopes for a large network, be selective when
assigning Server Options. These options apply by default to all clients of a
DHCP server computer, unless otherwise overridden.

• Use Scope Options for assigning most options that clients use. In most networks,
this level is typically preferred for assigning and enabling the use of DHCP
options.

• Use Class Options if you have a mixture of DHCP clients with diverse needs that
are able to identify a specific class on the DHCP server when obtaining a lease.
For example, if you have a limited number of DHCP client computers running
Windows 2000, these clients can be configured to receive vendor-specific options
that other clients do not use.

• Use Reservation Options for individual DHCP clients in your network that have
special configuration requirements.

For any hosts (that is, computers or other networked devices) that do not support
DHCP or are not recommended to use it, you can also consider excluding IP
addresses for those computers and devices and manually setting the IP address
configuration directly at the applicable host. For example, you often need to
statically configure the IP address for routers.

Commonly used options


After you set basic TCP/IP configuration settings (such as IP address, subnet mask, and
default gateway) for clients, most clients also need the DHCP server to provide other
information through DHCP options. The most common of these include the following:

• Routers. A preferred list of IP addresses for routers on the same subnet as DHCP
clients. The client can then contact these routers as needed to forward IP packets
destined for remote hosts.

• DNS servers. IP addresses for DNS name servers that DHCP clients can contact
and use to resolve a domain host name query.

• DNS domain. Specifies the domain name that DHCP clients should use when
resolving unqualified names during DNS domain name resolution.

• WINS node type. A preferred NetBIOS name resolution method for the DHCP
client to use (such as b-node for broadcast only or h-node for a hybrid of point-to-
point and broadcast methods).
• WINS server. IP addresses of primary and secondary WINS servers for the
DHCP client to use.

Note

• When the DHCP service is installed, no DHCP option definitions are created.
Option definitions are created only when the DHCP console is opened for the first
time. If you want to configure the value of an option on a DHCP server on which
the console has never been opened, you must first use the Netsh DHCP context
command server add optiondef (at a netsh dhcp> command prompt or in a
batch file or script) to create the option definition. To use Netsh to assign a value
to the option definition you have created, use the Netsh DHCP context command
server set optionvalue. For more information, see Netsh commands for DHCP.

DHCP options

Updated: January 21, 2005

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003
with SP1, Windows Server 2003 with SP2

DHCP options
DHCP provides an internal framework for passing configuration information on to clients
on your network. Configuration parameters and other control information are carried in
tagged data items stored within protocol messages exchanged between the DHCP server
and its clients. These data items are called options.

Most standard DHCP options are currently defined in Request for Comments (RFCs)
published by the Internet Engineering Task Force (IETF). The full set of standard DHCP
options are described specifically in RFC 2132, "DHCP Options and BOOTP Vendor
Extensions."

All DHCP options mentioned in RFC 2132 are predefined for you to configure and use at
any DHCP server running Windows Server 2003 . If needed, you can also use the DHCP
console to define new DHCP options at each server.

Even though most DHCP servers can assign many options, most DHCP clients are
typically designed to request or support only a subset of the full RFC-specified standard
options set.

• For more information about DHCP options, see "DHCP Options" at the Microsoft
Windows Resource Kits Web site.
How options are applied
Options can be managed using different levels assigned for each managed DHCP server,
including:

• Server options These options are applied for all scopes defined at a DHCP
server.

• Scope options These options are applied specifically to all clients that obtain a
lease within a particular scope.

• Class options These options are applied only to clients that are identified as
members of a specified user or vendor class when obtaining a lease.

• Reservation options These options apply only for a single reserved client
computer and require a reservation to be used in an active scope.

Netsh DHCP example

Updated: January 21, 2005

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003
with SP1, Windows Server 2003 with SP2

Netsh DHCP example


You can use Netsh commands for Dynamic Host Configuration Protocol (DHCP) in
batch files and other scripts to automate tasks. The following example batch file
demonstrates how to use Netsh commands for DHCP to perform a variety of related
tasks.

In the circumstance of this example procedure, DHCP-01 is a DHCP server with the IP
address 192.168.0.2. The procedure adds a new scope to DHCP-01 with the name
MyScope, IP address 192.168.10.0, subnet mask 255.255.255.0, and comment
NewScope. It then configures the scope with an address range (192.168.10.1 through
192.168.10.254), an exclusion range (192.168.10.1 through 192.168.10.25), and router IP
addresses (DHCP option 003). The scope is then set to an active state.

For more information, see Setting Up Scopes, Setting Up Options, and DHCP options.

For more information and a complete list of Netsh commands for DHCP, see Netsh
commands for DHCP.

In the following example procedure, lines that contain comments are preceded by "rem,"
for remark. Netsh ignores comments.
rem one DHCP server:
rem (DHCP-01) 192.168.0.2

rem 1. Connect to (DHCP-01), and add the scope MyScope with IP address
192.168.10.0,
rem 1.1 subnet mask 255.255.255.0, and the comment NewScope.
netsh dhcp server 192.168.0.2 add scope 192.168.10.0 255.255.255.0
MyScope NewScope

rem 2. Connect to (DHCP-01 MyScope), and add IP address range


192.168.10.1 to 192.168.10.254 for distribution
rem 2.1 and the default ClientType of DHCP.
netsh dhcp server 192.168.0.2 scope 192.168.10.0 add iprange
192.168.10.1 192.168.10.254

rem 3. Connect to (DHCP-01 MyScope), and add IP exclusion range


192.168.10.1 to 192.168.10.25
rem 3.1 and the default ClientType of DHCP.
netsh dhcp server 192.168.0.2 scope 192.168.10.0 add excluderange
192.168.10.1 192.168.10.25

rem 4. Connect to (DHCP-01 MyScope), and set the value of option code
003
rem 4.1 to list two router IP addresses (10.1.1.1, 10.1.1.2).
netsh dhcp server 192.168.0.2 scope 192.168.10.0 set optionvalue 003
IPADDRESS 10.1.1.1 10.1.1.2

rem 5. Connect to (DHCP-01 MyScope), and set the scope state to active.
netsh dhcp server 192.168.0.2 scope 192.168.10.0 set state 1

rem 6. End example batch file.

The following table lists the netsh dhcp commands that are used in this example
procedure.

Command Description
Shifts the current DHCP command-line context to the server that is
server
specified by either its name or IP address.
add scope Adds a new scope to the specified DHCP server.
Switches the command context to the DHCP scope that is specified by
scope
its IP address.
add iprange Adds a range of IP addresses to the current scope.
add
Adds a range of excluded addresses to the current scope.
excluderange
set optionvalue Sets an option value for the current scope.
Sets or resets the state of the current scope to either an active or inactive
set state
state.

You might also like