Vous êtes sur la page 1sur 3

https://learningnetwork.cisco.

com/community/connections/china

CCNA Study Group on DHCP


Authored by Mark Ng August 2010

DHCP
DHCP stands for Dynamic Host Configuration Protocol and is a popular protocol
for administrators to assign IP addresses to hosts on a network. The two entities
involved in the process are the DHCP client and the DHCP server. The most
common scenario is for a DHCP client (for example, a PC) on a subnet to
automatically lease an address from the DHCP server (for example, a Cisco router)
for a period of time. The address will remain assigned until the DHCP client
releases it or renews it after the lease has expired. Optionally, the DHCP server
can be configured to assign particular IP addresses to individual DHCP clients,
depending on administrative configuration.

Address allocation process


The communication between the DHCP client and DHCP server involves the
DHCPDISCOVER, DHCPOFFER, DHCPREQUEST and DHCPACK messages and it looks
like the following:

Copyright @ 2010 Cisco Systems Inc. All rights reserved.


This doc is for reference only. Please refer to the exam authority for details. If you want to repost this
document, please properly reference the author and the source website
https://learningnetwork.cisco.com/community/connections/china

https://learningnetwork.cisco.com/community/connections/china

DHCP Server

DHCP Client
DHCPDISCOVER broadcast on

DHCPOFFER with configuration

DHCPREQUEST (accept offer)

DHCPACK acknowledges the acceptance

DHCP configuration
The DHCP server can be configured to send out information pertaining to the
subnet. This includes in addition to the assigned IP address, the lease information
(including lease time and renew time), the DNS, default gateway, or in some
cases, WINS server information.
The following example shows the configuration on a Cisco IOS router:
dhcprouter(config)#ip dhcp pool dhcppool
dhcprouter(dhcp-config)#network 192.168.58.0 255.255.255.0
dhcprouter(dhcp-config)#default-router 192.168.58.1
dhcprouter(dhcp-config)#dns-server 192.168.58.2

Copyright @ 2010 Cisco Systems Inc. All rights reserved.


This doc is for reference only. Please refer to the exam authority for details. If you want to repost this
document, please properly reference the author and the source website
https://learningnetwork.cisco.com/community/connections/china

https://learningnetwork.cisco.com/community/connections/china
In this example, DHCP is setup for network 192.168.58.0/24. It tells the DHCP
clients that the default router for this subnet is 192.168.58.1. It also specifies that
the DHCP client can use 192.168.58.2 to resolve names.
It is also possible to exclude a certain range of addresses from being assigned. For
example if in our case, we want to exclude addresses from 192.168.58.1 to
192.168.58.4, it can be configured like this:
dhcprouter(config)#ip dhcp excluded-address 192.168.58.1
192.168.58.4

The show command shows the current status of the DHCP server
dhcprouter#show dhcp server
DHCP server: ANY (255.255.255.255)
Leases:

Offers:

Declines: 0

Requests: 8

Acks: 8

Releases: 32

Bad:

Naks: 0
0

Copyright @ 2010 Cisco Systems Inc. All rights reserved.


This doc is for reference only. Please refer to the exam authority for details. If you want to repost this
document, please properly reference the author and the source website
https://learningnetwork.cisco.com/community/connections/china