Dynamic Host Configuration Protocol (DHCP) is a network management protocol used to automate the process of configuring devices on IP networks, thus allowing them to use network services such as DNS, NTP, and any communication protocol based on UDP or TCP. A DHCP server dynamically assigns an IP address and other network configuration parameters to each device on a network so they can communicate with other IP networks.

Enabling DHCP Server:

Beginning in privileged EXEC mode, follow these steps to enable the DHCP server on the router:

CommandPurpose
configure terminalEnter global configuration mode.
service dhcp interface-type numberEnable the DHCP server on the interface.
exitReturn to privileged EXEC mode.
show running-configVerify your entries.
copy running-config startup-config(Optional) Save your entries in the configuration file.

Note: To disable the DHCP server, use the no service dhcp global configuration command.

Configuring DHCP Server:

Beginning in privileged EXEC mode, follow these steps to configure the DHCP server.

CommandPurpose
configure terminalEnter global configuration mode.
ip dhcp poolCreate a DHCP server address pool and enters DHCP
pool configuration mode.
Note: If you have changed the parameters of the
DHCP server, you must perform a refresh using the
no service dhcp interface-type number command
and service dhcp interface-type number
commands.
network network-number maskSpecify the subnet network number and mask of the
DHCP address pool.
domain-name domainSpecify the domain name for the client.
dns-server addressSpecify the IP address of a DNS server that is
available to a DHCP client.
default-router addressSpecify the IP address of the default router for a
DHCP client.
exitReturn to privileged EXEC mode.
service dhcp interface-type numberEnable DHCP server on the interface.

The following example configures the DHCP server:

Router# configure terminal
Router(config)# ip dhcp included-address 192.168.1.101 192.168.1.150
Router(config)# ip dhcp pool
Router(dhcp-config)# network 192.168.1.0 255.255.255.0
Router(dhcp-config)# domain-name cisco.com
Router(dhcp-config)# dns-server 8.8.8.8
Router(dhcp-config)# default-router 192.168.1.1
Router(dhcp-config)# exit
Router(config)# service dhcp vlan1

Leave a Reply