Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Possible Duplicate:
How does Subnetting Work?

I watched some videos about subnet masks and ip addresses, but I have a question that I couldnt find an answer for it, how to approach this question?

A PC’s IP-address inside a subnet is Inside the subnet a maximum of 30 ‘legal’ (end)systems is allowed to be connected. What subnetmask (in dotted notation) is used?

That 30 makes it difficult to solve, If it was 32 then I would say 2^5 = 32 but since its 30 I have no idea how to solve

share|improve this question

marked as duplicate by voretaq7 Jun 27 '12 at 19:21

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Looks like homework to me. –  Safado Jun 27 '12 at 18:48
Then you didn't really understand the video as the first and last addresses are the network and broadcast which aren't usable for host addresses. –  Iain Jun 27 '12 at 18:59
..."I watched some videos"?!? –  Massimo Jun 27 '12 at 19:01
Please see the question that this is now closed as a duplicate of. Read all the answers. Enlightenment will be achieved :) –  voretaq7 Jun 27 '12 at 19:27

4 Answers 4

up vote 2 down vote accepted

30 end systems + 2 unused addresses (network and broadcast) = 32

Since the network address is the .0 address, we can subtract it from our count: 32 - 1 = 31

31 = 11111 (5 bits)

Xor that to 255 (11111111 = 8 bits), and it gives you 11100000 = 224

So the mask should be

share|improve this answer

Maybe this is cheating, but I use for network calculations when it's not obvious. The charts at are also helpful.

share|improve this answer


Which will give you 32 IPs, 30 usable plus network and broadcast addresses.

share|improve this answer

An easy way for me to do this is like so..

We know that (/24) has 256 address.

We know that (/25) has 2 groups of 128 addresses.

We know that (/26) has 4 groups of 64 addresses.

We know that (/27) has 8 groups of 32 addresses.

We know that (/28) has 16 groups of 16 addresses.

We know that (/29) has 32 groups of 8 addresses.

We know that (/30) has 64 groups of 4 addresses.

So in this case, your subnet has 32 IP addresses (30 usable, because one is the subnet ID and the other is the broadcast). So in this case, your subnet is or /27 in CIDR notation.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.