0% found this document useful (0 votes)
99 views19 pages

Configure and Verify DHCP and DNS

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
99 views19 pages

Configure and Verify DHCP and DNS

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

8/26/2019 Print content

Interconnecting Cisco Networking Devices (ICND1 v3.0)

Configure and Verify DHCP and DNS

Introduction
Exercise 1 - Configure DNS on a Router
Exercise 2 - Configure and Verify DHCP
Summary

Introduction
The Configure and Verify DHCP and DNS module provide you with the instructions
and Cisco hardware to develop your hands on skills in configuring DHCP and DNS on
Cisco devices. This module includes exercises that will cover the following topics:

Configuring a router as a DNS server


Configuring a router as a DHCP server
Configuring a router as a DHCP client

Lab Diagram

During your session, you will have access to the following lab configuration. Depending
on the exercises you may or may not use all of the devices, but they are shown here in the
layout to get an overall understanding of the topology of the lab.

https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 1/19
8/26/2019 Print content

Connecting to your Lab

In this module, you will be working on the following equipment to carry out the steps
defined in each exercise.

NYEDGE1
NYEDGE2
NYWAN1
PLABCSCO01

To start, simply choose a device and click Power on. In some cases, the devices may
power on automatically.

https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 2/19
8/26/2019 Print content

For further information and technical support, please see our Help and Support
page.

Copyright Notice
This document and its content is copyright of Practice-IT - © Practice-IT 2016. All rights reserved. Any
redistribution or reproduction of part or all of the contents in any form is prohibited other than the
following:
1. You may print or download to a local hard disk extracts for your personal and non-commercial use
only.
2. You may copy the content to individual third parties for their personal use, but only if you
acknowledge the website as the source of the material. You may not, except with our express written
permission, distribute or commercially exploit the content. Nor may you transmit it or store it in any
other website or other form of electronic retrieval system.

Exercise 1 - Configure DNS on a Router


The Domain Name System is a naming system for computers and resources connect to
the internet. It associates IP addresses with domain names so that you don’t have to
memorize an IP address to visit your favorite web page. In a small office environment, it
may be desirable to run a local DNS server on the router to IP services to clients on the
local subnet.

Task 1 - Configuring DNS

In this exercise, you will configure a DNS server on the NYEDGE1 router. Before you
begin, make sure the PLABCSCO01 server is powered on.

Step 1
Connect to the NYEDGE1 router and use the following commands to enable the DNS
service:

https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 3/19
8/26/2019 Print content

NYEDGE1#configure terminal
Enter configuration commands, one per line. End with
CNTL/Z.
NYEDGE1(config)#ip dns server
NYEDGE1(config)#ip dns primary practice-labs.com soa
ns1.practice-labs.com mb1.practice-labs.com
NYEDGE1(config)#ip host ciscoserver 192.168.16.10
NYEDGE1(config)#ip host ns1.practice-labs.com 192.168.16.1
NYEDGE1(config)#

The above configuration tells the router which DNS servers to ask for any DNS queries
that may be made by devices on the local LAN.

Note: When configuring the DNS service on the router, you do not need to have a
local database that contains all of the DNS associations on the Internet. No one
DNS server has all available associations. You are essentially creating a DNS
relay, where local clients ask the router for DNS associations, and the router, in
turn, asks DNS servers on the Internet for an address association. The response is
relayed again via the router. Having said that, however, it is possible to create
local associations as well, and this is what you have done here. For further
information, use your favorite search engine to find out more.

Step 2
Next, configure PLABCSCO01 server’s DNS setting to point to the router by right
clicking the Network Icon on your task bar and selecting Network and Sharing Center.
From there select Change Adapter Settings. Right-click the Lab_nic network card and
select properties as seen in the figure below:

https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 4/19
8/26/2019 Print content

Figure 1.1 Configuring DNS settings: Right-clicking on the Lab_nic network


interface and click Properties

The connection items window appears. Double-click the Internet Protocol 4


TCP/IPv4.

https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 5/19
8/26/2019 Print content

Figure 1.2 Configuring DNS settings: Enter the IP address of NYEDGE1 in the
Preferred DNS server field

