Wednesday, February 15, 2012

Configure DHCP Server On A Cisco Router

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.

Example Scenario

The router will act as a DHCP server for the network. IP Addresses already assigned to our switch ( and File Server ( 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:

R1# configure terminal
R1(config)# service dhcp

This tells the router to issue IP addresses for the network, which translates to the range - 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
R1(dhcp-config)# dns-server
R1(dhcp-config)# domain-name
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
R1(config)# ip dhcp excluded-address

This excludes IP addresses - & 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 0100.1e7a.c409 Jan 19 2009 03:06 PM Automatic 0100.1e7a.c3c1 Jan 19 2009 09:00 PM Automatic 0100.1ebe.923b Jan 19 2009 02:25 PM Automatic 0100.1b53.5ccc Jan 19 2009 02:03 PM Automatic 0100.1e7a.261d Jan 19 2009 07:52 PM Automatic


No comments:

Post a Comment

Dear Reader, if you like My Blog content, feel free to comment on our blog posts.