One of the most exciting pieces of configuration within Cisco IOS, in my opinion, is IP DHCP Pools. With this feature we can configure a Cisco switch or router to act as a DHCP server. This ability is useful in several cases including some of the following; small business DHCP sever, disaster recovery DHCP server or helping with configuring static IP address devices. Lets look at each case in more detail.
Cisco IOS DHCP pools can be configured for small businesses where purchasing a standalone DHCP is not economically sound. Small businesses have to “work with what they have” and using a router or switch that is already in the network environment is a great way to do this.
Having a disaster recovery plan is pivotal to business continuity. Having Cisco IOS DHCP in you back pocket can make you a hero at the end of an unexpected day. Using this technology you can have a backup config. template in you arsenal for a bad day.
More and more network devices are coming with DHCP enabled by default these days. Some devices like, IP cameras, printers, wireless access point and other devices. Using a configured DHCP pool makes it much easier to remotely access these devices and assign static IP addresses as desired.
Lets take a closer look at the configuration and design.
1- Create DHCP Pool
2- Specify the following:
- Network (Subnet Address with Network Mask)
- Default Router (Better known as “Default Gateway”)
- DNS Servers
- DHCP Options (Optional)
3- Exclude any addresses reserved for static address assignment, including the default gateway.
Router(config)# ip dhcp pool VLAN_10
Creates a DHCP Pool named VLAN_10. Within this Pool we will specify the items mentioned above.
Router(dhcp-config)# network 172.16.10.0 255.255.255.0
Specifies the network for the DHCP Pool VLAN_10 as the 172.16.10.0/24 network.
Router(dhcp-config)# default-router 172.16.10.1
Specifies the “default gateway” for the dhcp clients will be 172.16.10.1.
Router(dhcp-config)# dns-server 172.16.2.10
Specifies the DNS Server will be 172.16.2.10
Router(config)# ip dhcp excluded-address 172.16.10.1 172.16.10.20
The above command tells the router to exclude addresses 172.16.10.1 thru 172.16.10.20 from DHCP allocation. These addresses will not be handed out to clients. The first address to be used will be 172.16.10.21.
Router(dhcp-config)# option 150 ip 172.16.2.20
Specifies optional DHCP options needed. Above the DHCP option of 150 for TFTP Server has been set to 172.16.2.20.
Show ip dhcp binding
The above command will display all allocated DHCP IP Addresses and their lease time.