How many IP addresses does a network with a netmask of /24 have?

Connor Brereton
2 min readApr 6, 2020

We’re going to figure out how to solve this very common interview question.

The first question I get when I ask people this question is:

What’s a netmask?

A netmask is a 32-bit binary mask used to divide an IP address into subnets and specify the number of hosts available on the network. Essentially they are used to create small subnetworks out of an already existing network. This is great for dividing a corporate network up into smaller subnetworks for partitions such as different departments.

Next let’s answer this question with a real life interview questions.

How many IP addresses does a network w/ a netmask of /24 have?

This question can’t be answered right away because you first have to have an idea of the IP Class with which we are dealing with.

/24 is a tricky one because anything over /23 can be IPv4 or IPv6.

We need to figure out what the subnet mask is for the subnet we’ve been given. Let’s look at this CIDR table here. We see that we have the subnet mask of:

This is a Class C IP and we have 3 used segments. So the number of bits we have used is 2³ = 8 bits. Now we have some…