MobDojoStart learning free

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.

9 min50 XPLab in Pro

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:

  1. The laptop asks, "Is there a DHCP server here? I need an address."
  2. The router answers with an offer: an IP address, the router's own address, and which DNS server to use.
  3. 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.

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:

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:

  1. Unplug the power from the modem and the router.
  2. Wait about 30 seconds.
  3. Plug in the modem first and wait until its lights settle.
  4. 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.

Test yourself

Can you answer these?

  1. What is the name of the system a router uses to hand out IP addresses automatically?
  2. Which box connects your home to your internet company?

Answer them in the app to earn 50 XP (Pro).

Answer in the app