Next enter in the IP address of the NYEDGE1 router which is 192.168.16.1, in the
Preferred DNS server field. Do not click OK yet.

Step 2
Next, click the Advanced button and select the DNS tab at the top of the page.

https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 6/19
8/26/2019 Print content

Figure 1.3 Configuring DNS settings: Configure the advanced DNS settings

In the DNS suffix field type practice-labs.com and press OK, and accept all the
dialogs.

Step 3
In this step, you will test your DNS settings. Close all other windows and open a
Command Prompt window on the server and type nslookup. If all goes well, you
should get a “>” prompt. Enter ciscoserver and examine the results. Your results
should be similar to those in the figure below:

https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 7/19
8/26/2019 Print content

Figure 1.4 Configuring DNS settings: The results confirm that the DNS server
has been configured correctly

Note: The nslookup command is the Name Server Lookup service which is
used to query DNS servers for specific DNS names and IP addresses. The
command sent here returns the associated IP address of the Domain Name sent.

You have successfully configured DNS on the NYEDGE1 router. Continue to the next
exercise.

Exercise 2 - Configure and Verify DHCP


In this exercise, you will configure a Cisco router to act as a DHCP server within the lab
environment. DHCP is a service that enables hosts to get an IP address dynamically
without you having to manually configure them; this is particularly useful where you
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 8/19
8/26/2019 Print content

have hundreds of PCs and laptops and other devices that don’t require static addresses in
your network. Some devices you may want to configure statically such as servers and
networking equipment and printers but for everything else DHCP is normally a good
configuration choice.

Lab Diagram

The following diagram describes the DHCP service that you will create in this exercise on
the NYEDGE1 router.

Task 1 - Configuring a DHCP Scope

In this first section, you will enable DHCP and configure an address scope on NYEDGE1
such that NYWAN1 will be able to retrieve an IP address automatically.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 9/19
8/26/2019 Print content

You will use the following subnet as the scope 192.168.16.0/24.

The following tasks must be completed to configure DHCP:

Create an address pool


Specify the IP configuration for the pool
Specify any domain related settings for the pool including domain name and DNS
server
Specify any additional DHCP options required
Specify any IP address exclusion required

Step 1
Connect to NYEDGE1 and configure a new address pool called labpool. To do so, issue
the following commands:

NYEDGE1#configure terminal
Enter configuration commands, one per line. End with
CNTL/Z.
NYEDGE1(config)#ip dhcp pool labpool
NYEDGE1(dhcp-config)#

Step 2
Next, specify the address range and mask length for the pool:

NYEDGE1#configure terminal
Enter configuration commands, one per line. End with
CNTL/Z.
NYEDGE1(config)#ip dhcp pool labpool
NYEDGE1(dhcp-config)#network 192.168.16.0 255.255.255.0
NYEDGE1(dhcp-config)#
*Oct 2 12:25:33.571: %DHCPD-4-PING_CONFLICT: DHCP address
conflict: server pinged 192.168.16.2.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 10/19
8/26/2019 Print content

*Oct 2 12:25:35.071: %DHCPD-4-PING_CONFLICT: DHCP address


conflict: server pinged 192.168.16.3.
NYEDGE1(dhcp-config)#exit
NYEDGE1(config)#

Once a DHCP pool is created, the router checks to see if there exist any IP addresses
within the range you have specified. You can see here that two devices have been found
that have addresses within the range. This means that if one of those IP addresses is
assigned to a device via DHCP, there will be a conflict on the network.

Step 3
To avoid such a conflict, you can exclude addresses from being assigned to DHCP clients.
Specifically, reserve IP addresses from 192.168.16.1 through to 192.168.16.15 for use
as static addresses. To exclude this range, issue the following command:

NYEDGE1(config)#ip dhcp excluded-address 192.168.16.1


192.168.16.15
NYEDGE1(config)#

Step 4
Configure the following additional DHCP settings, including a DNS server, domain name,
default gateway and finally a lease length. Note that all of these settings are optional as
DHCP will function without them:

NYEDGE1(config)#ip dhcp pool labpool


