Configuring DHCP

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Configuring DHCP

Objective
Configure a router for Dynamic Host Configuration Protocol (DHCP) to dynamically
assign addresses to attached hosts.
Theory
Dynamic Host Configuration Protocol (DHCP) is a protocol for assigning dynamic IP
addresses to devices on a network. With dynamic addressing, a device can have a
different IP address every time it connects to the network. In some systems, the device's
IP address can even change while it is still connected. DHCP also supports a mix of static
and dynamic IP addresses.

Dynamic addressing simplifies network administration because the software keeps track
of IP addresses rather than requiring an administrator to manage the task. This means that
a new computer can be added to a network without the hassle of manually assigning it a
unique IP address. Many ISPs use dynamic IP addressing for dial-up users.

Features of DHCP
DHCP supports the concept of a "lease" whereby a server can allocate an address to a
client for a specific amount of time. If you have more devices than IP addresses, using
shorter leases can help to keep you from running out of addresses. If you have more
addresses than devices, you can utilize permanent leases or you can assign fixed
addresses to specific device. Once the client has the lease, it must be renewed prior to the
lease expiration through another DHCPREQUEST message. If a client finishes using a
lease prior to its expiration date, the client is supposed to send a DHCPRELEASE
message to the server so that the lease can be made available to other nodes. If the server
doesn't hear from the client by the end of the lease, it marks the lease as non-renewed,
and makes it available for other clients to use.

During lease negotiation DHCP incorporates a much more robust dialogue when
compared to other IP address allocation protocols such as BOOTP. Since the addresses
can be assigned to the devices on an ad-hoc basis, mechanisms need to be incorporated
into the assignment procedure that allow for a broader range of options, as well as for a
broader range of error handling conditions.

Background/Preparation
Routing between the ISP and the campus router uses a static route between the ISP and
the gateway router, and a default route between the gateway router and the ISP router.
The ISP connection to the Internet is identified by a loopback address on the ISP router.

Equipment required for each group


If your class has 10 or less students you may work in pairs, otherwise work in groups of
three.
• Two additional straight through network cables per group.
• Two serial cables per group (for console connections).
• One DTE/smart serial cable and one DCE/smart serial cable per group.
• One Cisco switche per group.
• Two Cisco routers per group.
Cable a network similar to the one in the diagram below. Please refer to the handout to
correctly identify the interface identifiers to be used based on the equipment in the lab.
The configuration output used in this exercise is produced from 1721 series Cisco routers.
Any other router used may produce slightly different output. Conduct the following steps
on each router unless specifically instructed otherwise.

Note: Router 1 is directly connected to the switch and Router 2 is connected to Router 1.

Router Router FastEthernet Interface Serial 0 Loopback 0 Enable Enable/VT


Designation Name 0 Type Address/Subne Address/Subnet Secret Y/Console
Address/sub t Mask Mask Password Passwords
net Mask
Router 1 Campus 172.16.12.1/ DCE 172.16.1.6/3 NA class cisco
24 0
Router 2 ISP NA DTE 172.16.1.5/3 172.16.13.1/32 class cisco
0

Procedure
Start a HyperTerminal session.

Reset the routers: Erasing and reloading the router


Note: You must perform these steps on all routers in this lab exercise before continuing.
Note: Please refer to the meaning and structure of the command syntax provided at the
end of the exercise.

Step 1: Enter into the global configuration mode (privileged EXEC mode) by typing
the following:
Router> enable

Step 2: At the privileged EXEC mode, enter the following command:

Router# erase startup-config

The responding prompt will be:

Erasing the nvram filesystem will remove all files! Continue?


[confirm]

Press Enter to confirm

The response should be:

Erase of nvram: complete

Step 3: Now at the privileged EXEC mode, enter the following command:

Router# reload
The responding prompt line will be:

System configuration has been modified. Save? [yes/no]: n


Proceed with reload? [confirm]

Press Enter to confirm

The Corresponding line prompt will be:

