Sei sulla pagina 1di 18

CCNA 200-120

Cisco certification training


Instructor:- ASHOK TAMBE

Contact us :- 9930157345 ashok tambe

Training for
CCNA,CCNP,
CCNA SECURITY
CCIP,
MPLS, BGP, IPV6
NETWORK+, SEURITY+

Cisco certification training


Instructor:- ASHOK TAMBE

https://www.facebook.com/Networkingwanschool

Copyright 2015 NETworkingWANschool

CCNA 200-120

Configure and verify DHCP (IOS Router)

Instructor:- ASHOK TAMBE

Copyright 2015 NETworkingWANschool

What is DHCP?
Every device that connects to a network needs an IP address. Network administrators assign static
IP addresses to routers, servers, and other network devices whose locations (physical and logical)
are not likely to change. Administrators enter static IP addresses manually when they configure
devices to join the network. Static addresses also enable administrators to manage those devices
remotely.
However, computers in an organization often change locations, physically and logically.
Administrators are unable to keep up with having to assign new IP addresses every time an
employee moves to a different office or cubicle. Desktop clients do not require a static address.
Instead, a workstation can use any address within a range of addresses. This range is typically within
an IP subnet. A workstation within a specific subnet can be assigned any address within a specified
range. Other items such as the subnet mask, default gateway, and Domain Name System (DNS)
server are assigned a value which is common either to that subnet or entire administrated network.
For example, all hosts within the same subnet will receive different host IP addresses, but will
receive the same subnet mask and default gateway IP address."

DHCP makes the process of assigning new IP addresses almost transparent. DHCP assigns IP
addresses and other important network configuration information dynamically. Because
desktop clients typically make up the bulk of network nodes, DHCP is an extremely useful and
timesaving tool for network administrators.

DHCP Operation

Providing IP addresses to clients is the most fundamental task performed by a DHCP


server. DHCP includes three different address allocation mechanisms to provide flexibility
when assigning IP addresses:
Manual Allocation: The administrator assigns a pre-allocated IP address to the client and
DHCP only communicates the IP address to the device.
Automatic Allocation: DHCP automatically assigns a static IP address permanently to a
device, selecting it from a pool of available addresses. There is no lease and the address is
permanently assigned to a device.
Dynamic Allocation: DHCP automatically dynamically assigns, or leases, an IP address from
a pool of addresses for a limited period of time chosen by the server, or until the client
tells the DHCP server that it no longer needs the address.

This section focuses on dynamic allocation.


DHCP works in a client/server mode and operates like any other client/server
relationship.
When a PC connects to a DHCP server, the server assigns or leases an IP address
to that PC.
The PC connects to the network with that leased IP address until the lease
expires. The host must contact the DHCP server periodically to extend the lease.
This lease mechanism ensures that hosts that move or power off do not hold
onto addresses that they do not need.
The DHCP server returns these addresses to the address pool and reallocates
them as necessary.

The DHCP process to lease an IP address uses the following four messages between
the client and server. (Also, as a way to help remember the messages, note that the
first letters spell DORA):
Discover: Sent by the DHCP client to find a willing DHCP server
Offer: Sent by a DHCP server to offer to lease to that client a
specific IP address (and inform the client of its other parameters)
Request: Sent by the DHCP client to ask the server to lease the
IPv4 address listed in the Offer message
Acknowledgment: Sent by the DHCP Server to assign the
address, and to list the mask, default router, and DNS server IP
addresses

DHCP clients, however, have a somewhat unique problem: they do not have an IP
address yet, but they need to send IP packets. To make that work, DHCP messages
make use of two special IPv4 addresses that allow a host that has no IP address still
be able to send and receive messages on the local subnet:
0.0.0.0: An address reserved for use as a source IPv4 address for hosts that do not
yet have an IP address.
255.255.255.255: The address reserved as a local subnet broadcast address.
Packets sent to this destination address are broadcast on the local data link, but
routers do not forward them to other subnets.

