How Computers Work · Your Computer on a Network · Lesson 3 of 5
Routers and DHCP
How the router hands out addresses, and why restarting it fixes so much.
How the router hands out addresses
In the first lesson, your computer had the address 192.168.1.42. You never typed that number. So where did it come from?
It came from your router. DHCP (Dynamic Host Configuration Protocol) is the system a router uses to hand out addresses to devices automatically. Dynamic here just means it can change.
When your laptop joins the network, a quick exchange happens:
- The laptop asks, "Is there a DHCP server here? I need an address."
- The router answers with an offer: an IP address, the router's own address, and which DNS server to use.
- The laptop accepts, and it's ready to go online.
The address is only loaned. This loan is called a lease. When it runs out, the device simply asks again, usually without you noticing. That's why your private address can change.
This is also why Windows network settings usually say Automatic (DHCP). Leave that alone unless you know why you'd change it.
What if DHCP fails? The computer can't get a real address, so it makes one up that starts with 169.254. With that address it can't reach the router or the internet. Windows may show "No internet" even though Wi-Fi looks connected. Restarting the router usually fixes it.
Phones get their Wi-Fi addresses the same way. On a Mac, the TCP/IP tab in the network Details window shows Using DHCP. It also has a Renew DHCP Lease button that asks the router for a fresh address. On Windows, the terminal command ipconfig /renew does the same.
Modem, router and restarting
Two boxes often bring the internet into a home. Many people mix them up.
- The modem connects your home to your internet company, through a cable, phone line or fiber line. It brings the internet to the house.
- The router shares that one connection with all your devices. It runs your home network, hands out addresses with DHCP and usually makes the Wi-Fi.
Many internet companies give you one box that does both jobs. It may be called a gateway. It still has both parts inside.
Devices can join the router in two ways:
- Wi-Fi uses radio waves. It's easy and works anywhere in range, but walls and distance can slow it down.
- Ethernet uses a cable plugged into the router. It's usually faster and steadier. It's great for a desktop PC or a TV near the router.
If Ethernet works but Wi-Fi doesn't, the problem is likely the Wi-Fi itself, not your internet service.
Restarting the router fixes a surprising number of problems. It clears glitches, rebuilds its list of addresses, and reconnects to your internet company. To do it well:
- Unplug the power from the modem and the router.
- Wait about 30 seconds.
- Plug in the modem first and wait until its lights settle.
- Then plug in the router and wait a few minutes.
Don't press a small hole or button marked Reset. That is a factory reset. It wipes the router's settings, including your Wi-Fi name and password. Unplugging is a restart. Reset is a wipe.
Can you answer these?
- What is the name of the system a router uses to hand out IP addresses automatically?
- Which box connects your home to your internet company?
Answer them in the app to earn 50 XP (Pro).
Answer in the app