-4

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 203.34.27.1. 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

Dumbo
  • 115
  • 1
  • 7

4 Answers4

2

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

We know that 255.255.255.0 (/24) has 256 address.

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

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

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

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

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

We know that 255.255.255.252 (/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 255.255.255.224 or /27 in CIDR notation.

Safado
  • 4,786
  • 7
  • 37
  • 54
2

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 255.255.255.224

ARomo
  • 36
  • 2
0

Maybe this is cheating, but I use http://www.subnetmask.info/ for network calculations when it's not obvious. The charts at http://www.skullbox.net/subnetcalculator.php are also helpful.

ewwhite
  • 197,159
  • 92
  • 443
  • 809
0

From http://www.subnet-calculator.com/cidr.php

203.34.27.0/27
255.255.255.224

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

Ben Lessani
  • 5,244
  • 17
  • 37