How to Subnet with only a little bit of memorization and math — no binary required

When I was first learning about networks, the topic that most consistently stumped me was subnetting. I am notoriously bad at doing anything other than simple math in my head, and it always felt like I was one step behind understanding what I needed to do to get the right result. To complicate matters, most online explanations for subnetting never really clicked for me — I (mostly) understood the theory of splitting up an address into multiple subnetworks, but who wants to spend an endless amount of time writing out the binary for every IP address and subnet mask? That’s not how anyone would spend their time in a real-world scenario where there are such things as time constraints and online calculators.

“This should be easy! I know what an IP address is. Why can’t I just get it?”

If you’ve ever thought that, then this blog post is for you. I spent the last week reviewing networking concepts in order to take the CompTIA Network+ exam (I passed!), and, after reviewing subnets, I thought it might be helpful to share my process. I’m going to assume you already understand the basic reason for subnetting, and, instead of going over the entire topic, I’ll share a simple way to arrive at the correct numbers. Of course, in an exam setting (and perhaps on the job), you’re timed, so I wanted to come up with a useful way to deal with CIDR notation and subnet masks without spending an eternity in calculations and double-checking all the 1’s and 0’s.

As always, if you see an error in my post (or, especially, my math), please call me out — the whole point of this exercise is learning, after all.

The most important thing to remember is the following table:

If this seems like too much to memorize, don’t worry — there is a system to everything here, and I will explain it at the bottom. However, if memorization is something you’re not great at, the main takeaway is this, right here:

**255 = /24**

The /24 notation is equal to a subnet mask of 255.255.255.0 — in many ways, this will be our “baseline” (so to speak) on which we will base all other calculations. That “special” section (known as an octet) that equals zero in the subnet mask means there are 256 possible values for available IP addresses (it will only show up as 255 because 0 is actually the first value — thank you, computer programmers).

In our subnet masks, we always want to really pay attention to the “special octet” — the first grouping that does not equal 255. One step down in CIDR notation (/25, in this case) moves to the next octet and starts the count over again at 128 (so, the subnet mask would be 255.255.255.128). One step up in the CIDR notation (/23) moves the previous octet up to 254 (so, the subnet mask is 255.255.254.0). Every eight steps we take in CIDR notation, we will jump to the next octet.

*Here’s the crucial next step:*

To compute the range of available IP addresses, we start by subtracting whatever the value of the special octet is from 256.

In the /24 subnet, the answer is, literally, 256 (subtracting 0 from 256).

If we were to move the subnet to /23, the answer is 1 (256–255).

For /25, the answer is 128 (256–128).

What this resulting number does is give us the possible range of IP addresses within the special octet.** All of the IP address ranges must be divisible by this number**.

For example, if we have the address 129.15.146.123 /22, we know that the subnet mask must be 255.255.252.0. The special octet is the third one, with a value of 252

So, 256–252 = 4.

Therefore, the range of available numbers (in the special octet) must be divisible by 4.

Now, we could count out literally every IP address by four, if you don’t want to do any multiplication or division. I don’t recommend this, but to fully show our work in this first example, here we go:

0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, 80, 84, 88, 96, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, **144**, 148, 152, 156, 160, 164, 168, 172, 176, 180, 184, 188, 196, 200, 204, 208, 212, 216, 220, 224, 230, 234, 238, 242, 246, 250, 254

However, what we want to pay attention to is the value initially given in the special octet. In the example above, that is 146. 146 falls between 144 and 148, so we must choose 144 as our starting number.

So, the first available address in 129.15.146.123 /22 is

129.15.144.1

The last available address will be right up to the next number divisible by 4 (148):

129.15.147.255

And that’s it!

We can now compute subnet values, just from referencing that chart and doing some math that’s easy enough to do in your head.

Here’s two more examples.

1.). If you’re given the network 96.025.24.23 / 23 — what is the range of IP addresses?

- Find the subnet mask

255.255.254.0 - Deduct 254 from 256

256–254 = 2 - So, every address must be divisible by 2
- The special octet in this example is the third one, which has an initial value of 24.
- Therefore, the range of address is :

96.25.24.1 - 96.25.25.255

2.) Is 192.168.1.193/26 a host address?

- Convert /26 to subnet mask

255.255.255.192 - 2. Deduct 192 from 256

64 - Add for Available networks (divisible by 64)

0, 64, 128, 192 - Find the Applicable Range of Addresses

192.168.1.192–192.168.1.255 - Answer :

YES

(remember, the very first and very last address in the range are reserved for the network address and the broadcast address, so the first available host address in this network is 192.168.1.193)

I mentioned before that there is an order to the chart, and it’s this — we have eight different values for each “special octet,” and the values are dependent on powers of 2. Here’s the shorthand:

64

32

16

8

4

2

1

If you’re counting up, we start with a subnet value of 128. The next subnet value is 192, which we find by adding 64. Then, we half the number we added by (64/2=32), and add that number to the subnet value to get the next subnet value. You continue this order of operations until you get to 256 (but, remember, the final value in our computations will be 255 because 0 is technically the first value — aren’t computers grand?)

I hope that helps in your subnet calculations. Like I said at the start, this was the topic that tripped me up the most when I was first starting out in networking.

I will also link an article here that really helped me out.

For whatever reason, a lot of explanations online didn’t really click with me until I read that article, and then it all suddenly made sense. I’m not really sure of the reason, but maybe you’ll find it helpful too.