Configuring DHCP
Configuring DHCP
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.
Note: Router 1 is directly connected to the switch and Router 2 is connected to Router 1.
Procedure
Start a HyperTerminal session.
Step 1: Enter into the global configuration mode (privileged EXEC mode) by typing
the following:
Router> enable
Step 3: Now at the privileged EXEC mode, enter the following command:
Router# reload
The responding prompt line will be:
After the router has reloaded, the line prompt will be:
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.
At the privileged EXEC mode prompt, on both routers, type the command:
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).
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.
At the global configuration mode (privileged EXEC mode), enter the following
command:
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.