Networking ยท 2026-03-07
DHCP Basics: How Devices Get IP Addresses
DHCP automatically gives devices network settings so users do not have to configure everything manually.
What DHCP provides
A DHCP server can give a device an IP address, subnet mask, default gateway, DNS server, and lease time. These settings allow the device to communicate locally and reach other networks.
DHCP is useful because it reduces manual work. In a network with many devices, manually assigning IP addresses would be slow and error-prone. DHCP keeps addressing more organized by leasing addresses from a defined pool.
The DORA process
I remember the process as Discover, Offer, Request, Acknowledge. The client looks for a server, the server offers an address, the client requests it, and the server confirms the lease.
The client starts without knowing where the DHCP server is, so the first message is broadcast on the local network. This is why DHCP normally works inside a local network segment unless a DHCP relay is configured.
Common problems
- No DHCP server is reachable.
- The address pool is full.
- The wrong gateway or DNS server is assigned.
- A static IP conflicts with a DHCP address.
How I troubleshoot DHCP
First, I check whether the device received an IP address. If it has an address like 169.254.x.x, that usually means it failed to get a proper DHCP lease. Then I check whether other devices on the same network are getting addresses. If they are, the issue may be local to one device. If they are not, the DHCP service or network path may be the problem.
Static vs dynamic addressing
Dynamic addresses are good for normal client devices. Static addresses are often used for routers, servers, printers, and infrastructure devices that need predictable addresses. A beginner mistake is making everything static without documenting it, which can cause conflicts later.
Practice note
In a lab, I compare automatic addressing with static addressing. This helps me understand what DHCP is doing in the background.