Using a Cisco Router As a DHCP Server

DHCP, or Dynamic Host Configuration Protocol, is widely used to automatically assign network parameters like IP address, mask, gateway, and DNS information to network clients. While DHCP server services are traditionally deployed on network servers, it isn’t uncommon to see a DHCP server role configured on a router or switch in smaller environments.

Understanding the basic DHCP server configuration steps for a Cisco IOS device is important for the CCNP ROUTE exam as well as for practical situations where a simple DHCP solution is required. We’ll use the topology below to demonstrate DHCP server configuration for Cisco IOS.


Enable The DHCP Server Service

The first step is to enable the DHCP server service on the router.

BranchRouter# configure terminal
BranchRouter(config)# service dhcp

Define The DHCP Pool

Now we define the range of addresses the router should assign to client requests. The range is referred to as a pool.

BranchRouter(config)# ip dhcp pool MARKETING
BranchRouter(dhcp-config)# network

In this example, the statement network directs the router to issue IP addresses to clients using range This defines the whole subnet for the client scope. That’s not a good practice since we need other devices on the segment (like the router’s gateway IP address).

We’ll add a list of addresses to exclude in just a minute. Before we do that we need define additional DHCP parameters we want to define for the DHCP leases.

DHCP Parameters

Clients need information like a gateway address, primary and secondary DNS servers, domain name to use, and DHCP lease period.

BranchRouter(dhcp-config)# default-router
BranchRouter(dhcp-config)# dns-server
BranchRouter(dhcp-config)# domain-name
BranchRouter(dhcp-config)# exit

There are numerous DHCP options you can assign, but here are a few of the more common:

  • domain-name – Defines the domain name the client should use
  • dns-server address [address2] – Lists the DNS servers (in order of preference) the client should use
  • default-router – Defines the client’s gateway
  • lease {days [hours [minutes]] | infinite} – Defines the lease duration (default is 24 hours)

Define The Exclude List

The last step is to define the client exclude list to the DHCP scope. In this case we exclude the first 99 IP addresses for use by the local router interface and other statically-assigned devices like servers. This effectively makes the client range

BranchRouter(config)# ip dhcp excluded-address

After you have enabled the DHCP service, defined the DHCP lease pool, DHCP parameters, and a DHCP exclude list, the DHCP service will be active and responding to client requests. Pretty simple.

Viewing Client Leases

After the DHCP server configuration is in place on the local router or layer 3 switch, you can use the show ip dhcp binding command to view the active DHCP client leases issued.

Router#show ip dhcp binding
Bindings from all pools not associated with VRF:
IP address Client-ID/ Lease expiration Type
Hardware address/
User name 24d9.1c2b.7aaa Jan 12 2014 11:39 AM Automatic 24d9.1c2b.3c7a Jan 12 2014 11:42 AM Automatic 24d9.1c2b.ac21 Jan 12 2014 11:47 AM Automatic 24d9.1c2b.9dd4 Jan 12 2014 11:53 AM Automatic

Author Aaron

Aaron knows networks. He's been involved in building and supporting world-class data networks for the past 10 years - from international cloud service providers to Fortune 50 data centers. Aaron consults independently and is focused on building the best training platform available.

More posts by Aaron

Join the discussion 2 Comments

Leave a Reply