Вы находитесь на странице: 1из 4

HOW TO CONFIGURE DHCP SERVER ON A CISCO ROUTER

WRITTEN BY ADMINISTRATOR ON 10 SEPTEMBER 2011. POSTED IN CISCO ROUTERS - CONFIGURING CISCO ROUTERS (/CISCO-TECHNICAL-
KNOWLEDGEBASE/CISCO-ROUTERS.HTML)
DHCP (Dynamic Host Configuration Protocol) is the protocol used by network devices (such as PCs, network printers, etc) to automatically
obtain correct network parameters so they can access network and Internet resources such as IP Address, Default Gateway, Domain
Name, DNS Servers and more.
A DHCP Server is considered necessary in today's networks. Devices usally found providing this service are Windows servers, routers and
layer 3 switches.
This article describes how to configure basic DHCP parameters on a Cisco router, enabling it to act as a DHCP server for your network.

EXAMPLE SCENARIO
For the sake of this article, suppose we have the network shown in the following diagram, for which we would like to enable the DHCP
service on our Cisco router.
The router will act as a DHCP server for the 192.168.1.0/24 network. IP Addresses already assigned to our switch (192.168.1.2) and File
Server (192.168.1.5) will be excluded from the DHCP pool, to ensure they are not given out to other hosts and cause an IP address conflict.
First step is to enable the DHCP service on our router, which by default is enabled.
First step is to enable the DHCP service on our router, which by default is enabled:
(http://www.firewall.cx)
SUNDAY, 02 MARCH 2014 Home (/) Cisco (/cisco-technical-knowledgebase.html)
Cisco Routers (/cisco-technical-knowledgebase/cisco-routers.html) How To Configure DHCP Server On A Cisco Router
FIREWALL.CX TEAM
(/MEET-THE-TEAM.HTML)
NEWS
(/NEWS.HTML)
ALTERNATIVEMENU
(/SITE-MAP.HTML)
RECOMMENDED SITES
(/RECOMMENDED-SITES.HTML)
HOME
(/)
NETWORKING
(/networking-topics.html)
CISCO
(/cisco-technical-knowledgebase.html)
MICROSOFT
(/microsoft-knowledgebase.html)
LINUX
(/linux-knowledgebase-tutorials.html)
MORE CONTENT
(/general-topics-reviews.html)
DOWNLOADS
(/downloads.html)
FORUM
(/forums.html)
search...
HOT DOWNLOADS
NETWORK SECURITY
SCANNER
(HTTP://CLIXTRAC.COM/GOTO/?
99229)
WEB MONITORING &
SECURITY
(HTTP://CLIXTRAC.COM/GOTO/?
99231)
ANTISPAM & SECURITY
(HTTP://CLIXTRAC.COM/GOTO/?
99230)
Free Download
(http://twitter.com/firewallcx) (http://www.facebook.com/group.php?
gid=29042864367)
(http://www.linkedin.com/groups?
home=&gid=1037867)
CONNECT:
LANGUARD SECURITY
SCANNER
(http://clixtrac.com/goto/?
99232)
Notify me of new articles
Name
E-mail
Subscribe
RECOMMENDED
DOWNLOADS
Web Security
(http://clixtrac.com/goto/?
99233)
Server AntiSpam
(http://clixtrac.com/goto/?
99234)
Network Scanner
(http://clixtrac.com/goto/?
99235)
IDS Security Manager
(http://clixtrac.com/goto/?
99236)
Web-Proxy Monitor
(http://clixtrac.com/goto/?
99237)
FTP / TFTP Servers
(/downloads/ftp-tftp-servers-
a-clients.html)
Cisco VPN Client
Tweet Share (//gb.pinterest.com/pin/create/button/?
url=http%3A%2F%2Fwww.firewall.cx%2Fcisco-
technical-
knowledgebase%2Fcisco-
routers%2F812-
cisco-
router-
dhcp-
config.html&media=http%3A%2F%2Fwww.firewall.cx%2Fimages%2Fstories%2Ftk-
cisco-
routers-
dhcp-
1.jpg&guid=iLpKMUW7694b-
0&description=DHCP%20%28Dynamic%20Host%20Configuration%20Protocol%29%20is%20the%20protocol%20used%20by%20network%20devices%20%28such%20as%20PCs%2C%20network%20printers%2C%20etc%29%20to%20automatically...)
49 people like this. Sign Up to
see what your f riends like.
Like Share
R1# configure terminal
R1(config)# service dhcp

Next step is to create the DHCP pool that defines the network of IP addresses that will be given out to the clients. Note that 'NET-POOL' is
the name of the DHCP IP Pool we are creating:
R1(config)# ip dhcp pool NET-POOL
R1(dhcp-config)# network 192.168.1.0 255.255.255.0

This tells the router to issue IP addresses for the network 192.168.1.0, which translates to the range 192.168.1.1 - 192.168.1.254. We will
have to exclude the IP addresses we want later on.
We now define the DHCP parameters that will be given to each client. These include the default gateway (default-router), dns servers,
domain and lease period (days):
R1(dhcp-config)# default-router 192.168.1.1
R1(dhcp-config)# dns-server 192.168.1.5 195.170.0.1
R1(dhcp-config)# domain-name Firewall.cx
R1(dhcp-config)# lease 9

The 'domain-name' and 'lease' parameters are not essential and can be left out. By default, the lease time for an IP address is one day.
All we need now is to exclude the IP addresses we don't want our DHCP server giving out. Drop back to 'global configuration mode' and
enter the following:
R1(config)# ip dhcp excluded-address 192.168.1.1 192.168.1.5
R1(config)# ip dhcp excluded-address 192.168.1.10

This excludes IP addresses 192.168.1.1 - 192.168.1.5 & 192.168.1.10. As you can see, there's an option to exclude a range of IP
addresses or a specific address.
The above configuration is all you need to get the DHCP server running for your network. We'll provide a few more commands you can use
to troubleshoot and ensure it's working correctly.
The following command will allow you to check which clients have been served by the DHCP:
R1# show ip dhcp binding
Bindings from all pools not associated with VRF:
IP address Client-ID/ Lease expiration Type
Hardware address/
User name
192.168.1.6 0100.1e7a.c409 Jan 19 2009 03:06 PM Automatic
192.168.1.7 0100.1e7a.c3c1 Jan 19 2009 09:00 PM Automatic
192.168.1.8 0100.1ebe.923b Jan 19 2009 02:25 PM Automatic
192.168.1.9 0100.1b53.5ccc Jan 19 2009 02:03 PM Automatic
192.168.1.11 0100.1e7a.261d Jan 19 2009 07:52 PM Automatic
R1#
Notice that IP addresses 192.168.1.5 & 192.168.1.10 have not been assigned to the clients.

ARTICLE SUMMARY
In this article we've covered how a Cisco router can be used as a basic DHCP server and the various options available. We also saw how
you can obtain general information about the service. There are more options available with the DHCP service, however this basic article
should cover most of your network needs.
Future DHCP articles will explore advanced options and debugging for more complex networks containing VLANs and IP Telephony.
If you have found the article useful, we would really appreciate you sharing it with others by using the provided services on the top left corner
of this article. Sharing our articles takes only a minute of your time and helps Firewall.cx reach more people through such services.

ABOUT THE WRITER
Ammar Muqaddas is a CCNA certified Engineer, CCNA Instructor and member of the Firewall.cx Team.
(/downloads/cisco-tools-a-
applications.html)
Network Fax Server
(http://clixtrac.com/goto/?
100607)
CISCO MENU
CISCO ROUTERS
(/cisco-technical-
knowledgebase/cisco-
routers.html)
CISCO SWITCHES
(/cisco-technical-
knowledgebase/cisco-
switches.html)
CISCO VOIP/CCME -
CALLMANAGER
(/cisco-technical-
knowledgebase/cisco-
voice.html)
CISCO FIREWALLS
(/cisco-technical-
knowledgebase/cisco-
firewalls.html)
CISCO WIRELESS
(/cisco-technical-
knowledgebase/cisco-
wireless.html)
CISCO SERVICES &
TECHNOLOGIES
(/cisco-technical-
knowledgebase/cisco-services-
tech.html)
CISCO AUTHORS & CCIE
INTERVIEWS
(/cisco-technical-
knowledgebase/ccie-
experts.html)
CISCO PRESS REVIEW
PARTNER
(/site-news/316-firewall-
ciscopress.html)
POPULAR CISCO
ARTICLES
DMVPN Configuration (/cisco-
technical-
knowledgebase/cisco-
routers/901-cisco-router-
dmvpn-configuration.html)
Cisco IP SLA (/cisco-
technical-
knowledgebase/cisco-
routers/813-cisco-router-ipsla-
basic.html)
VLAN Security (/cisco-
technical-
knowledgebase/cisco-
switches/818-cisco-switches-
vlan-security.html)
4507R-E Installation (/cisco-
technical-
knowledgebase/cisco-
Add a comment
View 13 more
Facebook social plugin
20 comments
Russell Barker IT / Problem Solver at EMC Inc.
Thanks for making this easy to configure and it is working well now.
Reply Like 3 March 2012 at 09:45 2
Shajid Ezio Auditor Top commenter SEO & Social Media Manager at BuildResponse.com
Hey Russell Add me :)
Reply Like 12 January 2013 at 04:21
Ram Naidu Vignan Vidyalayam High School
nice job. please make the scenario when dhcp is outside the network.
Reply Like 20 April 2012 at 23:09 1
Umesh Shukla Site Engineer at IHP CO LTD
jetking
Reply Like 24 April 2012 at 22:18
Betsy Yu Northwest University (China)
good topic for people who need some networking guide.
Reply Like 25 April 2012 at 01:02 2
Theophilus Yevuyibor Accra, Ghana
thx its wonderfull.
Reply Like 22 May 2012 at 12:13 1
switches/948-cisco-switches-
4507re-ws-x45-sup7l-e-
installation.html)
CallManager Express Intro
(/cisco-technical-
knowledgebase/cisco-
voice/371-cisco-ccme-part-
1.html)
Secure CME - SRTP & TLS
(/cisco-technical-
knowledgebase/cisco-
voice/956-cisco-voice-cme-
secure-voip.html)
Cisco Password Crack (/cisco-
technical-
knowledgebase/cisco-
routers/358-cisco-type7-
password-crack.html)
Site-to-Site VPN (/cisco-
technical-
knowledgebase/cisco-
routers/867-cisco-router-site-
to-site-ipsec-vpn.html)
FREE CISCO LAB
PARTNERS
(http://clixtrac.com/goto/?
99238)
POPULAR LINUX
ARTICLES
Linux Init & RunLevels (/linux-
knowledgebase-tutorials/linux-
administration/845-linux-
administration-runlevels.html)
Linux Groups & Users (/linux-
knowledgebase-tutorials/linux-
administration/842-linux-
groups-user-accounts.html)
Linux Performance Monitoring
(/linux-knowledgebase-
tutorials/linux-
administration/837-linux-
system-resource-
monitoring.html)
Linux Vim Editor (/linux-
knowledgebase-tutorials/linux-
administration/836-linux-
vi.html)
Linux Samba (/linux-
knowledgebase-
tutorials/system-and-network-
services/848-linux-services-
samba.html)
Linux DHCP Server (/linux-
knowledgebase-
tutorials/system-and-network-
services/849-linux-services-
dhcp-server.html)
Linux Bind DNS (/general-
topics-reviews/linuxunix-
related/829-linux-bind-
introduction.html)
Linux File & Folder
Permissions (/general-topics-
reviews/linuxunix-
related/introduction-to-
linux/299-linux-file-folder-
permissions.html)
Linux OpenMosix (/general-
topics-reviews/linuxunix-
related/openmosix-linux-
supercomputer.html)
Linux Network Config (/linux-
knowledgebase-tutorials/linux-
administration/851-linux-
services-tcpip.html)
BANDWIDTH
MONITORING
(http://clixtrac.com/goto/?
99758)
CCENT/CCNA
ROUTER BASICS (/CISCO-
TECHNICAL-
KNOWLEDGEBASE/CISCO-
ROUTERS/250-CISCO-
ROUTER-BASICS.HTML)
SUBNETTING
OSI MODEL
IPPROTOCOL
CISCO ROUTERS
SSL WEBVPN
SECURING ROUTERS
POLICY BASED ROUTING
ROUTER ON-A-STICK
VPN SECURITY
UNDERSTAND DMVPN
GRE/IPSEC CONFIGURATION
SITE-TO-SITEIPSEC VPN
IPSEC MODES
CISCO HELP
VPN CLIENT WINDOWS 8
VPN CLIENT WINDOWS 7
CCPDISPLAY PROBLEM
CISCO SUPPORT APP.
WINDOWS 2012
NEW FEATURES
LICENSING
HYPER-V / VDI
INSTALL HYPER-V
LINUX
FILEPERMISSIONS
WEBMIN
GROUPS - USERS
SAMBA SETUP
FIREWALL.CX TEAM
(/MEET-THE-TEAM.HTML)
NEWS
(/NEWS.HTML)
ALTERNATIVEMENU
(/SITE-MAP.HTML)
RECOMMENDED SITES
(/RECOMMENDED-SITES.HTML)
Copyright 2000-2014 Firewall.cx - All Rights Reserved
Inf ormation and images contained on this site is copyrighted material.
Firewall.cx - Cisco Networking, VPN - IPSec, Security, Cisco Switching, Cisco Routers, Cisco VoIP- CallManager Express & UC500, Windows Server, Virtualization, Hyper-V Linux Administration