Cisco – How to configure an IOS DHCP server
Posted by Josh on Tue 27 Nov 2007Categories: Cisco , Cisco Routers , Cisco VOIP - [10] Comments
This tutorial will guide you through configuring a dhcp server on your router. There are many reasons to have a dhcp server on a cisco router. Here are a couple examples … your small office may not have a server to hand out ip addresses via dhcp or the branch may have IP Telephony and it is best to hand our addresses locally than on a centralized server across the wan.

Here is a short list of the configuration:
router#config t
router(config)#
router(config)#ip dhcp excluded-address 10.10.1.1 – 10.10.1.99
router(config)#ip dhcp excluded-address 10.10.1.200 – 10.10.1.254
router(config)#
router(config)#ip dhcp pool LAN
router(dhcp-config)#network 10.10.1.0 255.255.255.0
router(dhcp-config)#default-router 10.10.1.1
router(dhcp-config)#dns-server 4.2.2.2 4.2.2.1
router(dhcp-config)#domain-name blindhog.net
router(dhcp-config)#option 150 ip 10.10.1.1
router(dhcp-config)#
router(dhcp-config)#exit
router(config)#
router(config)#interface f0/0
router(config-if)#ip address 10.10.1.1 255.255.255.0
router(config-if)#
router(config-if)#end
router#
router#copy run start
November 27th, 2007 at 10:17 pm
Another great tutorial as usual. IOS DHCP is a great solution for a branch office. DHCP over the WAN? Mmm. Anyway, how about a multiple VLAN branch office network. One VLAN for workstations and VoIP phones, and another for the telephony server(s)? This configuration assumes a manageable L3 switch, but these types of switches are getting cheaper by the minute. At least the non-Cisco switches. It may also require the use of sub-interfaces on the internal Ethernet interface.
November 27th, 2007 at 10:58 pm
Hi Josh,
Enabled DHCP server on top of the NAT example that you had published. The loopback inteface is able to get a dynamic IP from the router.
Thanks for the tutorial.
Deepak
November 27th, 2007 at 11:18 pm
DHCP over the wan is accomplished with the ‘ip helper-address x.x.x.x’ command. It basically forwards dhcp requests to a remote dhcp server.
Yes, you could have multiple vlans with a different dhcp pool on the router for each.
December 19th, 2007 at 9:35 am
Great post. I recently documented a similar situation, but for use with Avaya phones. You can find the information at:
http://www.techsneeze.com/use-cisco-ios-switch-serve-dhcp-avaya-phones
I’ll be watching for more of your posts!
April 12th, 2008 at 2:49 am
well
April 29th, 2008 at 10:17 am
is this can be used for avaya, avaya uses option 150 , had anyone issue something alike ?
Regards
April 29th, 2008 at 8:23 pm
Omar,
The option 150 is a standard tftp option, but some systems also use option 66.
Josh
June 19th, 2008 at 9:21 am
Is there a way to exclude the DHCP address for an MPLS VPN customer on PE router?
Like if the customer expect let;s say “69.10.1.1″ for an interface is there a way to always assign that particular address to the customer under his VRF instance. I tired to configrue the “host” command but it is not suppoorted for MPLS VPN.
June 24th, 2008 at 8:22 am
@Saud,
You might try this link.
http://blog.ioshints.info/2007/09/assigning-server-ip-addresses-with-dhcp.html
Josh
December 31st, 2009 at 9:26 am
there is no “-” mark in range of ip line “ip dhcp excluded-address 10.10.1.1 – (!!!) 10.10.1.99″