DHCP is an important topic on both the CCENT Exam and the CCNA Exam and not only will you need to know how to point one of your Cisco Routers to a DHCP server, you can actually configure your Cisco Router to act as a DHCP server instead of using some other dedicated server.
Before we get started lets make sure that you understand what a DHCP server is and why we need one. First off DHCP stands for Dynamic Host Configuration Protocol. Just knowing what the letters in DHCP stand for still doesn’t really explain what it does, so I will cover that in a little bit more detail.
Usually in any medium to large network you are not going to want to manually configure all the computers in the network with an appropriate ip address, default gateway, and DNS servers. Especially if you decide to change one of the DNS servers that all the computers connect to. Without DHCP you would have to make that change on every single computer manually, but with a properly configured DHCP server in your network you would only need to make the DNS server change once on the DHCP server and that change would automatically get propagated to all other hosts in the network.
Configuring your Cisco router to be a DHCP server is actually pretty straight forward once you learn the commands that you need. In the following steps we are going to assign a name to a pool (range) of ip addresses. Then we are going to specify the location of any DNS servers, the location of the default gateway, specify the network that the DHCP server will be providing addresses for, and specify the range of ip addresses that the DHCP server will not be able to assign out.
DHCP Server Configuration Commands
r1(config)# ip dhcp pool orange
r1(dhcp-config)# network 192.168.5.0 255.255.255.0
r1(dhcp-config)# default-router 192.168.5.1
r1(dhcp-config)# dns-server 22.214.171.124 126.96.36.199
r1(dhcp-config)# domain-name box.net
r1(dhcp-config)# lease infinite
From the above commands you see that we have named our DHCP pool “orange” and that this pool will cover ip addresses 192.168.5.1-254. The default router or the gateway that will be assigned to the computers who receive an ip address through dhcp is 192.168.5.1. The two DNS servers are 188.8.131.52 and 184.108.40.206. The domain name is box.net. And we decided to keep the ip addresses assigned through dhcp from expiring by making the lease time infinite.
Exclude IP Addresses
r1(config)# ip dhcp excluded-address 192.168.5.1 192.168.5.25
Usually in your network you will have some servers or other computers that have static ip addresses and we do not want our new DHCP server to assign out a duplicate ip address. We solved this by specifying the range 192.168.5.1-25 to be excluded. This means that the DHCP pool orange covers 192.168.5.26-254.
Turn On The DHCP Server
With the command “service dhcp” we enable the DHCP server to run on the Cisco router.
ICND1 Study Guide – The Fastest Way To Get Cisco Certified Guaranteed!
Photo Credit: Tom Raftery