Configure Cisco router as a basic DHCP server

Contributor Icon Contributed by qmchenry Date Icon October 10, 2003  
Tag Icon Tagged: Cisco router

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.

Previous recipe | Next recipe |
 

Viewing 6 Comments

    • ^
    • v
    Where does the DNS server gets its IP address?, Do you have to configure it?, does it contain in its default configurations. Please calrify.
    • ^
    • v
    If I'm understanding what you are asking, the answer is that hosts that provide services such as DNS or HTTP need to have statically assigned IP addresses. While this can be done by configuring the DNS server to map a static IP address to the MAC address of the DNS server and have DHCP assign this IP address to the server when it asks, but it may be easier and safer to manually configure the IP address of the DNS server rather than use DHCP. One reason to do this is so that, in the event that you have to change the ethernet card in the DNS server, you won't have to rememeber to change the MAC address in your DHCP server.

    The command

    dns-server 192.168.1.5 192.168.1.6


    In the configuration above sets the values for DNS servers that the DHCP sends to clients for use in the client resolution of names.

    If this doesn't help you, let me know what you are looking for and I'll try to help.
    • ^
    • v
    Will this configuration only assign IP's to clients on the interface that 192.168.1.0/24 is attached to? say I have an external interface of eth0 which connects to my firewall and between my firewall and my router I have clients who rely on another dhcp server for their configuration. Behind eth1 I have clients that require dhcp for their configuration and I want only the ip pool on the router's dhcp server to be assigned to these clients as I'm trying to seperate subnets.
    • ^
    • v
    <ul id="quote"><h6>qmchenry wrote:</h6>If I'm understanding what you are asking, the answer is that hosts that provide services such as DNS or HTTP need to have statically assigned IP addresses. While this can be done by configuring the DNS server to map a static IP address to the MAC address of the DNS server and have DHCP assign this IP address to the server when it asks, but it may be easier and safer to manually configure the IP address of the DNS server rather than use DHCP. One reason to do this is so that, in the event that you have to change the ethernet card in the DNS server, you won't have to rememeber to change the MAC address in your DHCP server.

    The command

    dns-server 192.168.1.5 192.168.1.6


    In the configuration above sets the values for DNS servers that the DHCP sends to clients for use in the client resolution of names.

    If this doesn't help you, let me know what you are looking for and I'll try to help.</ul>
    • ^
    • v
    Hi...

    i'm developing an uniformed mobile applicaton which should support 3 OS, i.e Symbian, Palm, Win CE.

    The issue i'm struggling with is, i want to exclude the neccessity of Sync server in between. I'm using Appforge Crossfire as front end and Ms SQL Server 2000 as backend.

    Thus, to identify any PDA device is there any other option rather than MAC addr and how can i achieve the same.

    Thanking You...
    • ^
    • v
    where did you get the dns server?? and what ip should be use is it the lan or wan?
 
close Reblog this comment
blog comments powered by Disqus