How to configure DHCP Server on Cisco IOS

Cisco IOS routers and layer 3 switches can be configured as DHCP server. It’s quite easy to do this and in this short lesson I want to explain to you how to do this and how to verify your configuration. If you are a little fuzzy how DHCP works, take a look at my introduction to DHCP first.

Let’s use the following topology:

dhcp server example

Above we have a router that I will call ‘DHCP’. The router and computer are connected to each other using a simple switch and in the same VLAN. We will use the /24 subnet for this demonstration. Let’s prepare the interface first:

DHCP(config)#interface fastEthernet 0/0
DHCP(config-if)#no shutdown
DHCP(config-if)#ip address

Now let’s configure DHCP server:

DHCP(config)#ip dhcp pool MYPOOL

Use the ip dhcp pool command to create a DHCP pool and give it a name. This DHCP pool will use network /24. Basically this is all you have to do to get DHCP server going, there is no need to start a service or something. We can verify that we have DHCP clients using the following command:

DHCP#show ip dhcp binding 
Bindings from all pools not associated with VRF:
IP address          Client-ID/	 	    Lease expiration        Type
		    Hardware address/
		    User name      0063.6973.636f.2d63.    Mar 02 2002 12:24 AM    Automatic

Above you can see that we have a DHCP client and it received IP address In production networks we will also use DHCP to hand out some other useful things like a default gateway, DNS server and more. Let’s see how we can do this:

DHCP(config)#ip dhcp pool MYPOOL               

Above I configured IP address as the default gateway for the DHCP clients with the default-router command. The dns-server commands lets us specify a DNS server.

Something else you might want to do is exclude a number of IP addresses. With the configuration so far our DHCP server will hand out IP address .2,3,4,5,6 etc. Here’s how to do it:

We're Sorry, Full Content Access is for Members Only...

If you like to keep on reading, Become a Member Now! Here is why:

  • Learn any CCNA, CCNP and CCIE R&S Topic. Explained As Simple As Possible.
  • Try for Just $1. The Best Dollar You’ve Ever Spent on Your Cisco Career!
  • Full Access to our 739 Lessons. More Lessons Added Every Week!
  • Content created by Rene Molenaar (CCIE #41726)

542 Sign Ups in the last 30 days

100% Satisfaction Guaranteed!
You may cancel your monthly membership at any time.
No Questions Asked!

Tags: ,

Forum Replies

  1. thank ypu but i wanna to know ARE the messages (discover,offer,request and ack) still broadcast messages or change ?

  2. Hi Hussein,

    That’s right, the subnet, DNS server, gateway and options are all configured under the pool.

    The only exception are the excluded IP addresses, this is done in global mode:

    R1(config)#ip dhcp excluded-address


  3. Hi Hussein,

    When you have two DHCP servers in the same subnet then the host will receive an IP address from whoever answers first. This can be dangerous btw, take a look here:

    The 2950 or 2960 switches support DHCP server I believe but I would probably not use them for this as you can configure only one IP address on them (for management).


  4. Hi Rene

    How about reserving certain IP addresses and having the Dhcp allocate them automatically to specific hosts on the LAN



32 more replies! Ask a question or join the discussion by visiting our Community Forum