«

»

Print this Post

CCNA – DHCP Server and Options

This lab will cover the topics 5.3.a DHCP Server and 5.3.d TFTP, DNS, and gateway options from the Cisco Certified Network Associate (CCNA) blueprint. It will test your understanding and knowledge of configure DHCP Servers on Cisco IOS devices. Please use the initial configurations as a template for your lab utilizing whatever console means you have (GNS, Physical Gear, VIRL, etc).

CCNADHCPServer


In this lab we will be looking at the use of a router as a DHCP Server. Cisco IOS provides you with the tools to create mulitple DHCP pools with the router itself acting as the DHCP Server. In this lab your task is to configure the two LAN segment interfaces as well as the DHCP Pools associated with them. The settings you need to enable are as follows:

Lan Segment 1 (PC 1 & 3):
Ethernet Interface: First available address in 172.16.18.0/23
DHCP Network: 172.16.18.0/23
DHCP Gateway: Ethernet Interface IP Address
DNS Server 1: 8.8.8.8
DNS Server 2: 4.2.2.2
TFTP Server: 10.1.1.1

Lan Segment 2 (PC 2):
Ethernet Interface: First available address in 192.168.16.0/20
DHCP Network: 192.168.16.0/20
DHCP Gateway: Ethernet Interface IP Address
DNS Server 1: 4.2.2.2
DNS Server 2: 8.8.8.8
TFTP Server 10.1.1.1

To begin with our lab provides us with two IP address to use for our Ethernet interfaces on our router. Starting with the left side of the diagram we will configure our interface and dhcp server for the 172.16.18.0/23 Subnet.

One of the first things I do before starting to create a DHCP pool is to exclude the address of the router interfaces from any pools that are created. This is an often forgten and overlooked step.

Our lab directions ask us to create a DHCP ool with specific settings. One thing that is not indicated is the name of the DHCP pool. This is an arbitrary name and should make sense to you when you are looking through your configurations later. In this case I am going to use CLIENTS-172 to indicate the network associated with 172.16.18.0. In DHCP configuration TFTP servers are indicated with DHCP Option 150. There are many other options available, however TFTP servers is indicated specifically on the blueprint so we wil configure it here.

Our settings to be configured as per the directions are as follows:
Network: 172.16.18.0/23
Gateway: 172.16.18.1
DNS Server 1: 8.8.8.8
DNS Server 2: 4.2.2.2
TFTP Server: 10.1.1.1

Now that our DHCP pool is configured we can test it out. Before we test we will turn on debugs so we can see the DHCP Pool in action. First we will turn on debugs for DHCP events, bring up a PC and then turn on debugs for dhcp packets before bringing up the second PC. This will let us see the different outputs.

In the first debug output we can see the server recognizing a DHCP request and checking out an internal DHCP pool. The second output shows the entire DHCP process commonly known as DORA. We see the initial Discover message send by the client in which the server returns a DHCP Offer. The client is happy with this address and sends the server back a DHCP Request asking to use the recommened address. Finally, the DHCP server responds with a Acknowledgement offer indicating both agree on the clients address and the binding is created.

A useful tool in the DHCP server are the outputs of the show ip dhcp pool and show ip dhcp binding commands. The later will show you the IP address and associated Client ID for each lease the DHCP server has created. The show ip dhcp pool will give you statistics on percentage of addresses in use, as well as total address and leased address counts. Creating a quick DHCP pool and checking this output is a great way to verify your subnetting in regards to host capacity when you aren’t sure of your math and don’t have handy access to a subnet calculator.

We now need to configure the second link on our router as well as our second DHCP pool for the clients on the right. Again, the DHCP pool name is arbitrary however, it must be unique on the router meaning we cannot use the same name we entered earlier. Using meaningful names for the subnets helps prevent this. Once again we will first configure the interface, and exclude the interfaces address before creating the DHCP pool. Our settings are as follows:

Network: 192.168.16.0/20
Gateway: 1192.168.16.1
DNS Server 1:4.2.2.2
DNS Server 2: 8.8.8.8
TFTP Server: 10.1.1.1

Notice how in thie case I issued the network command with a /20 CIDR notation. Some platforms will allow this, others require the subnet mask in decimal form. Always double check your config after entering it to verify it is as you want.

Once again we will turn on dhcp server packet debugging to watch the DORA process and verify it functions correctly.

Now that we can see our second client successfully got a lease from the DHCP server we can test end to end connectivity. So long as both DHCP pools provide the correct network, mask, and default-route the PC’s should be able to ping each other in this simple one router topology.

There are no initial configurations for this topology. All you need is a blank router with two interfaces in two different LAN segments.

Matt Ouellette is a certified information technology professional residing in Southwest Michigan. His technology findings and advice can be found on his PacketPilot blog. Mr. Ouellette spent 4 years as an I.T. Technician before stepping into a Network Engineer role at Bronson Health Group. Since completing his Associates Degree in Network Administration Matt has taken a head on approach to career enrichment through obtaining credentials such as CCNP, CCNA Voice, MCSA: Server 2008, and VCP5. This passion for continued learning allows him to deliver up to date quality technical solutions.

Permanent link to this article: http://www.packetpilot.com/ccna-dhcp-server-and-options/