Cisco IOS provides a basic DHCP server that can be useful for testing or small networks. If you’re in an Active Directory environment I recommend providing DHCP service from your domain controller systems and using the “ip helper-address” command (dhcp relay) to forward all DHCP requests from other subnets to your DC’s (no ip helper needed for the same subnet). You can provide redundancy with split-scope configuration on your redundant local site domain controllers.
Here are some hints for using the IOS built-in DHCP server on a small single subnet network. This is great for testing out a new router or internet connection before migrating production systems. Remember to remove the dhcp config from your router before going live if you’re using other servers to provide production dhcp service.
! -- enable privileged exec mode and configure from terminal -- enable configure terminal ! -- turn on the dhcp service -- service dhcp ! -- keep dhcp state across router reboots ip dhcp database flash:/dhcp-database.txt ! -- retry dhcp conflicts every hour (or specify minutes) ip dhcp conflict resolution ! -- limit which ip's to dynamically assign -- ip dhcp excluded-address 192.168.1.1 192.168.1.100 ip dhcp excluded-address 192.168.1.201 192.168.1.254 ! -- create the dhcp pool, choose any name -- ! -- the interface with matching subnet will serve the pool -- ip dhcp pool test_pool network 192.168.1.0 /24 dns-server 18.104.22.168 22.214.171.124 default-router 192.168.1.1 lease 0 8 exit exit ! -- SAVE YOUR CHANGES!!! -- write memory ! -- monitor dhcp status with commands like these -- show ip dhcp binding show ip dhcp pool clear ip dhcp binding IP.ADD.RE.SS
Official Cisco documentation is available for Configuring the Cisco IOS DHCP Server.
The ASA firewall provides similar DHCP capabilities, but the command syntax is quite different. You may also want to read my follow-up article for Cisco ASA DHCP Server configuration.