Jump to content

Subnetting

as96

The next week I have a networking exam, but I'm a bit weak on subnetting.

 

So let's say I want to split a network in four subnets, let's say 192.168.0.0, how do I proceed? Step by step?

 

Thank you.

Link to comment
Share on other sites

Link to post
Share on other sites

1. Decide what your subnets are. If you jst want 4 /24 subnets, it could be 192.168.1.0, 192.168.2.0, 192.168.3.0, and 192.168.4.0. If you're asking about equally dividing 192.168.0.0/16 into 4 subnets, you'd be talking about 192.168.0.0/18, 192.168.64.0/18, 192.168.128.0/18, and 192.168.192.0/18.

 

2. Make a router interface on each subnet, e.g. 192.168.0.1 or 192.168.192.1

3. Set up DHCP or static IP for each subnet.

4. ???

5. Profit

Looking to buy GTX690, other multi-GPU cards, or single-slot graphics cards: 

 

Link to comment
Share on other sites

Link to post
Share on other sites

46 minutes ago, brwainer said:

 

Sorry I wasn't clear enough.

Basically I want to know the math behind subnetting.

 

So if I want to divide in 4:

IP 192.168.0.1

S. Mask 255.255.255.0

 

How would I proceed?

Link to comment
Share on other sites

Link to post
Share on other sites

On 14.6.2016 at 5:43 PM, as96 said:

Sorry I wasn't clear enough.

Basically I want to know the math behind subnetting.

 

So if I want to divide in 4:

IP 192.168.0.1

S. Mask 255.255.255.0

 

How would I proceed?

4 additional networks are requiring 2 bits, thus your new mask is /26 = 11111111.11111111.11111111.11000000 = 255.255.255.192

 

1st Network = 192.168.0.0 - 192.168.0.63 -->.0000000  - .00111111

2nd Network = 192.168.0.64 - 192.168.0.127 --> .01000000 - .01111111

3rd Network = 192.168.0.128 - 192.168.0.191 --> .10000000 - .10111111

4th Network = 192.168.0.192 - 192.168.0.255 --> .11000000 - .11111111

 

It is just converting binary to decimal and using all combinations(00, 01, 10, 11) of the two bits to get 4 networks

 

If you do not like binary and your task is that easy you can also get the last part of the mask by

256-2^6=192; 6 is the amount of bits which are not used for the "network part" 32-26

 

And the networks by:

256/4=64; where 64 is the number of addresses within the subnet

Since it starts with 0 the range of the first net is 0 till 63

The second network starts with 64 thus it is  63+64 = 127 and so on...

 

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

First place to start is to know how to convert IP addresses and subnet masks to 8 bit binary octets and then use AND operator between the IP address and subnet mask to get the network address, the broadcast address is then filling all the host bits after the network address with 1's.

 

Here as some examples taken from another thread, 

 

Host:   172.16.0.1                     10101100.00010000.00000000.00000001
Subnet mask:  255.255.0.0       11111111.11111111.00000000.00000000

Network:  172.16.0.0                 10101100.00010000.00000000.00000000

Broadcast: 172.16.255.255       10101100.00010000.11111111.11111111

 

But now if you take 172.16.0.1/17

 

Host:   172.16.0.1                      10101100.00010000.00000000.00000001
Subnet mask:  255.255.128.0   11111111.11111111.10000000.00000000

Network:  172.16.0.0                 10101100.00010000.00000000.00000000

Broadcast: 172.16.127.255       10101100.00010000.01111111.11111111

 

And now 172.16.128.1/17

 

Host:   172.16.128.1                  10101100.00010000.10000000.00000001
Subnet mask:  255.255.128.0   11111111.11111111.10000000.00000000

Network:  172.16.128.0             10101100.00010000.10000000.00000000

Broadcast: 172.16.255.255       10101100.00010000.11111111.11111111

 

Try to get very proficient in how to do these binary conversions and calculating network address and broadcast address as this is the key fundamental knowledge in truely understanding subnetting.

Link to comment
Share on other sites

Link to post
Share on other sites

On 2016-06-14 at 9:43 AM, as96 said:

Sorry I wasn't clear enough.

Basically I want to know the math behind subnetting.

 

So if I want to divide in 4:

IP 192.168.0.1

S. Mask 255.255.255.0

 

How would I proceed?

Simplest way is to:

 

1. Find your block (subnet) size

2. Assign A subnet mask

3. Determine your network and broadcast addresses.

(2 and 3 are interchangeable really, you could do any one first)

 

As an example; Let's split a /24 into 4 subnets.

A /24, or 255.255.255.0, has 256 addresses, so splitting it into 4 you you get 64.

256/4=64

 

So now we know we have 64 total addresses per subnet. Now we need to calculate a subnet mask.

If you're not confident in this, I highly recommend breaking it into binary, write up a cheat-sheet if you need one to help with your learning. Don't forget that there are 4 octets! (groups of 8)

 

  0     0     0     0    0    0    0   0

128  64   32   16   8    4    2   1

 

So if we need 64, we can flip the 64's bit to a 1. When Calculating it this way, we need to invert the 1's and 0's, giving us 10111111. Adding this up we get 192. This brings our mask to 255.255.255.192.

