Lab 09 : DHCP configuration in GNS3
Yaser Rahmati | یاسر رحمتی
Last updated
Yaser Rahmati | یاسر رحمتی
Last updated
A DHCP server is used to automatically provide IP addresses to clients. In this lab, you will configure a Dynamic Host Configuration Protocol (DHCP) server and two clients.
The topology diagram below represents the NetMap in the GNS3
The IP addresses and subnet masks used in this lab are shown in the table below:
Device | Interface | IP Address | Subnet Mask |
R1 | fa0/0 | 192.168.1.1 | 255.255.255.0 |
Server | e0 | 192.168.1.50 | 255.255.255.0 |
On R1, issue the following commands to configure the router to respond to DHCP requests and to enable the DHCP server process:
Copy
On R1, issue the following command to add a range of IP addresses from 192.168.1.1 to 192.168.1.99 to the exclude list for all DHCP pools, which will prevent the DHCP server from allocating those IP addresses to a DHCP client:
On R1, issue the following command to configure pool name of LANPOOL:
On R1, issue the following command to configure LANPOOL to assign IP addresses to DHCP clients:
On R1, issue the following command to configure LANPOOL to lease each IP address for 2 days, which is equivalent to 48 hours:
The syntax of the lease command is lease {days [hours [minutes]], where days is an integer value from 0 through 365, hours is an integer value from 0 through 23, and minutes is an integer value from 0 through 59.
On R1, issue the following command to configure LANPOOL to use the IP address configured on the FastEthernet 0/1 interface as the default gateway for DHCP clients from this pool:
The default router is also known as the default gateway. A client directs a packet to its default gateway if it does not have a direct route to the destination IP address in a packet’s header.
After you start the VPCS node you can connect to the console and issue the following command:
On Server, issue the following command:
Verify DHCP Server Functionality
On R1, issue the show ip dhcp server statistics command to examine a general summary of each DHCP server’s operating statistics. The command output includes statistics about the numbers of configured address pools, automatic and manual bindings, and types of DHCP messages sent and received.
On R1, issue the show ip dhcp pool command to verify the address ranges of the configured DHCP pools and their respective number of leased addresses. The output includes the number of currently leased addresses, the IP address range of the pool, and the value of the IP address that will be offered to the next client.