DHCP — Addresses on Arrival
A new designer joins Kite Studio, opens her laptop, connects to the Wi-Fi and is online within seconds. Nobody typed an IP address, a mask, a gateway or a DNS server into her laptop. A service called DHCP handed her all four, on loan.
The rule
DHCP lends settings in four steps: Discover, Offer, Request, Acknowledge.
The job. DHCP (Dynamic Host Configuration Protocol) automatically gives each new host its network settings:
- an IP address from a pool (Kite Studio's pool is
192.168.10.100to192.168.10.199); - the subnet mask (
255.255.255.0); - the default gateway (
192.168.10.1); - the DNS servers to use;
- a lease time, after which the address must be renewed or returned.
At Kite Studio the router runs the DHCP server. Devices that must never move, such as files (.20) and the printer (.30), get fixed addresses outside the pool, either typed in by hand or as a reservation that always hands the same address to the same MAC.
The four steps (DORA). A brand-new laptop has no address and does not know where the server is, so it starts by shouting:
- Discover — the client broadcasts "is there a DHCP server?"
- Offer — the server offers a free address and settings.
- Request — the client asks formally for that offer (also by broadcast, so any other server that made an offer knows it was declined).
- Acknowledge — the server confirms, and the lease starts.
DHCP runs over UDP: servers listen on port 67, clients on port 68. Because Discover is a broadcast, it stops at the router; a network without its own DHCP server needs a relay on the router to forward requests to one.
No server? A laptop that gets no answer gives itself a link-local address from 169.254.0.0/16. It can then talk only to neighbours on the same link — a clear sign DHCP failed.
The shortcut
Say D-O-R-A and ask who shouts: the client opens (Discover) and the client commits (Request); the server answers (Offer) and the server confirms (Acknowledge). When someone reports a 169.254.x.x address, skip straight to "DHCP is not reaching them".
Discover
No address yet, so the laptop broadcasts: "Any DHCP server out there?"
The trap is giving a server or printer an address inside the DHCP pool by hand. Sooner or later DHCP lends the same address to a laptop, and two devices fight over it.
Drills
Answer fast — trust the rule.
What is the correct order of the DHCP exchange?
A laptop shows the address 169.254.37.8. What does that tell you?
Which of these does DHCP normally NOT provide?
Why does the printer at 192.168.10.30 sit outside the pool of .100 to .199?
Remember
- DHCP lends settings in four steps: Discover, Offer, Request, Acknowledge.
- It hands out address, mask, gateway, DNS and a lease; servers on UDP 67, clients on 68.
- A
169.254.x.xaddress means DHCP did not answer; keep fixed addresses outside the pool.