Note: Standard subnet masks can ONLY contain the following values; 255,254,252,248,240,192,128,0 If you see any other values, the mask is wrong.

 

Now we have 192.168.0.0 255.255.255.192

You can also get the CIDR or "slash" notation, by counting to the first 0 in the subnet mask (from left to right). Which is /26 in this case.

 

Now the easy part. We know our mask, we know our block (subnet) size, now it's just a matter of writing out the 4 subnets.  In this case, we add 64 each time.

Note: Subnet addresses are always even and broadcast addresses are always odd.

 

The first subnet starts at 192.168.0.0

The second subnet starts at 192.168.0.64 (64 higher than the previous subnet)

The third subnet starts at 192.168.0.128 (another +64)

The fourth subnet starts at 192.168.0.192 (adding the final +64)

All four of these subnets have the mask of 255.255.255.192.

 

These are all our subnet addresses, now we can determine the broadcast addresses, by just going back one from the next address space.

 

The first subnet is always one less than the block size, so 64-1 here.

192.168.0.63 (192.168.0.64 minus one).

To determine the rest we can just add the block size, in this case 64.

192.168.0.127

192.168.0.191

192.168.0.255

Alternatively, you can just subtract one from the next subnet network address.

 

Putting it all together we get our four subnet ranges,

 

192.168.0.0 - 192.168.0.63 (/26 or 255.255.255.192)

192.168.0.64 - 192.168.0.127 (/26 or 255.255.255.192)

192.168.0.128 - 192.168.0.191 (/26 or 255.255.255.192)

192.168.0.192 - 192.168.0.255 (/26 or 255.255.255.192)

 

I know it seems long, but working through it is the best way to learn and once you have learned you can start using all the shortcuts that are out there. Everyone will also develop their own way of solving subnet maths, it just comes with practice. And once you are good at it, it becomes almost second nature and you can perform the whole of the calculations in seconds.

Link to comment
Share on other sites

Link to post
Share on other sites

First of all thank you guys for the help you gave me.

Now I found some notes I took in class, our professor gave us this formula: z = x + y

where z = host bits

x = bits given to the subnet

y = bits given to the hosts/subnet

 

So I tried to solve a problem where it asked to design a network for a small business with 3 offices and a server. I came up with this:

 

sn.jpg

is that correct?

How do I find the IP ranges though?

I know that ".0" is net address, ".63" is the broadcast, considering that ".64" will be the net addres of the next subnet I should add 62 to 64 right? so I will get ".65" to ".127" with ".128" as broadcast, am I correct? Or did I mess something up?

Link to comment
Share on other sites

Link to post
Share on other sites

20 minutes ago, as96 said:

 

I know that ".0" is net address, ".63" is the broadcast, considering that ".64" will be the net addres of the next subnet I should add 62 to 64 right? so I will get ".65" to ".127" with ".128" as broadcast, am I correct? Or did I mess something up?

Add 64 (addresses within the subnet)  to 63 (last address of the previous subnet) 

where 127 is the broadcast address of the subnet 

Link to comment
Share on other sites

Link to post
Share on other sites

5 minutes ago, .spider. said:

Add 64 (addresses within the subnet)  to 63 (last address of the previous subnet) 

where 127 is the broadcast address of the subnet 

Oh ok thank you! :D

 

It's fine if I put the office's pcs on the subnets of /26 and the server on a separate network /24 right?

Link to comment
Share on other sites

Link to post
Share on other sites

11 minutes ago, as96 said:

 

It's fine if I put the office's pcs on the subnets of /26 and the server on a separate network /24 right?

If there is one server it is better to use /30

Link to comment
Share on other sites

Link to post
Share on other sites

3 hours ago, as96 said:

First of all thank you guys for the help you gave me.

Now I found some notes I took in class, our professor gave us this formula: z = x + y

where z = host bits

x = bits given to the subnet

y = bits given to the hosts/subnet

 

So I tried to solve a problem where it asked to design a network for a small business with 3 offices and a server. I came up with this:

 

sn.jpg

is that correct?

How do I find the IP ranges though?

I know that ".0" is net address, ".63" is the broadcast, considering that ".64" will be the net addres of the next subnet I should add 62 to 64 right? so I will get ".65" to ".127" with ".128" as broadcast, am I correct? Or did I mess something up?

Close, just remember that network addresses are always even and broadcast addresses are always odd.

 

When adding on the block size to get the next subnet, you add the entire block, including the network and broadcast addresses. So while it is true we only have 62 "usable" addresses in the example above, the network and broadcast addresses do still exist within the range.

 

Just look at it very simply, and it will come to you easily. Start at the beginning of the very first subnet, so 0 in this case, and just add the block size. Every addition of the block size is the network address of the next subnet. Then just subtract 1 from the next subnet, and you have your ranges. Add your mask and you're done.

 

0 - 63

64 - 127

128 - 191

192 - 255 (alternatively you can remember the broadcast will always be 255 if it is the last subnet in an octet)

256 (doesn't really exist, would roll over to 0 and flip the next high-order bit, only present for demonstration)

 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×