Many students in our Cisco workshops need to use a router as a Dynamic Host Configuration Protocol (DHCP) server. Here’s how to do it.
Begin by configuring a DHCP database agent, such as a TFTP or FTP server that will store the DHCP bindings database. In global configuration mode, enter the following command:
router(config)#ip dhcp database [url]
The Cisco DHCP implementation assumes that all addresses in the configured subnet are available for use. If you want to exclude certain addresses, you must explicitly configure them (also in global configuration mode):
router(config)#ip dhcp excluded-address low-address [high-address]
Now, configure a DHCP pool name, which also allows you to enter DHCP configuration mode. In the example, the pool name is “dhcpdemo”. You then specify the DHCP pool subnet address and mask.
router(config)#ip dhcp pool dhcpdemo
router(dhcp-config)#network 10.16.0.0 /8
In the above example, the “/8″ indicates an 8 bit subnet mask or 255.0.0.0.
Now, you need to configure the DHCP options, including a domain name, DNS server address(es), WINS server (NetBIOS name server) address(es) and NetBIOS node type (if you don’t know which node type to use, choose “h”), the client's default router (gateway), and lease time [(days, hours, minutes) infinite] (Defaults to one day).
There are many more commands and options available with DHCP on a Cisco router. To learn more about them and gain hands-on experience, register for our Cisco Router Fundamentals 2-Day Workshop available in various cities or as an onsite presentation at your location for your group of four or more.