MediaWiki:Welcome to the Howto page/Cisco/DHCP
The basic configuration for a Dynamic Host Resolution Protocol server is to create a pool, fill it with IP addresses, define a main gateway and DNS server to distribute and exclude certain 'static' addresses that need to be protected.
The basic command for creating the DHCP pool is: ip dhcp pool poolname
The 'network' statement then defines the range of addresses, designated by the subnet mask. As an example: network 10.100.100.128 255.255.255.128 means that there would be a total of 128 addresses in the pool starting from address 10.100.100.128. Of course the network address and broadcast address cannot be used and automatically are not distributed as such meaning that a total of 126 addresses maybe distributed via the DHCP protocol.
Since it is also needed to include a gateway address in the network which would generally be a router IP address or a managed VLAN IP address, it is necessary to use the: ip dhcp excluded-address command to exclude the router or L3 switched VLAN address.
The 'import all' statement simply means that the 'pool' will import all possible DHCP options into it.
Where DNS server's are required using the: dns-server command followed by: server1 server2 can be issued which should be the case for most switched and routed networks of today.
Sample code for creating a DHCP server can be seen below:
no ip dhcp use vrf connected ip dhcp excluded-address 10.10.1.1 ip dhcp pool dpool1 import all network 10.10.1.0 255.255.255.192 default-router 10.10.1.1 dns-server 10.10.1.100