DHCPx - ZENEXER

divisionimpossibleΔίκτυα και Επικοινωνίες

24 Οκτ 2013 (πριν από 3 χρόνια και 7 μήνες)

111 εμφανίσεις


























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
address that’s
both within the correct range of addresses for the
sub net & but not already in use. Although you can manually
assign IP

address to each computer of your network, that task
quickly becomes over whelming if the network has more than a
few computers.


That’s

where
DHCP (Dynamic

Host Configuration
Protocol)
-

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
work.


UNDERSTANDING DHCP

DHCP allows individual computers

on a TCP/IP network to
obtain their configuration information

in particular, their IP
address

from a server.
The

DHCP server keeps track of which


IP addresses are already assigned so that when a
compute
requests
an

IP address, the DHCP server offers it a
n IP address
that’s not already in use.


CONFIGURATION INFORMATION PROVIDED BY
DHCP

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.
The
additional configuration information is DHCP options
.the
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
Address



The expiration time for the configuration info
rmation



Domain name



Domain name server (DNS) server address



Windows internet name service (WINS) server address



DHCP servers

A DHCP server can be a server computer located on the
TCP
\
IP network. All modern server operating system
s, h
ave a
built in
DHCP
server. To set up DHCP on a network server, all


we have to do is enable the server’s DHCP function & configurate
its settings.


A server computer running DHCP does not have to be devoted
entirely to DHCP unless the network is very large. For most
networks,

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
DHCP
func
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
carefully

coordinate the IP address ranges (known as scopes)
for which
ea
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
one
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
DHCP problems.


The following paragraphs contain a blow
-

by
-
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.

1.

When a host computer starts up, the DHCP client
software sends a spe
cial b
roadcast packet, known as
DHCP D
iscover message
.



This message uses the subnet’s broadcast address as the
destination address and 0

.

0

.

0

.

0 as the source address.


The client has to specify 0

.

0

.

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
here
. Are there any DHCP servers out there?”


2.

The DHCP server receives
the broadcast

DHCP discover
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
HCP offer
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.




3.

The client receives the DHCP Offer message & sends
back a message known as a
DHCP

Request message.


At this point, the client does not actually own the IP
address: it’s
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?”




4.

When the server receives

the DHCP request message, it
marks the IP address as assigned to the client and
broadcast a
DHCP Ack message.


The DHCP Ack message says, in effect,
“Okay
, it’s all
yours. Here’s the rest of the information you need to use
it. ”


5.

When the client receives the DHCP Ack message, it
configures its TCP/IP stack by using the address it
accepted from the server.



UNDERSTANDING SCOPES

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

more
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:




A
scope name
, which helps us to identify the scope & its
purpose



A
scope description
, which lets us
to provide additional
details about the scope & its purpose



A
starting IP address

for the scope



A
ending IP address

for the scope



A
subnet mask

for the scope

We can specify the subnet mask with dotted
-
decimal
notation or with classless interdomain routing
(CIDR)
notation



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



The

lease duration
,

which indicates how long the host
will be allowed to use the IP address



The
router address

for the subnet



The

domain name

& the IP address
of the network’s
akp ser癥rs C tfkp ser癥rs


cbbifkd bu䍌啄䕄?




Everyone feels excluded once in a while. Sometimes,
however,
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.


Exclusion

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

assignment
.

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

a
ddress
.


RESERVATIONS SUGGESTED


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:




TCP
\
IP configuration supplies more than just the IP
address
.



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.

A
reservation
simply
indicates that whenever a particular host requests

an IP
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
configuration, i
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
address [
the number that uniquely

identifies the hardware
device]

by running the system information command, which


is start

all programs

accessories


system tools


system
information
)
.

If you

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
different hosts.

HOW LONG TO LEASE?

One of the most important
decisions

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
eight days
which is appropriate in many cases. However you may
encounter situations in which a longer

o
r shorter interval
may

be appropriate:



The more stable your network,
the longer the lease
duration can safely exist.



The more volatile the network,
the
shorter the lease
duration should be.

Don’t configure your network to allow infinite duration
leases. Some
administrations fe
el that this cuts down the
workload for the DHCP server on stable networks.
However
,
no network is

permanently stable.

WORKING WITH A DHCP SERVER

The exact step that you should follow when configuring and
managing a DHCP server depend on the network operat
ing


system that
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
similar.

Installing and configuration a DHCP server

To install the DHCP server
role on Windows Server 2008,
follow these steps:

1.

Choose Start


Administrative Tools
?
?\

Server Manager.

The Manage Your Server application appears.

2.

Click the roles link and then click Add a Role.


The Add Roles Wizard appears.

3.

Click Next to get the wiz
ard started.

The wizard displays a list of available server roles.

4.

Select DHCP Server from the list of roles and then click
Next.



