How it works · 22 of 36 Foundation
How does a router give each device an IP address (DHCP)?
How a router hands out addresses
DHCP: When a device joins, the router lends it an address automatically for a while, so nobody types addresses by hand.
Loading the animation…
Say it like this DHCP is how a router hands out addresses automatically: a new device asks, the router lends it a free address for a set time, and takes it back when the lease runs out.
Under the hood — for builders
- Real case: what happens when a guest joins your Wi-Fi
- The guest types nothing. Their phone and your router swap four messages, as the DHCP standard lists them:
- Worked example: a 24-hour lease
- A lease is a loan with a deadline. By default the device asks to renew halfway through, and asks any server at 87.5%:
- When two devices want the same address
- Someone types 192.168.1.23 into the printer by hand, and the router later lends .23 too. The standard has a message for that:
- Reservation
- Want the printer to keep one address? Reserve it in the router's DHCP page instead of typing it into the printer.
- Measure it
- Windows: ipconfig /all shows "Lease Obtained" and "Lease Expires". ipconfig /renew asks for a new lease now.
- Watch out
- An address starting 169.254 means no DHCP answer came, so the device gave itself a link-local one (RFC 3927). Check the router.
- Sources
- RFC 2131, Dynamic Host Configuration Protocol (Table 2; sections 4.1, 4.4.5). RFC 3927 (169.254 addresses). Read 28 Nov 2026.
What happens in the DHCP animation, step by step?
- A guest's phone joins your Wi-Fi. It has no address yet, so nothing can be sent to it.
- Your router works like a front desk with a rack of address keys to lend: here, 192.168.1.20 to .27. Three are already out.
- Four quick messages: "anyone handing out addresses?", "you can have .23", "yes please", "it's yours for 24 hours". That's DHCP.
- Your turn: another guest, a guest leaving, or 12 hours passing. Watch the keys.
- Typing an address by hand can clash. If the printer was set to .23 too, the phone notices, hands the key back and gets another.
- The router hands out addresses automatically, like a hotel desk handing out room keys. Next: how do ten devices share one public address?
What everyday example explains DHCP?
A hotel front desk handing out room keys at check-in.
Why should a team care about DHCP?
"connected, no IP address" errors and address clashes start here.