Configure Cisco router as a basic DHCP server

Using a Cisco router as a DHCP server can simplify a network configuration by cetralizing DHCP services in a large network or decentralizing DHCP services to the endpoint routers at satellite locations. The ease of remote management of Cisco-based DHCP services is a great advantage.


conf t
service dhcp
ip dhcp pool 192.168.1.0/24
network 192.168.1.0 255.255.255.0
default-router 192.168.1.1
dns-server 192.168.1.5 192.168.1.6
exit
ip dhcp excluded-address 192.168.1.1 192.168.1.199
ip dhcp excluded-address 192.168.1.241 192.168.1.255
^Z

This example shows a Cisco router configuration as a basic DHCP server in the 192.168.1.0/24 network. The DHCP options implemented are default-router (DHCP option 3) and dns-server (DHCP option 6). Two DNS servers are configured. With the excluded-address commands, using only ip addresses between 192.168.1.200-192.168.1.240 will be available for client use.

 

About Quinn McHenry

Quinn was one of the original co-founders of Tech-Recipes. He is currently crafting iOS applications as a senior developer at Small Planet Digital in Brooklyn, New York.
View more articles by Quinn McHenry

The Conversation

Follow the reactions below and share your own thoughts.

  • winelle

    where did you get the dns server?? and what ip should be use is it the lan or wan?

  • ABC

    DNS Servers are manually configured by the System admin… In the above example the DNS Servers are assigned IP from the Excluded range because DNS Servers need to be configured by Static IP’s..

  • Sridhar V

    We are getting a 4 mb internet leased line to our college. We have a cisco 2600 series router. I want to config NAT as well as DNS in the router so that the clients will be given static IP address in the local LAN side with Gate way only. WIll the router be able to resolve the DNS queries of the computers. If can please give me details how to configure the above in the router.

  • Buddie

    Is it really manadatory to configure dns server on the router along with the dhcp server.
    pls do mail me for details bfun4real@gmail.com .
    Thank u

  • Anonymous

    thanks

  • abdulelah

    how can configruation router until don’t change ip for client inside (the ip is dhcp between range)

  • Anonymous

    good one example

    • Fffff

      thanx

  • Anonymous

    good one example

  • Armin_zakarian

    almost its useful you use in your configuration :

    Specify the lease duration for the addresses you’re using from the pool.

    Router(dhcp-config)#lease 7

    ## Armin Zakarian – iran ##

    • dasoulman

      > for seven days

  • Martin DePores

    How do I disable a Cisco SR2024C DHCP SERVER on this switch? I am a novice but willing to learn

  • Jim Flerlage

    I’am new at this and not sure of a cisco 3750 swt. when plug a IP 2002 PH INTO JUST A FREE PORT i JUST GET DIAL TONE NO PROGRAM FEATURES and what program is used in the cisco router to make the phone programable. Thanks jim.

  • Faizrel1

    what purpose using for these IP range from it means without excluded ip mentioned above 192.168.1.200 192.168.1.240

    • Arutembesa

      Hi I have a Cisco router 878w , and I have a LAN, and I need to connect the router to my LAN and give it a DHCP wirless sercer setting , in case all the computers with wireless can get internet via my wireless router.

  • Gitesh

    My requirememnt is to install DHCP for providing the IP’s automatically.. is it necessary to install DNS with it ..if yes any guidelines to install it…

  • Gitesh

    My requirememnt is to install DHCP for providing the IP’s automatically.. is it necessary to install DNS with it ..if yes any guidelines to install it…

    • Christian

      The network at your end has an ianerntl or local IP every device attached to your local IP must have different IP’s. The devices attached to your local network will have an octet sequence such as 192.xxx.xxx.xxxThis sequence forms the IP’s of your local network.Now the router also has an IP which identifies you to your ISP.You can log into the router and see it’s local web page by keying in the IP that was assigned by the ISP if the IP is dynamic the this IP can change for various reasons. If Static the IP will always be the same. If you are going to be a host then you want to request a static IP. This static IP will then be your public IP so that the outside world can reach you to access the devices attached to your local network. Such as the virtual server. Think long and hard about security. I strongly recommend putting the game side on a separate system.

  • Al

    How do you configure a cisco 1841 to obtain an IP address and DNS addresses from an ISP using a cable modem ?

  • wanyakala edwin

    thank you so much, we want you to help us such that we can help others too.

  • kabeer khan

    hi guys,how to configure dhcp server in layer 3 switch

    • http://technologyordie.com schaef350

      > The same way! The only difference is your network will be part of the VLAN interface rather than a specific physical interface like on a router.

  • schaef350

    Great stuff! This sure saved me a lot of time as the router was already part of the network…

  • hamed

    thank its work realy nice

  • hamed

    hey you re elite