You may use the following commands to configure a DHCP server on a Cisco router. The router in this example is a non-ISR 1720 Cisco router being run on Graphic Network Simulator 3 (GNS3). This configuration will name the pool of Internet Protocol (IP) addresses as Marketing, assign an IP address, subnet mask, default gateway, Domain Name System (DNS) server, DHCP lease and excluded IP addresses 172.16.2.1-172.16.2.99.

router-1#config t
Enter configuration commands, one per line. End with CNTL/Z.
router-1(config)#ip dhcp pool Marketing
router-1(dhcp-config)#network 172.16.2.0 255.255.0.0
router-1(dhcp-config)#default-router 172.16.1.1
router-1(dhcp-config)#dns-server 172.16.3.1
router-1(dhcp-config)#lease 8 0 0
router-1(dhcp-config)#exit
router-1(config)#
router-1(config)#ip dhcp excluded-address 172.16.2.1 172.16.2.99
router-1(config)#

You can see that I started in privileged mode and moved the command prompt to global configuration mode to configure the DHCP settings. I named the pool “Marketing” for this example. Additionally, the “default-router” setting is the IP address of the router’s interface that the hosts will connect to. Lastly, the lease command is configured in days, hours then minutes (so the configured lease is for exactly eight days).

I hope this post proves helpful to you!