D H C P
Every host on a transmission control protocol/ internet protocol
(TCP/IP) network must have a unique IP address. Each host
must be properly configured so that it knows its IP address.
When a new host comes on line, it must be assigned an IP
both within the correct range of addresses for the
sub net & but not already in use. Although you can manually
address to each computer of your network, that task
quickly becomes over whelming if the network has more than a
comes into play. DHCP automatically configures the IP address
for every host on a network, thus assuring that each host has a
valid unique IP address.
DHCP even automatically reconfigures
IP addresses as
host s come & go. As we can imagine, DHCP can
save a network administrator many hours of tedious configuration
DHCP allows individual computers
on a TCP/IP network to
obtain their configuration information
in particular, their IP
from a server.
DHCP server keeps track of which
IP addresses are already assigned so that when a
IP address, the DHCP server offers it a
n IP address
that’s not already in use.
CONFIGURATION INFORMATION PROVIDED BY
Although the primary job of DHCP is to dole out IP address
and subnet masks, DHCP actually provides more configuration
information just than the IP address to its clients.
additional configuration information is DHCP options
following is a list of some common DHCP options that can be
configured by the server:
The router address, also known as the Default Gateway
The expiration time for the configuration info
Domain name server (DNS) server address
Windows internet name service (WINS) server address
A DHCP server can be a server computer located on the
IP network. All modern server operating system
server. To set up DHCP on a network server, all
we have to do is enable the server’s DHCP function & configurate
A server computer running DHCP does not have to be devoted
entirely to DHCP unless the network is very large. For most
a file server can share duty as a DHCP server. This is
especially true if you provide long leases for your IP addresses.
Many multi function routers also have built in DHCP servers. If
we don’t want to burden one of our network servers with the
tions, we can enable the routers built in DHCP
server. An advantage of allowing the router on your network’s
DHCP server is that you rarely need to power down a router. In
contrast, we occasionally need to restart or power down a file
server to perform
system maintenance, apply up grades, or
perform trouble shooting.
Most networks require only one DHCP server. Setting up two or
more servers on the same networks requires that are
coordinate the IP address ranges (known as scopes)
ch server is responsible. If we accidentally set up two DHCP
servers for the same scope, we may end up with a duplicate
assignment if the server attempts to assign the same IP address to
two different hosts. To prevent this from happening, just set up
DHCP server unless your network is so large that one server
can’t handle the work load.
How DHCP actually works
We can configure & use DHCP without knowing the details of
how DHCP clients configuration actually works.
However, a basic
understanding of the process can help us to understand what
DHCP is actually doing. This understanding is not only
enlightening, but it can also help when we are trouble shooting
The following paragraphs contain a blow
blow account of how
DHCP configurates TCP/IP hosts. This procedure happens
every time you boot up a host computer. It also happens when
you release an IP lease and request a fresh lease.
When a host computer starts up, the DHCP client
software sends a spe
roadcast packet, known as
This message uses the subnet’s broadcast address as the
destination address and 0
0 as the source address.
The client has to specify 0
0 as the source address
because it doesn’t yet haven IP address, and it specifies the
broadcast address as the destination address because it
doesn’t know the address of any DHCP servers. In effect,
the DHCP Discover message is saying, “Hey ! I am new
. Are there any DHCP servers out there?”
The DHCP server receives
message & responds by sending
DHCP Offer message.
The DHCP offer message includes an IP address that the
client can use.
Like the DHCP Discover message, the D
message is sent to the broadcast address. This makes sense
because the client to which the message is being sent
doesn’t yet have an IP address & won’t have one until it
accepts the offer. In effect, the DHCP Offer message is
saying, “hello there
, whoever you are.
Here’s an IP address
you can use, if you want it. Let me know.
The client receives the DHCP Offer message & sends
back a message known as a
At this point, the client does not actually own the IP
simply indicating that it’s ready to accept the
IP address that was offered by the server. In effect, the
DHCP Request message says, “Yes, that IP address would
be good for me. Can I have it, please?”
When the server receives
the DHCP request message, it
marks the IP address as assigned to the client and
DHCP Ack message.
The DHCP Ack message says, in effect,
, it’s all
yours. Here’s the rest of the information you need to use
When the client receives the DHCP Ack message, it
configures its TCP/IP stack by using the address it
accepted from the server.
A scope is simply an IP address that a DHCP server is
configured to distribute. In the simplest case, when a single
DHCP server overseas an IP
configuration for an entire
subnet, the scope corresponds to the subnet. However, if we
set up two DHCP servers for a subnet, we can configure each
with a scope that allocates only one part of the complete
range. In addition, a single DHCP server can serve
than one scope.
We must create a scope before we can enable a DHCP
server. When we create a scope, we can provide it with
the following properties:
, which helps us to identify the scope & its
, which lets us
to provide additional
details about the scope & its purpose
starting IP address
for the scope
ending IP address
for the scope
for the scope
We can specify the subnet mask with dotted
notation or with classless interdomain routing
One or more reserved address
these are always be
assigned to particular host devices
One or more ranges of excluded address
, these are
won’t be assigned to clients
which indicates how long the host
will be allowed to use the IP address
for the subnet
& the IP address
of the network’s
akp ser癥rs C tfkp ser癥rs
Everyone feels excluded once in a while. Sometimes,
being excluded is a good thing. In the case of DHCP scopes,
exclusions can help you to prevent IP address conflicts & can
enable us to divide the DHCP workload for a single subnet
among two or more DHCP servers.
is a range of addresses
that are not included in the
scope. The exclusion range falls within the range of the scope’s
starting or ending address
es. In effect, the exclusion range lets you
punch a hole within the scope. The IP address that fall within the
hole won’t be assigned.
Here a few reasons for excluding IP address from a scope
The computer that runs the DHCP service itself must be
usually having a static IP address
As a result, the
address of the DHCP server should be listed as exclusion.
Some hosts may not be
able to support DHCP
In that case,
the host will require a static IP
In some cases, we may want to assign a particular IP address
to a particular host. One way to do this is to configure the
host with the static IP addres
s so that the host doesn’t use
DHCP to obtain its IP configuration. However, here are two
major disadvantages to its approach:
IP configuration supplies more than just the IP
You must remember to exclude the static IP address
from the DHCP server’s scope.
A better way to assign a fixed IP address to a particular host
is to create a DHCP reservation.
indicates that whenever a particular host requests
address from the DHCP server, the server should provide it
the address that you specify in the reservation. The host
won’t receive the IP address until the host requests it from
the DHCP server, but whenever the host does request IP
t will always receive the same address.
To create a reservation, you associate the IP address that
you want assigned to the host with the host’s MAC address.
As a result, you need to get the MAC address from the host
before you create the reservation. You
can get the
reservation by running the command ipconfig /all from a
command prompt (if that fails because TCP/IP has not yet
been configured on the computer, yo
u can also get the MAC
the number that uniquely
identifies the hardware
by running the system information command, which
set up more than one DHCP server, each should be
configured to serve a different range of IP address.
Otherwise, the servers might assign the same address to two
HOW LONG TO LEASE?
One of the most important
that you will make
when you configure a DHCP server is the length of time to
specify for the lease duration. The default value is
which is appropriate in many cases. However you may
encounter situations in which a longer
r shorter interval
The more stable your network,
the longer the lease
duration can safely exist.
The more volatile the network,
shorter the lease
duration should be.
Don’t configure your network to allow infinite duration
el that this cuts down the
workload for the DHCP server on stable networks.
no network is
WORKING WITH A DHCP SERVER
The exact step that you should follow when configuring and
managing a DHCP server depend on the network operat
you’re using. The following procedures show
you how to work with a DHCP server in Windows Server
2008. The procedures for other operating system are
Installing and configuration a DHCP server
To install the DHCP server
role on Windows Server 2008,
follow these steps:
The Manage Your Server application appears.
Click the roles link and then click Add a Role.
The Add Roles Wizard appears.
Click Next to get the wiz
The wizard displays a list of available server roles.
Select DHCP Server from the list of roles and then click
The wizard displays an explanation of DHCP.
The wizard displays a list of the server’s network
that have static IP addresses.
Select the static IP addresses you want to use for the DHCP
server. Then click next.
The wizard asks for the DNS configuration information.
Enter the domain name and DNS servers. To enter a DNS
server, type its address in
the IP address text box and then
You typically have more
than one DNS server.
The wizard next asks for the WINS configuration
(Optional) if you want to enable WINS, enter the WINS
server configuration and then cli
If you don’t want to use WINS, skip
and just click
To create a new scope, click the Add Scope button.
The wizard asks for a name and description
for the new
Enter the information the new scope.
You must enter the
The name can anything you want. I
suggest that you use a generic name such as
your company name unless you’re creating two or more
scopes. Then the names should indicate the function
f each scope.
Starting IP Address:
This is the lowest IP
address that will be issued for
Scope Ending IP Address:
This is the highest IP
address that will be issued for this scope.
This is the subnet mask issued for IP
addresses in this scope
This is the default gateway address
that will be used for this scope.
Choose Wired or W
difference is how long the IP Address will be valid.
Select the Active This Scope option and then Click
If you want to create additional scopes, repeat step 10
You can create as many scopes as you want for your DHP
When you finish creating scopes, click Next.
The wizard ask whether you want to enable stateless mo
The wizard asks for the credentials to use when creating this
DHCP server. The default is to use your current login
The wizard displays a confirmation screen that summarizes
the settings you’ve entered for the DHCP server.
The DHCP server is created. This might
take a few minutes. When the server is finished, a final
page is displayed to confirm that the server was
Managing a DHCP server
ou can bring up the DHCP management console by
DHCP or by
clicking Manage This DHCP Server from the Manage Your
Server application. Either way, the DHCP management
From the DHCP console, you have co
mplete control over
the DHCP server’s configuration& operation.
list summarizes some of the things that you can do from the
You can authorize the DHCP server,
which allows it to
begin assigning client
P addresses. To authorize a
server, select the server, choose Action
Authorized servers, and then click Authorize.
To add another scope,
click in the
choose the New Scope command from the menu that
appears. This brings up New Scop
To activate or deactivate a scope,
click the tree
and then choose the active or deactivate command.
To change scope settings,
click the scope and
command. This brin
s up t
Scope Properties dialog box. From thi
s dialog box, you
can change the scope’s start and end IP address, subnet
mask and DNS configuration.
To change the scope exclusions,
under the scope in
the tree. This lists each rage of
addresses that’s included in the scope. You can
delete a range
range and choosing
command from the menu that appears. You
so add a new
ange by right
Address Pool in the tree and
Exclusion from the
To view or change reservations,
click Reservations in
To view a list of assigned addresses,
Leases in the tree.
HOW TO CONFIGURE A WINDOWS DHCP CLIENT
Configuring a windows client for DHCP is easy. The
client is automatically
included when we install
the TCP/IP protocol, so all we have to do is configure
DHCP. To do this, bring up the
network properties dialog box
by choosing network or
network communications in the protocol panel
g on which version of windows the client is
running). Then select the TCP/IP protocol & click the
properties button. To configure the computer to use
DHCP, select the Obtain an IP address automatically
option & Obtain DNS server address automatically
AUTOMATIC PRIVATE IP ADDRESSING
If a windows computer is configured to use DHCP but
the computer can’t obtain an IP address from a DHCP
server, the computer automatically assigns itself a
private address by using a feature called Automatic
Private IP Addressing (APIPA). APIPA
address from the
254 . x . x
range and uses a
special algorithm to ensure that the address is unique
on the network. As soon as the DHCP server becomes
available, the computer requests a new address, so the
APIPA address is used only while the DH
CP server is
RENEWING AND RELESING LEASES
Normally, a DHCP client attempts to renew its lease
when the lease is halfway to the point of being
You can renew a lease sooner by issuing the ipconfig /
renew command at a command prompt.
You may want
to do this if you changed the scope’s configuration or if
the client’s IP configuration is not working correctly.
We can also release a DHCP lease by using the
command at a command prompt.
When we release a lease, the clien
t computer no longer
has a valid IP address. This is shown in the output
Windows IP Configuration
Ethernet adapter Local Area Connection:
specific DNS Suffix . :
IP Address . . .
. . . . . . . . . : 0
Subnet Mask . . . . . . . . . . . : 0
Default Gateway . . . . . . . . . :
Here, we can see that the IP Address & subnet masks
are set to 0
0 & that the Default
address is blank. When we release an IP lease, we can’t
communicate with the network by using TCP/IP until
we issue an
command to renew the IP
configuration or restart the computer.