Member-only story
DHCP: Give Me My Network Settings
- You opened your laptop at a coffee shop, connected to the WiFi, and it automatically configured the network without manually entering an IP address.
- To access a network, devices need:
- IP address and subnet mask
- Router (gateway)
- DNS server
- Manual configuration is ideal for servers, which remain static on the network. Automated configuration is advantageous for mobile devices, preventing address conflicts where two devices have the same IP.
- The Dynamic Host Configuration Protocol (DHCP) simplifies this process. It uses UDP, with servers listening on UDP port 67 and clients on UDP port 68.
- DHCP follows four steps: Discover, Offer, Request, and Acknowledge (DORA):
- Discover: Client broadcasts a DHCPDISCOVER message to find a DHCP server.
- Offer: Server replies with a DHCPOFFER message, offering an IP address.
- Request: Client responds with a DHCPREQUEST message, accepting the offered IP.
- Acknowledge: Server sends a DHCPACK message, confirming the assignment of the IP address.
- A packet capture example shows the DHCP process, where the client receives the address 192.168.66.133:
- Key points:
- The client initially has no IP…