DHCP configuration and PCs IP addresses
In this lab, the DHCP server assigns IP addresses for all the PCs in the network.
How PCs request IP addresses from the DHCP server:
1) The PC sends “DHCPDISCOVER” packet contains the source address (0.0.0.0) and the destination address (255.255.255.255 Broadcast). This packet also contains the PC’s MAC address and the host identifier.
2) When the DHCP server receives the packet, the DHCP server responds with “DHCPOFFER” packet contains the source address (DHCP address) and the destination address (255.255.255.255 Broadcast). The PC will pick up the packet. The “DHCPOFFER” packet contains the same PC’s MAC address, the IP address offered by the DHCP server, the domain name, and the default gateway.
3) The PC will read the “DHCPOFFER” packet and then sends “DHCPREQUEST” packet to get the offered IP address. The “DHCPREQUEST” packet contains the source address (0.0.0.0), the destination address (255.255.255.255 broadcast), the PC’s MAC address and the host identifier.
Notice: Although the PC have the DHCP server address, it sends a broadcast address because the PC wants to notify any other DHCP server on the network about these processes and avoid any conflict.
4) The DHCP server confirms by sending “DHCPACK” contains the PC’s IP address, the default gateway, the source address (DHCP server), and the destination address (255.255.255.255 broadcast).
Lab Configurations
• Open Cisco Packet Tracer
• Drag and drop the devices as you can see in the topology.
• Connect all the devices using the interfaces assigned in the topology for every link.
• Double Click on the DHCP server and apply the following configurations:
• Click on the PC1 and apply the following configurations:
• Apply the same configuration that you applied in PC1 to PC2, PC3, and PC4.
DHCP service in a Router
If we do not have a DHCP server, we can use the router to automatically generate IP address for the LAN’s PCs.
R1:
Router>enable
Router#configure terminal
Router(config)#hostname R1
R1(config)#int fa0/0
R1(config-if)#description Defult-Gateway for LAN 192.168.1.0 R1(config-if)#ip address 192.168.1.254 255.255.255.0 R1(config-if)#no shutdown
R1(config)#ip dhcp pool LAN R1(dhcp-config)#network 192.168.1.0 255.255.255.0 R1(dhcp-config)#default-router ?
A.B.C.D Router’s IP address R1(dhcp-config)#default-router 192.168.1.254
Prevent the router to choose the DG address from the pool:
R1(config)#ip dhcp excluded-address 192.168.1.254
PC1 got its IP address from DHCP pool:
PC2 got its IP address from DHCP pool:
Lab report
In this lab, you need to capture traffic using Wireshark in DHCP enabled network:
• Turn off the Wi-Fi
• Start the Wireshark to capture traffic
• Turn on the Wi-Fi
• Wait until you get an IP address from the server and have the Internet connection
• Stop capturing
Provide the following information
• Filter all DHCP packets and provide a screenshot
• What is the IP address of the DHCP server?
• What is your IP address?
• Is there Domain Name Server provided by DHCP server? If yes, what is the DNS IP
address?
• Is there information about the subnet? If yes, what is your subnet mask?