Configure DHCP Server on a Cisco switch or router

Configure Layer3 address on a switch interface that correlates with DHCP address scope.

(config) # interface vlan 5
(config-vlan)# ip address
(config-vlan)# no shut
(config)#ip dhcp pool users
(config-dhcp)#lease 8
(config-dhcp)#ip dhcp excluded-address

By default network and broadcast addresses for the subnet won’t be offered to any client, so you do not need to specify in dhcp excluded-address list.

Lease period is mentioned in days here, by default offered with 1 day lease. If you want to specify DHCP 150 TFTP option to let IP phones download the configuration file from call manager, specify this additional command

(dhcp-config)#option 150 ip

You need Service DHCP command to enable DHCP server and relay agent on your switch, by default this feature is enabled. Ref Cisco article.

#show ip dhcp bindingDisplays address bindings on Cisco IOS DHCP Server
#show ip dhcp conflictDisplays IP address conflicts. By default, Cisco IOS DHCP Server records DHCP address conflicts in a log file.
#clear ip dhcp binding the specific DHCP binding
#clear ip dhcp conflick the conflicting IP address of the host
#debug ip dhcp serverDisplays detailed information about the client's request