When
the
orreceives
otherwise
wants
to
join
amessage,
network,
completes
four steps
in
theclient
client
receives
the
DHCPOFFER
from
the
server,
it sends
back
aan
DHCPREQUEST
When
the
DHCP
server
amessage,
DHCDISCOVER
ititthe
finds
available
IP message.
address
to
OnWhen
receiving
theboots
DHCPREQUEST
the
server
verifies
lease
information,
creates
This message
hasARP
two
purposes:
lease
and lease
and
verification.
When
used
obtaining
a lease.
In
the
first
step,
theorigination
client
broadcasts
DHCPDISCOVER
message.
The
lease,
creates
an
entry
consisting
of the
MAC
address
of the
requesting
host
and
thefor
a new
ARP
entry
for
the
client
lease,
and
replies
with
a arenewal
unicast
DHCPACK
message.
The
lease origination,
the
DHCPREQUEST
ofservers
the client
requesting
thatBecause
the IP message.
information
be verified
justIP
DHCPDISCOVER
message
finds DHCP
onisthe
network.
theinhost
has
no valid
leased
IP address,
and
transmits
aofbinding
offer
with
a DHCPOFFER
The
DHCPOFFER
DHCPACK
message
is
a
duplicate
the
DHCPOFFER,
except
for
a
change
the
message
after it has at
been
assigned.
The message
provides
erroraddresses
checking toto
ensure
that the assignment
still
information
bootup,
it uses
L2 and
L3
broadcast
communicate
with address
the isserver.
message
isWhen
sent
asthe
a unicast,
using
the
L2
MAC address
of the
server
asconfiguration
the source
and
type
field.
client
receives
the
DHCPACK
message,
it
logs
the
valid. The DHCPREQUEST also serves as a binding acceptance notice to the selected server and an
the
L2 address
the
asARP
the lookup
destination.
information
andof
theprovided
assigned
If it does
implicit
decline
toperforms
any client
otheran
servers
that
mayfor
have
theaddress.
host a binding
offer.not receive a
reply, it knows that the IP address is valid and starts using it as its own.

DHCP Message Format

DHCP Discovery and Offer Methods

Supporting DHCP for Remote Subnets with DHCP Relay

The DHCP messages work well, as shown in the figure, when the DHCP client and
server sit in the same subnet. Once the four messages are complete, the DHCP client
has an IP address, plus its other IPv4 settings, and it can send unicast IP packets as
normal.
Network engineers have a major design choice to make with DHCP: Do they put a
DHCP server in every LAN subnet, or locate a DHCP server in a central site? With a
DHCP server in every subnet, is not scalable solution .
However, with a centralized DHCP server, many DHCP clients sit in a different
subnet than the DHCP server. So far in this section, it appears that the DHCP
message would never reach the DHCP server, because routers do not route
(forward) IPv4 packets sent to destination IP address 255.255.255.255. by default
router discard broadcast messages so DHCP relay work here

Many enterprise networks use a couple of DHCP servers at a centralized site, supporting
DHCP services to all remote subnets. The routers need to somehow forward those DHCP
messages between clients and the DHCP server. To make that work, the routers connected
to the remote LAN subnets need an interface subcommand: the ip helper-address server-ip
command.
The ip helper-address server-ip subcommand tells the router to do the following for the
messages coming in an interface, from a DHCP client:
1. Watch for incoming DHCP messages, with destination IP address 255.255.255.255.
2. Change that packets source IP address to the routers incoming interface IP address.
3. Change that packets destination IP address to the address of the DHCP server (as
configured in the ip helper-address command).
4. Route the packet to the DHCP server.

Configuring a DHCP Server


The Cisco IOS DHCP server configuration steps are as follows:

Step 1. Exclude addresses from being assigned by DHCP: ip dhcp excluded-address first last
Step 2. Create a DHCP pool and go to pool configuration mode: ip dhcp pool name
A. Define subnet that the DHCP server should support: network subnet-ID mask or
network subnet-ID prefix-length
B. Define default router IP address(es) in that subnet: default-router address1
address2...
C. Define list of DNS server IP addresses: dns-server address1 address2...
D. Define length of lease, in days, hours, and minutes: lease days hours minutes
E. Define the DNS domain name: domain-name name

Router R1 has been configured with the following commands:

ip dhcp excluded-address 192.168.10.1


192.168.10.9
ip dhcp excluded-address 192.168.10.254
ip dhcp pool LAN-POOL-1
network 192.168.10.0 255.255.255.0
default-router 192.168.10.1
domain-name span.com

ip dhcp excluded-address 192.168.11.1


192.168.11.9
ip dhcp excluded-address 192.168.11.254
ip dhcp pool LAN-POOL-2
network 192.168.11.0 255.255.255.0
default-router 192.168.11.1
domain-name span.com

Verifying DHCP

DHCP relay configuration

The end

Potrebbero piacerti anche