NYEDGE1(dhcp-config)#dns-server 192.168.16.10
NYEDGE1(dhcp-config)#domain-name practicelabs.com
NYEDGE1(dhcp-config)#default-router 192.168.16.1
NYEDGE1(dhcp-config)#lease 7
NYEDGE1(dhcp-config)#exit
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 11/19
8/26/2019 Print content

NYEDGE1(config)#exit
NYEDGE1#

Note: Remember that these are the settings that will be given to the DHCP clients
along with the IP address and subnet mask.

These settings configure a lease of 7 days, a DNS server pointing to PLABCSCO01, a


gateway pointing to NYEDGE1 and a domain name of practicelabs.com.

Step 5
To test your setup, you will configure the GigabitEthernet 0/0 interface of NYWAN1
as a DHCP client, and you will activate the interface. To do this, configure the interface as
follows:

NYWAN1#configure terminal
Enter configuration commands, one per line. End with
CNTL/Z.
NYWAN1(config)#interface gigabitethernet 0/0
NYWAN1(config-if)#ip address dhcp
NYWAN1(config-if)#no shutdown

Within a few seconds, you should see a syslog message similar to the following:

*Sep 18 12:38:06.855: %DHCP-6-ADDRESS_ASSIGN: Interface


GigabitEthernet0/0 assigned DHCP address 192.168.16.16,
mask 255.255.255.0, hostname NYWAN1

This indicates that an IP address of 192.168.16.16 has been given to the interface.
Notice that this is the first available IP address after the range of excluded addresses.

https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 12/19
8/26/2019 Print content

Step 6
Confirm your DHCP scope has worked using the relevant show command:

NYWAN1#show ip interface brief


Interface IP-Address OK? Method
Status Protocol
Embedded-Service-Engine0/0 unassigned YES unset
administratively down down
GigabitEthernet0/0 192.168.16.16 YES DHCP up
up
GigabitEthernet0/1 unassigned YES unset
administratively down down
GigabitEthernet0/2 unassigned YES unset
administratively down down
Serial0/0/0 unassigned YES unset
administratively down down
Serial0/0/1 unassigned YES unset
administratively down down
Serial0/1/0 unassigned YES unset
administratively down down
Serial0/1/1 unassigned YES unset
administratively down down
Serial0/2/0 unassigned YES unset
administratively down down
NYWAN1#

You can see in the above output that the address is configured. Notice that you can see
the Method by which the address was obtained.

Step 7
To verify address assignments from the DHCP server perspective, you can use the
following command on the NYEDGE1 router:

https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 13/19
8/26/2019 Print content

NYEDGE1#show ip dhcp binding


Bindings from all pools not associated with VRF:
IP address Client-ID/ Lease expiration
Type
Hardware address/
User name
192.168.16.4 0100.2304.9ac9.ee Oct 03 2016
12:31 PM Automatic
192.168.16.16 0063.6973.636f.2d61. Oct 09 2016
12:37 PM Automatic
3065.632e.6639.3638.
2e34.6638.302d.4769.
302f.30
NYEDGE1#

You can see that 192.168.16.16 has been assigned automatically and you can also see
the date and time at which the lease will expire.

Note: You may see more than one DHCP binding depending on the state of other
devices in your network. In the above output you can see an address that has been
assigned via DHCP that is within the excluded range. Looking at the lease
expiration information, you can deduce that this address was given to a device
before the DHCP exclusions were configured. This is important to note that if an
exclusion is configured, addresses that have already been assigned continue to be
used until they have expired.

Step 8
As a final test, you can also set the Lab_nic on PLABCSCO01 to use DHCP. Ensure
you configure the correct network card otherwise you will lose access to
PLABCSCO01, and you will need to reset the lab.

Set the lab_nic to receive its configuration using DHCP:

https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 14/19
8/26/2019 Print content

Figure 2.1 Configuring DHCP settings: Configure the server to receive IP


address and DNS information via DHCP

Once you click OK twice and Close once. Now check the IP configuration using the
Command Prompt by issuing the command ipconfig /all.

The output you see should be similar to the following:

Ethernet adapter Lab_nic:


