Tools / Subnetting practice

Free tool

Subnetting practice

An address and a prefix: work out its network and broadcast addresses, first and last host, how many hosts it holds and its mask. Check your answers and see the working, as many times as you like.

Prefixes

Work out192.168.37.200/27

Enter checks, and Enter again asks the next. The up and down arrows move between the answers.

The method: find the block

Every question is solved the same way, in the one octet where the prefix ends. The octets before it are copied from the address; the octets after it are 0 in the network and 255 in the broadcast.

  1. The octet. A prefix of 8 or less ends in the first octet, 9 to 16 in the second, 17 to 24 in the third, 25 to 32 in the fourth (a prefix of exactly 8, 16 or 24 leaves the whole next octet to hosts).
  2. The mask value in that octet comes from how many of its bits are network bits, in the table below: /20 has 4 network bits in the third octet, so its mask is 255.255.240.0.
  3. The block size is 256 less that mask value. Subnets start at every multiple of the block in that octet.
  4. The network is the multiple of the block at or below the address's value in that octet; the broadcast is the next multiple less one.
  5. The hosts lie between them, from the network plus one to the broadcast less one, and there are 2host bits − 2 of them.
Network bitsMaskBlock
1128128
219264
322432
424016
52488
62524
72542
82551

Worked examples

192.168.10.77/27

  1. Subnet mask. /27 is 27 ones then 5 zeros: 255.255.255.224. The prefix ends in the fourth octet, so that octet is where the work is.
  2. Block size. 256 − 224 = 32: subnets start at every multiple of 32 in the fourth octet: 0, 32, 64, 96, ….
  3. Network. 77 falls in the block 64 to 95, so the network is its start: 192.168.10.64.
  4. Broadcast. The block's end, 95: 192.168.10.95.
  5. First and last host. One after the network and one before the broadcast: 192.168.10.65 to 192.168.10.94.
  6. Usable hosts. 2⁵ − 2 = 30: two to the power of the 5 host bits, less the network and broadcast addresses.
Network address
192.168.10.64
Broadcast address
192.168.10.95
First host
192.168.10.65
Last host
192.168.10.94
Usable hosts
30
Subnet mask
255.255.255.224

172.16.77.9/20

  1. Subnet mask. /20 is 20 ones then 12 zeros: 255.255.240.0. The prefix ends in the third octet, so that octet is where the work is.
  2. Block size. 256 − 240 = 16: subnets start at every multiple of 16 in the third octet: 0, 16, 32, 48, ….
  3. Network. 77 falls in the block 64 to 79, so the network is its start, with 0 in every octet after it: 172.16.64.0.
  4. Broadcast. The block's end, 79, with 255 in every octet after it: 172.16.79.255.
  5. First and last host. One after the network and one before the broadcast: 172.16.64.1 to 172.16.79.254.
  6. Usable hosts. 2¹² − 2 = 4,094: two to the power of the 12 host bits, less the network and broadcast addresses.
Network address
172.16.64.0
Broadcast address
172.16.79.255
First host
172.16.64.1
Last host
172.16.79.254
Usable hosts
4,094
Subnet mask
255.255.240.0

10.45.130.200/11

  1. Subnet mask. /11 is 11 ones then 21 zeros: 255.224.0.0. The prefix ends in the second octet, so that octet is where the work is.
  2. Block size. 256 − 224 = 32: subnets start at every multiple of 32 in the second octet: 0, 32, 64, 96, ….
  3. Network. 45 falls in the block 32 to 63, so the network is its start, with 0 in every octet after it: 10.32.0.0.
  4. Broadcast. The block's end, 63, with 255 in every octet after it: 10.63.255.255.
  5. First and last host. One after the network and one before the broadcast: 10.32.0.1 to 10.63.255.254.
  6. Usable hosts. 2²¹ − 2 = 2,097,150: two to the power of the 21 host bits, less the network and broadcast addresses.
Network address
10.32.0.0
Broadcast address
10.63.255.255
First host
10.32.0.1
Last host
10.63.255.254
Usable hosts
2,097,150
Subnet mask
255.224.0.0

To check any address and prefix of your own, with its binary form and its split into smaller subnets, use the subnet calculator.

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Start with a free account: Google or email, no card.

Start this lab, free