Skip to content
Free learning tool

Subnetting practice: tasks with step-by-step solutions

Practice subnetting with a fresh task every time: for each IP address and prefix, determine the network address, broadcast address, host range and host count. Check each field and, if you make a mistake, see the solution step by step. Free, no sign-in required and right in your browser.

Built by Luca Stanek

  • For training and study
  • Three levels
  • Share tasks
  • No sign-in required

Practiced enough? On your own VPS, you can configure the network and firewall yourself, with root access.

Get a new problem with every click, as often as you like.

Task

For this IP address, determine the network address, broadcast address, usable host range, and number of hosts:

192.168.78.179/27

Why this tool

Learn subnetting by practicing

For apprentices, students, and anyone planning networks.

Unlimited tasks

A new random task every time, across three difficulty levels.

Checked field by field

You'll see immediately which answers are right and which are wrong.

Step-by-step solution as you would do it on paper

Mask, block size, network, broadcast, and hosts in six steps.

Share tasks via link

The link opens the exact same task, ideal for a class, course or study group.

Track your progress

A counter shows how many tasks you got completely right on the first check without opening the solution.

Free and private

No sign-in required, right in your browser. Your answers aren't saved.

How it works

How to solve a subnetting task

No account needed, right in your browser.

Step 1

Select level

Easy (/25 to /30), Medium (/17 to /23) or Hard (/9 to /15), depending on which octet you want to work with.

Step 2

Read the task

You get a host IP address with a prefix, such as 192.168.10.77/27.

Step 3

Enter answers

The network address, broadcast address, first and last usable hosts, and number of usable hosts.

Step 4

Check answers

Each field is marked individually as correct or not yet correct.

Step 5

View solution

The step-by-step solution shows six steps from subnet mask to host count, including binary calculations. Incorrect fields then show the correct value.

Step 6

Keep practicing or share

Get the next task or use “Share task” to copy a link to the current one.

Example task

Subnetting task with step-by-step solution

Here's how to work through 172.20.45.130/21 on paper, just like in an exam.

  1. Step 1

    Subnet mask from prefix

    /21 means the first 21 bits are network bits (ones), and the remaining 11 bits are host bits (zeros). This gives the subnet mask 255.255.248.0.

    11111111.11111111.11111000.00000000
  2. Step 2

    Relevant octet and increment

    The prefix ends in the 3rd octet, where the mask is 248. The increment (block size) is 256 − 248 = 8. Subnets therefore start at 0, 8, 16, and so on.

  3. Step 3

    Network address

    45 divided by 8 gives 5 remainder 5, so 5 × 8 = 40. Subsequent octets become 0. Network address: 172.20.40.0.

    00101101  (45)
    11111000  (248)  AND
    00101000  (40)
  4. Step 4

    Broadcast address

    Next subnet minus 1: 40 + 8 − 1 = 47. Subsequent octets become 255. Broadcast: 172.20.47.255.

  5. Step 5

    Usable host range

    First host = network address + 1: 172.20.40.1. Last host = broadcast − 1: 172.20.47.254.

  6. Step 6

    Number of usable hosts

    11 host bits give 2^11 = 2,048 addresses. Subtract the network and broadcast addresses: 2,048 − 2 = 2,046 usable hosts.

Cheat sheet

Subnetting table for /25 to /30

Prefix, subnet mask, block size and host count at a glance, calculated using the same functions as the exercises.

PrefixSubnet maskStep sizeAddressesUsable hosts
/25255.255.255.128128128126
/26255.255.255.192646462
/27255.255.255.224323230
/28255.255.255.240161614
/29255.255.255.248886
/30255.255.255.252442

At the Medium (/17 to /23) and Hard (/9 to /15) levels, the same sequence of block sizes (128, 64, 32, 16, 8, 4, 2) repeats, but in the 3rd and 2nd octets respectively.

Basics

What is subnetting, and why practice it?

Divide a network into subnets

Subnetting divides a network into smaller subnets. The prefix, such as /27, determines how many bits belong to the network and how many remain for hosts. This gives you the network address, broadcast address, host range and host count.

Prepare for exams and real-world use

Subnetting is a networking fundamental covered in training, degree programs and network certifications. Worksheets have a fixed number of tasks. Here, every click gives you a new one until you master network addresses, broadcast addresses and host counts.

Enter answers on your phone, too

You can use a comma instead of a dot in IP addresses. Leading zeros, as in 192.168.010.064, are ignored. Spaces and thousands separators are ignored in the host count.

What the trainer doesn't cover

Each task covers a single IPv4 subnet. You won't practice VLSM, IPv6 or dividing a network into multiple subnets here. Use the Subnet Calculator to check your own networks.

Go to Subnet Calculator

Discover more

More tools

FAQ

Frequently asked questions about subnetting tasks

Quick answers about network addresses, broadcast addresses, block sizes, and host counts.

Given an IP address and prefix, you determine the network address, broadcast address, first and last host, and host count. For 192.168.10.77/27, these are 192.168.10.64, 192.168.10.95, 192.168.10.65 to 192.168.10.94, and 30 hosts.

In the octet where the prefix ends, divide the number by the block size and round down to the nearest whole multiple. Set all following octets to 0. In binary, this is the same as IP address AND subnet mask.

Add the block size to the network address and subtract 1 in the relevant octet, then set the following octets to 255. In binary, this sets all host bits to 1.

Subtract the subnet mask value in the relevant octet—the octet where the prefix ends—from 256. For /27, that value is 224, so the block size is 32. Subnets then start at 0, 32, 64, 96 and so on.

2 to the power of the number of host bits, minus 2 for the network and broadcast addresses. A /27 has 5 host bits, so 32 addresses and 30 usable hosts. By the same formula, a /29 has 6 usable hosts, a /24 has 254 and a /22 has 1022.

Easy uses the 4th octet with 192.168.x.x (/25 to /30), Medium the 3rd octet with 172.16.x.x to 172.31.x.x (/17 to /23), and Hard the 2nd octet with 10.x.x.x (/9 to /15). The earlier the prefix ends, the more octets you need to set to 0 or 255. /8, /16 and /24 are not included.

Yes. “Share task” copies a link containing the level and task number. Anyone who opens it gets the same IP address and prefix, so a class or study group can work on the same task. Your answers aren't included in the link.

No. Your answers are checked only in your browser and aren't saved. A shared link contains only the task, not your answers.

Any more questions?

Contact Support
From practice to your own network

Your own VPS with full network control

Root access, a static IP, and your own firewall rules: put what you've calculated here into practice on a VPS.

4.4/5 Trustpilot32,000+ Active serversSince 2010

No setup. No risk. Online in seconds.

Flexible TermCancel anytimeOnline in 60 seconds

Looking for more tools? View all network tools