[SOLVED] Determining a subnet mask.

Aug 23, 2019
3
0
10
VLAN A has 29 hosts. IP address of 192.168.173.27
VLAN B has 21 hosts. IP address of 192.168.173.57

What is the subnet mask in use in this network?

My thought process is to add together the hosts totaling 50, then count the powers of 2 until I reach a number big enough which is 64. So my mask would be 255.255.255.192, right? Wrong. The correct answer is 255.255.255.224 - making 32 the number we stop on.

My question is why don't we add the total number of hosts between the two networks?

Hosts = 2^h - 2 = 2^5 - 2 = 30. I can only have 30 hosts when using the subnet mask of 255.255.255.224. I need 50 hosts between the two VLANs though.

How come we don't add the required hosts together and instead just calculate the subnet mask based on the highest required hosts between the two VLANS?

Thank you,
Chris
 
Solution
Both are /27

Both subnets are next to each other. /27 is the minimum to get that many addresses. /26 overlaps between the two. You have to deduce this it's not a simple calculation.
Both are /27

Both subnets are next to each other. /27 is the minimum to get that many addresses. /26 overlaps between the two. You have to deduce this it's not a simple calculation.

I am brand new to subnetting, so your answer is a little confusing to me. I agree that both address are /27. What do you mean by "/26 overlaps between the two"? Thanks for your help failboat.
 
192.168.173.0/26 is the range from .0 to .63.
.27 and .57 are both in that one subnet.

I'm assuming that someone who made vlans would not overlap any ip ranges. You would have conflicting addresses and unreachable hosts if you did that.

Oh, okay. So in order to avoid overlapping the mask is /27 which allows for 30 hosts. VLAN A is in one block, VLAN B is in another block. This makes it to where they don't overlap. Is this train of thought correct?

Thank you Failboat!
 
Oh, okay. So in order to avoid overlapping the mask is /27 which allows for 30 hosts. VLAN A is in one block, VLAN B is in another block. This makes it to where they don't overlap. Is this train of thought correct?

Thank you Failboat!

Yes if you created two subnets it's to keep them separate.

Another scenario would be what subnet mask should be used to combine these vlans into a single vlan. Then you would add them together and figure out the minimum mask you need. /26 or lower in that situation.