Connection-specific DNS Suffix . : practice-labs.com
Description . . . . . . . . . . . : VMware Accelerated
AMD PCNe
Physical Address. . . . . . . . . : 00-50-56-A8-3F-2B
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
IP Address. . . . . . . . . . . . : 192.168.16.17
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 15/19
8/26/2019 Print content

Subnet Mask . . . . . . . . . . . : 255.255.255.0


Default Gateway . . . . . . . . . : 192.168.16.1
DHCP Server . . . . . . . . . . . : 192.168.16.1
DNS Servers . . . . . . . . . . . : 192.168.16.10
Lease Obtained. . . . . . . . . . : 18 September 2016
13:55:51
Lease Expires . . . . . . . . . . : 25 September 2016
13:55:51

From the above you can see that

the IP address given to the server is the next available address which in this case is
192.168.16.17.
The default gateway is 192.168.16.1 just as you configured it.
The DNS server is 192.168.16.1 just as you configured it.
The lease is for 7 days exactly which can be deduced from the Lease Obtained and
Lease Expires information.

Task 2 - Troubleshooting DHCP

DHCP can cause networking issues especially if IP addresses that already exist statically
on the network are assigned to other devices. In this section, you will learn to use several
diagnostic commands to help you troubleshoot DHCP

Step 1
As you saw at the beginning of the configuration, there was an IP addressing conflict
message for IP addresses 192.168.16.2 and 192.168.16.3. To view this conflict you can
use the following command:

Note: If you did not receive this conflict message, your conflict list will be empty.

NYEDGE1#show ip dhcp conflict


IP address Detection method Detection time
VRF
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 16/19
8/26/2019 Print content

192.168.16.2 Ping Oct 02 2016 12:25 PM


192.168.16.3 Ping Oct 02 2016 12:25 PM
NYEDGE1#

These two conflicts have been confirmed. Using this information, you can search and find
the devices causing the conflict.

Step 2
Take a look once again at the DHCP bindings that exist on the NYEDGE1 router:

NYEDGE1#show ip dhcp binding


Bindings from all pools not associated with VRF:
IP address Client-ID/ Lease expiration
Type
Hardware address/
User name
192.168.16.4 0100.2304.9ac9.ee Oct 03 2016
12:31 PM Automatic
192.168.16.16 0063.6973.636f.2d61. Oct 09 2016
12:37 PM Automatic
3065.632e.6639.3638.
2e34.6638.302d.4769.
302f.30
192.168.16.17 0100.5056.a83f.2b Oct 09 2016
12:50 PM Automatic
NYEDGE1#

You would like to remove the 192.168.16.4 binding from the DHCP server.

Note: If you don’t have this binding in your database, choose any other binding to
remove.

https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 17/19
8/26/2019 Print content

To do so, issue the following command:

NYEDGE1#clear ip dhcp binding 192.168.16.4


NYEDGE1#

Step 3
View the DHCP bindings once again on the NYEDGE1 router:

NYEDGE1#show ip dhcp binding


Bindings from all pools not associated with VRF:
IP address Client-ID/ Lease expiration
Type
Hardware address/
User name
192.168.16.16 0063.6973.636f.2d61. Oct 09 2016
12:37 PM Automatic
3065.632e.6639.3638.
2e34.6638.302d.4769.
302f.30
192.168.16.17 0100.5056.a83f.2b Oct 09 2016
12:50 PM Automatic
192.168.16.18 0100.2304.9ac9.ee Oct 09 2016
01:06 PM Automatic
NYEDGE1#

You can see that the binding that you cleared is no longer in the binding database.
However, a new binding has appeared with the next available IP address.

Alert: You may have to wait several minutes for this new binding to appear.

https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 18/19
8/26/2019 Print content

If you examine the Client-ID/Hardware address, you will notice that it is the same
device that you previously removed from the binding.

You have successfully configured DHCP services and completed this lab.

Summary
In this module you completed the following activities:

You configured DNS on a router and configured a client to successfully use the DNS
server
You configured a router as a DHCP server
You configured additional DHCP parameters such as domain name, default router,
DNS server and lease time
You configured addresses to be excluded from being assigned to DHCP clients
You examined commands that are helpful when troubleshooting DHCP

https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 19/19

You might also like