The wizard displays an explanation of DHCP.


5.

Click Next.




The wizard displays a list of the server’s network
connections
that have static IP addresses.




6.

Select the static IP addresses you want to use for the DHCP
server. Then click next.



The wizard asks for the DNS configuration information.


7.

Enter the domain name and DNS servers. To enter a DNS
server, type its address in

the IP address text box and then
click Add.


You typically have more
than one DNS server.


8.

Click Next.



The wizard next asks for the WINS configuration
information.


9.

(Optional) if you want to enable WINS, enter the WINS
server configuration and then cli
ck Next.


If you don’t want to use WINS, skip
this step

and just click
Next.

10.

To create a new scope, click the Add Scope button.



The wizard asks for a name and description
for the new
scope.


11.

Enter the information the new scope.




You must enter the
following information:



Scope Name:
The name can anything you want. I
suggest that you use a generic name such as
office

or
your company name unless you’re creating two or more
scopes. Then the names should indicate the function
o
f each scope.



Scope
Starting IP Address:

This is the lowest IP
address that will be issued for
this scope.



Scope Ending IP Address:

This is the highest IP
address that will be issued for this scope.



Subnet Mask:

This is the subnet mask issued for IP
addresses in this scope
.



Default Gateway:

This is the default gateway address
that will be used for this scope.



Subnet type:

Choose Wired or W
ir
e
less
. The
difference is how long the IP Address will be valid.



12.

Select the Active This Scope option and then Click
Next.


The scope
is created.


13.

If you want to create additional scopes, repeat step 10
-
12.


You can create as many scopes as you want for your DHP
server.





14.

When you finish creating scopes, click Next.



The wizard ask whether you want to enable stateless mo
de.


15.

Click Next.



The wizard asks for the credentials to use when creating this
DHCP server. The default is to use your current login
credentials.


16.

Click Next.


The wizard displays a confirmation screen that summarizes
the settings you’ve entered for the DHCP server.

17.

Click Install.

The DHCP server is created. This might
take a few minutes. When the server is finished, a final
results
page is displayed to confirm that the server was
properly installed.


18.

Click Close.



You’re done!

Managing a DHCP server

Y
ou can bring up the DHCP management console by
choosing Start


Administrative Tools


DHCP or by
clicking Manage This DHCP Server from the Manage Your


Server application. Either way, the DHCP management
console appears.


From the DHCP console, you have co
mplete control over
the DHCP server’s configuration& operation.

The following
list summarizes some of the things that you can do from the
DHCP console:




You can authorize the DHCP server,

which allows it to
begin assigning client
I
P addresses. To authorize a
server, select the server, choose Action


Managed
Authorized servers, and then click Authorize.



To add another scope,

right
-
click in the
tree and
choose the New Scope command from the menu that
appears. This brings up New Scop
e Wizard.



To activate or deactivate a scope,

right
-
click the tree
and then choose the active or deactivate command.



To change scope settings,

right
-
click the scope and
choose the
Properties

command. This brin
g
s up t
h
e

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,

clicks Address

Pool
under the scope in
the tree. This lists each rage of
addresses that’s included in the scope. You can
add or
delete a range
by right
-
clicking the

range and choosing
the Delete

command from the menu that appears. You


can a
l
so add a new
exclusion

r
ange by right
-

clicking
Address Pool in the tree and
choosing Add

New
Exclusion from the
contextual menu

that appears.



To view or change reservations,

click Reservations in
the tree.



To view a list of assigned addresses,

click Address
Leases in the tree.



HOW TO CONFIGURE A WINDOWS DHCP CLIENT


Configuring a windows client for DHCP is easy. The
DHCP
client is automatically

included when we install
the TCP/IP protocol, so all we have to do is configure
TCP/IP

to use

DHCP. To do this, bring up the
network properties dialog box
by choosing network or
network communications in the protocol panel
(dependin
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
optio
n.


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
assigns pri
vate

address from the
169.
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
unavailable.


RENEWING AND RELESING LEASES


Normally, a DHCP client attempts to renew its lease
when the lease is halfway to the point of being
expired.
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
ipconfig /release
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
from the
ipconfig /release

command:


C:
\
>ipconfig /release



Windows IP Configuration

Ethernet adapter Local Area Connection:

Connection
-
specific DNS Suffix . :

IP Address . . .

. . . . . . . . . : 0

.

0

.

0

.

0

Subnet Mask . . . . . . . . . . . : 0

.

0

.

0

.

0

Default Gateway . . . . . . . . . :


Here, we can see that the IP Address & subnet masks
are set to 0

.

0

.

0

.

0 & that the Default
Gateway
address is blank. When we release an IP lease, we can’t
communicate with the network by using TCP/IP until
we issue an
ipconfig /renew

command to renew the IP
configuration or restart the computer.






.