Proceed with reload? [confirm]

Press Enter to confirm.

In the first line of the response will be:

Reload requested by the console.

After the router has reloaded, the line prompt will be:

Would you like to enter the initial configuration dialog?


[yes/no]: n

If you are asked...


Would you like to terminate autoinstall? [yes]: y

The responding line prompt will be:

Press Return to get started!

Press Enter.
Now the router is ready for the assigned lab exercise to be performed.
Step 1: Configure the routers.
Configure the routers according to the chart in handout:
• The hostname.
• The console.
• The virtual terminal.
• The enable passwords.
• The interfaces.
If problems occur during this configuration, refer to the handout’s configuration reference
information for help.

Connect the network


• Connect the network cables.
• Power-up the switches.
• Reset the switches

Step 2: Save the configuration.


Enter into the global configuration mode by typing the following command:
Router> enable

At the privileged EXEC mode prompt, on both routers, type the command:

Router# copy running-config startup-config

Step 3: Configure the hosts with the proper IP address, subnet mask, and default
gateway.
Each workstation must be able to ping to the attached router. If for some reason this is not
the case, troubleshoot as necessary. If running Windows 2000 or higher, check using
ipconfig in the command prompt (DOS window).

Step 4: Verify that the network is functioning.


From the attached hosts, ping the FastEthernet interface of the default gateway router.

Ping 10.10.10.1

Was the ping from the first and the second host successful? If the answer is no then you
may need to troubleshoot the router and host configurations to find the error. Then ping
again until they both are successful.

Step 5: Create a static route


Create a static route from the ISP to the gateway router. Addresses 199.99.9.32/27 have
been allocated for Internet access outside of the company. Use the following command to
create the static route:
In the global configuration mode, type the following command:
ISP# configuration t or conf t

This changes the prompt to ISP(config)#.

ISP(config)# ip route 172.16.12.0 255.255.255.0 172.16.1.6

Step 6: Create a default route


Add a default route from the gateway router to the ISP router. This will forward any
unknown destination address traffic to the ISP.
At the gateway router, enter into the global configuration mode by typing in the
following command:
Campus> enable

At the global configuration mode (privileged EXEC mode), enter the following
command:

Campus# configuration t or conf t

This changes the prompt to Gateway(config)#. Type in the following command:

Campus(Config)# ip route 0.0.0.0 0.0.0.0 172.16.1.5

Step 7: Create the DHCP address Pool


To configure the campus LAN pool, use the following commands:

campus(config)#ip dhcp pool campus


campus(dhcp-config)#network 172.16.12.0 255.255.255.0
campus(dhcp-config)#default-router 172.16.12.1
campus(dhcp-config)#dns-server 172.16.1.2
campus(dhcp-config)#domain-name foo.com
campus(dhcp-config)#netbios-name-server 172.16.1.10

Step 8: Excluding addresses from pool


To exclude addresses from the pool, use the following command:

Campus (dhcp-config)#ip dhcp excluded-address 172.16.12.1


172.16.12.10

Step 8: Verifying DHCP Operation


At each workstation on the directly connected subnet configure the TCP/IP properties so
that the workstation will obtain an IP address and the Domain Name System (DNS)
server address from the DHCP server. After changing and saving the configuration,
reboot the workstation. If running Windows 2000, check using the command ipconfig in
a DOS window to confirm TCP/IP configuration information.

Observations
What IP address was assigned to the workstation?
Ans.
What other information was automatically assigned?
Ans.
When was the lease obtained?
Ans.
When will the lease expire?
Ans.

From the campus router, the bindings for the hosts can be seen. To see the bindings, use
the following command at the privileged EXEC mode:

ip dhcp binding

Observations
What were the IP addresses assigned?
Ans.
What were the other fields listed in the output?
Ans.

After the completion of the previous steps, finish the lab by doing the following:
• Logoff by typing exit.
• Turn the router off.
• Remove and store the cables and adapter.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy