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

This question already has an answer here:

I am trying to understand subnetting. I understand that you can take the domain and break it into 2 subnets: and What if I need to create 2 more subnets inside both of those above subnets?

What if I need to create 2 subnets, which have 2 more subnets inside them and each of those 2 subnets have 2 hosts. As per my calculation, this would be something like.

top 2 subnets: and

subnets of -

subnets of -

hosts of -

hosts of -

hosts of -

hosts of -

hosts of -

hosts of -

The above doesn't seem right, I am moving down like a tree, however the subnet mask and IPs are being repeated, I am just adding 1 to /x and making the IPs from there. Can anyone please tell me if this is correct?

The scenario I am trying to understand is similar to this, however I just want to add hosts on each level as well.

share|improve this question

marked as duplicate by Michael Hampton Jul 7 at 13:55

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.

@Zoredache, that book you referred to might be more reading than SM was planing to do. ;) – John Gardeniers Apr 19 '10 at 9:26
@John, you either understand this stuff, or you stuggle with it. Someone could easily take an evening and read through that and know all the basics. I agree with Zoredache, SM should read it. – Chris S Apr 19 '10 at 13:23
@John Gardeniers: perhaps it to long, but it still doesn't hurt to provide a link to really good question that does good job covering most aspects of subnetting. – Zoredache Apr 19 '10 at 16:06
It appears subtlety has been wasted. – John Gardeniers Apr 19 '10 at 22:07

3 Answers 3

up vote 9 down vote accepted

Advice: learn hex and binary. It'll make more sense.

128 = 0x80, which in binary is 10000000. The 1 bit set means "this is part of the network" and the 0 bits mean "this is part of the host address." You would not have a subnet called (but that could be a host address.) The netmask for that subnet would be You may have or /25 as a host address, but the network interface's netmask would be different, which is a fancy way of saying which hosts it thinks are local, and which have to go through the router.

a /25 has a netmask of, which is 0xffffff80. The high bit set in the last byte (0x80) is the important thing.

a /26 has a netmask of, which is 0xffffffc0. 0xc0 == 11000000 in binary. Thus, there are 4 possibilities in the last byte for anything on those subnets:

00xxxxxx 01xxxxxx
10xxxxxx 11xxxxxx

A /27 would be, which is 0xffffffe0. 0xe0 == 11100000. Machines on this would have a last byte like:

000xxxxx 001xxxxx
010xxxxx 011xxxxx
100xxxxx 101xxxxx
110xxxxx 111xxxxx

And so on. I suspect the Wikipedia topic on Subnetworks has more and probably explains it better.

share|improve this answer
So if i understand this correctly, a host in dept x can have and a host in dept y can have Also another point which confused me a bit was if i want to make 2 subnets from the subnet , i end up with and .. is this correct? – SM Apr 19 '10 at 7:49
No. Well, maybe. However, the two physical networks (or through a router) cannot overlap. RFC1918 ( IP addresses need to be distinct in a "broadcast domain" -- like an Ethernet segment. The network mask length tells hosts on that subnet when to use the router and when not to, put simply. Addresses that are routed or global within a local network must be distinct. – Michael Graff Apr 19 '10 at 8:16

Here is /24 sub-netted to give two subnets with two hosts, leaving the largest available nets for further subnetting.  /25 -> 126  (128) ++  /26 -> 62  (64)  /27 -> 30  (32)  /28 -> 14  (16)  /29 -> 6  (8)  /30 -> 2  (4) < two host  /30 -> 2  (4) < two host
share|improve this answer

If you wanted 2, 2 host networks on the 10 net

 Network             DirectedBroadcast   CIDR Mask                UsableHosts        9         8,388,606   AVL      10         4,194,302   AVL      11         2,097,150   AVL      12         1,048,574   AVL      13         524,286     AVL      14         262,142     AVL      15         131,070     AVL      16         65,534      AVL      17       32,766      AVL      18       16,382      AVL      19       8,190       AVL      20       4,094       AVL      21       2,046       AVL      22       1,022       AVL      23       510         AVL      24       254         AVL      25     126         AVL      26     62          AVL      27     30          AVL      28     14          AVL      29     6           AVL      30     2           REQ 2      30     2           REQ 2
share|improve this answer