Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

Free lesson

Planning addresses for a small office

After this lesson: I can plan addresses for a small office.

45 min lesson3 commandsStatic routing lab: build routes on a small network in your browser

A phone repair shop opens

A phone repair shop is opening on the high street. It has two tills, a card reader, a printer, three staff laptops and free Wi-Fi for customers.

Every one of those needs its own address on the network. If two devices get the same address, both stop working properly.

So before anything is plugged in, somebody writes a plan.

By the end of this lesson

Note

I can plan addresses for a small office.

Key words

WordWhat it meansExample
IP addressthe number that finds one device on a network192.168.1.37
Network partthe start of an address, the same for every device in one network
Host partthe end of an address, different for each device
Prefixhow many bits are the network part, written after a slash/24
Subneta smaller network cut out of a bigger one
Address plana list of which device gets which address

The cells students fill in are left blank in this preview.

Before you start

Note

Press Start the lab on the bar at the top. The lab is a whole Ubuntu machine of your own, with small pretend computers built inside it. Each Run button types its command into the terminal. If a Run says the machine is still starting, wait and press it again.

An address has two parts

An IP address is four numbers, each from 0 to 255, with dots between them.

The prefix after the slash says how much of the address is the network part. A /24 means the first three numbers. Every device in that network shares them. The last number is the host part, and it is different for each device.

Worked example: one address in a /24

Written asNetwork partHost partAddresses in the network
192.168.1.37/24192.168.137256, from .0 to .255
192.168.1.200/24192.168.1200The same 256
192.168.2.37/24192.168.237A different network

The cells students fill in are left blank in this preview.

Read the lab's machines and addresses

Command
netlab status

Shown here, not run. Create a free account to press Run and type it into your own lab’s terminal.

What the lab shows

The lab has two routers, r1 and r2, and three computers, h1, h2 and mgmt. Each line gives a cable and its address, such as to-r1 10.0.1.2/24.

Look at h1 and r1. One is 10.0.1.2/24, the other 10.0.1.1/24. The network part, 10.0.1, is the same, so they are on one network.

Count the addresses in a /24

Command
python3 -c "print(__import__('ipaddress').ip_network('192.168.1.0/24').num_addresses)"

Shown here, not run. Create a free account to press Run and type it into your own lab’s terminal.

Cutting a network into smaller ones

The shop does not want customers on the same network as the tills. So it cuts its /24 into subnets.

Each step up in the prefix halves the network. A /25 is half a /24. A /26 is a quarter, so a /24 makes four /26 networks of 64 addresses each.

In every network, the first address names the network and the last is the broadcast address, which reaches every device. Neither can be given to a device.

Worked example: four /26 networks

SubnetFirst deviceLast deviceBroadcastUsed for
192.168.1.0/26.1.62.63Tills, card reader, printer
192.168.1.64/26.65.126.127Staff laptops
192.168.1.128/26.129.190.191Customer Wi-Fi
192.168.1.192/26.193.254.255Kept spare

The cells students fill in are left blank in this preview.

Let Python cut the /24

Command
python3 -c "print(list(__import__('ipaddress').ip_network('192.168.1.0/24').subnets(new_prefix=26)))"

Shown here, not run. Create a free account to press Run and type it into your own lab’s terminal.

A common mistake

Warning

Many people think a /24 holds 256 devices. It holds 256 addresses, but the first names the network and the last is the broadcast. So only 254 devices fit, and the router takes one of those.

A plan says who gets which address

A good plan follows a few habits. The router takes the first device address. Things that must never move, such as a printer or a till, get fixed addresses at the low end.

Phones and laptops come and go, so a range is kept for them to borrow. You will see how they borrow one next lesson.

Leave some room. A shop that grows from three laptops to ten should not need a new plan.

Worked example: the tills network

AddressDeviceKind
192.168.1.1The routerFixed
192.168.1.2 and .3Till 1 and till 2Fixed
192.168.1.4The card readerFixed
192.168.1.10The printerFixed
192.168.1.20 to .60Anything that joins laterBorrowed

The cells students fill in are left blank in this preview.

Going further: a bigger shop

The shop opens a second branch. It needs 40 customer devices, 12 staff laptops and 5 tills.

Use plan_lines from your assignment to pick a prefix for each group. Then cut 192.168.5.0/24 by hand so the three groups fit without overlapping. Write each subnet's first and last device address.

About this lab and its source: Static routing lab: build routes on a small network in your browser

Teaching a class? Set this module for your students with a teacher guide, marked assignments and a lab for every student.