• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

Anyone here good with Subneting?

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.
I have IP: 145.6.0.0 and I'm trying to to get 250 subnets and maximize the number of hosts on each subnet.

With that being said this is what I have done (I'm not sure if it's 100% correct):

Mask: 255.255.255.0

Subnet: 145.6.1.0

Broadcast: 145.6.1.255

Router:

IP: 145.6.1.1

Mask: 255.255.255.0

First Workstation:


IP: 145.6.1.3

Mask: 255.255.255.0

Gateway: 145.6.1.2

Again that's what I came up with, not sure if it's correct.
 
Think about it this way, if your network number is 145.6.0.0 and your subnet mask is 255.255.255.0, it means you can only really have control over the last 2 octets. So you'll have 256 potential subnets and 254 potential hosts on each subnet. That's the best selection to maximize hosts with 256 subnets because if you change the bits to add hosts, you don't have enough subnets, if you change the bits to increase subnets, you have too many.

If you did 255.255.0.0 then you'd only be able to have 1 network and all the Public IP addresses would be on a single subnet because you've been assigned 145.6 and cannot change that at all. In this case you could have 65534 hosts, which would be ridiculous to have on a single subnet.
 
That's just an example I used, what confuses me is trying to figure out subnet/broadcast and router IP's without using Subnet calculator.

We will be configuring a router tomorrow and he gave us bunch of examples to work with so we can better understand it.

This is what they look like and what we will be doing:

EX: Given range: 212.45.6.0 – 212.45.6.255
Requirement: Each subnet should support up to 60 hosts while maximizing the number of subnets.

Router

IP Address:

Mask:

Workstation

IP Address:

Mask:

Gateway:
 
okay, put it this way, if you look at the subnet mask, 255.255.255.0

in binary thats

1111 1111.1111 1111.1111 1111. 0000 0000

1111 1111=255 or FF in hex. As far as subnet Masking is concerned, you have your assigned network number which cannot be changed. That is 255.255 or first two octet portion of the subnet mask. So we can discard that and only deal with what we are allowed to change, the last two octets.

So if you have

1111 1111.0000 0000, we know anything that is 1's is for networks (subnets), and anything 0's is for hosts. IP addresses cannot end in 0 or 255 so that means there are 256 possible subnets and 254 possible hosts. In order to alter what you have, all you do is take bits away from one side and give to the other, then convert the bits to the base of your choice. We know we have too many hosts currently, so we will take 1 bit away from hosts.

Now we have 1111 1111 .1000 0000, 1111 1111 1=512, and the 000 0000 leaves room for 126 hosts. Do you see the pattern? The reason why its 126 for this instance is because in binary 1111111= 127, Since your network number is extending into the last octet, you don't worry the IP address being zero in the last portion, so 127 becomes 126 only because you can't have a 255. If you move the bits over again, you end up with 1111 1111 11 = 1024 subnets and 00 0000 = 62 hosts. 11 1111 = 63. This becomes 62 for the same reason the last example became 126.

As far as giving routers IP addresses, a router must have some IP address that belongs to the subnet its interface is on; however, this will effect the routing tables.

The first step would really be to assign network numbers to subnets. Then assign routers a fairly consistent IP address on each one.


Here is a example of a pretty wierd network I had to design in school once

routingproj.jpg


Heres static routes that go along with that network.

R1 Routing Table

IP route 150.10.24.0/21 150.10.16.2

IP route 150.10.32.0/21 150.10.16.2

IP route 150.10.40.0/21 150.10.16.2

IP route 150.10.48.0/21 150.10.16.2

IP route 150.10.56.0/21 150.10.16.2

IP route 150.10.64.0/21 150.10.16.2

IP route 150.10.72.0/21 150.10.16.2

IP route 150.10.80.0/21 150.10.16.2

IP route 150.10.88.0/21 150.10.16.2

IP route 150.10.96.0/21 150.10.16.2

IP route 150.10.104.0/21 150.10.16.2

IP route 150.10.112.0/21 150.10.16.2

IP route 150.10.120.0/21 150.10.16.2

R2 Routing Table

IP route 150.10.8.0/21 150.10.32.1

IP route 150.10.32.0/21 150.10.24.2

IP route 150.10.40.0/21 150.10.24.2

IP route 150.10.48.0/21 150.10.24.2

IP route 150.10.56.0/21 150.10.24.2

IP route 150.10.64.0/21 150.10.24.2

IP route 150.10.72.0/21 150.10.24.2

IP route 150.10.80.0/21 150.10.24.2

IP route 150.10.88.0/21 150.10.24.2

IP route 150.10.96.0/21 150.10.24.2

IP route 150.10.104.0/21 150.10.24.2

IP route 150.10.128.0/21 150.10.32.1

IP route 150.10.136.0/21 150.10.32.1

R3 Routing Table

IP route 150.10.8.0/21 150.10.24.1

IP route 150.10.16.0/21 150.10.24.1

IP route 150.10.40.0/21 150.10.40.1

IP route 150.10.48.0/21 150.10.40.1

IP route 150.10.56.0/21 150.10.40.1

IP route 150.10.64.0/21 150.10.40.1

IP route 150.10.72.0/21 150.10.40.1

IP route 150.10.80.0/21 150.10.40.1

IP route 150.10.88.0/21 150.10.40.1

IP route 150.10.112.0/21 150.10.24.1

IP route 150.10.120.0/21 150.10.24.1

IP route 150.10.128.0/21 150.10.24.1

IP route 150.10.136.0/21 150.10.24.1
R4 Routing Table

IP route 150.10.8.0/21 150.10.24.1

IP route 150.10.16.0/21 150.10.24.1

IP route 150.10.24.0/21 150.10.24.1

IP route 150.10.48.0/21 150.10.80.2

IP route 150.10.56.0/21 150.10.80.2

IP route 150.10.64.0/21 150.10.80.2

IP route 150.10.72.0/21 150.10.80.2

IP route 150.10.96.0/21 150.10.32.1

IP route 150.10.104.0/21 150.10.32.1

IP route 150.10.112.0/21 150.10.32.1

IP route 150.10.120.0/21 150.10.32.1

IP route 150.10.128.0/21 150.10.32.1

IP route 150.10.136.0/21 150.10.32.1

R5 Routing Table

IP route 150.10.8.0/21 150.10.64.1

IP route 150.10.16.0/21 150.10.64.1

IP route 150.10.24.0/21 150.10.64.1

IP route 150.10.32.0/21 150.10.64.1

IP route 150.10.40.0/21 150.10.64.1

IP route 150.10.72.0/21 150.10.64.1

IP route 150.10.80.0/21 150.10.64.1

IP route 150.10.88.0/21 150.10.64.1

IP route 150.10.96.0/21 150.10.64.1

IP route 150.10.104.0/21 150.10.64.1

IP route 150.10.112.0/21 150.10.64.1

IP route 150.10.120.0/21 150.10.64.1

IP route 150.10.128.0/21 150.10.64.1

IP route 150.10.136.0/21 150.10.64.1

R6 Routing Table

IP route 150.10.8.0/21 150.10.80.1

IP route 150.10.16.0/21 150.10.80.1

IP route 150.10.24.0/21 150.10.80.1

IP route 150.10.32.0/21 150.10.80.1

IP route 150.10.40.0/21 150.10.80.1

IP route 150.10.48.0/21 150.10.64.2

IP route 150.10.56.0/21 150.10.64.2

IP route 150.10.88.0/21 150.10.80.1

IP route 150.10.96.0/21 150.10.80.1

IP route 150.10.104.0/21 150.10.80.1

IP route 150.10.112.0/21 150.10.80.1

IP route 150.10.120.0/21 150.10.80.1

IP route 150.10.128.0/21 150.10.80.1

IP route 150.10.136.0/21 150.10.80.1
 
Last edited:
RedDragonXXX said:
EX: Given range: 212.45.6.0 – 212.45.6.255
Requirement: Each subnet should support up to 60 hosts while maximizing the number of subnets.

Router

IP Address:

Mask:

Workstation

IP Address:

Mask:

Gateway:

These numbers are your friends, remember them:

1 2 4 8 16 32 64 128 256

Easiest way I've found to subnet is to find the Range of the subnet. To find the range of a subnet, we take a look at the last number in the subnet mask that isn't 0, and subtract it from 256. Using your example IP, 212.45.6.0, by default, this is a Class C IP address, so the subnet mask is 24 bits, or 255.255.255.0

256 - 255 = 1

So the range is 1. That means to get to the next network, we add 1 to that third octet. 212.45.6.0 is your network, 212.45.7.0 would be the next network. 212.45.8.0, 212.45.9.0 and so on.

Now in your problem, you need each subnet to have at least 60 hosts. Let's go back to those numbers I mentioned earlier.

1 2 4 8 16 32 64 128 256

What's the first one bigger than what you need? That's right, 64. So we need to get the range to be 64. So what can we subtract from 256 to get 64?

256 - 192 = 64

Now since we are subnetting, we are getting smaller. We are taking that network you were given, and slicing it up into smaller chunks. So the subnet mask moves to the right. Your new subnet mask would be 255.255.255.192 giving you a range of 64.

So, 212.45.6.0 is your network. We go up 64 in that last octet to find the next network.

First network - 212.45.6.0
Second network - 212.45.6.64
Third network - 212.45.6.128
Fourth network - 212.45.6.192

Now, your broadcast address is the LAST address before the next network address.

So what IP addresses do those networks hold?

First network
--------------
Network Address - 212.45.6.0
Usable Addresses - 212.45.6.1 - 212.45.6.62
Broadcast Address - 212.45.6.63

Second network
--------------
Network Address - 212.45.6.64
Usable Addresses - 212.45.6.65 - 212.45.6.126
Broadcast Address - 212.45.6.127

Third network
--------------
Network Address - 212.45.6.128
Usable Addresses - 212.45.6.129 - 212.45.6.190
Broadcast Address - 212.45.6.191

Fourth network
--------------
Network Address - 212.45.6.192
Usable Addresses - 212.45.6.193 - 212.45.6.254
Broadcast Address - 212.45.6.255


So taking the third network for example, the network address is 212.45.6.128. The router address is generally the first usable IP address, so you'd assign 212.45.6.129 to your router w/ your subnet masking being that 255.255.255.192. Your first workstation could be the next IP address, 212.45.6.130 w/ subnet mask 255.255.255.192 and the gateway would point at the router, 212.45.6.129.

Router
---------
IP Address: 212.45.6.129
Subnet Mask: 255.255.255.192

Workstation
------------
IP Address: 212.45.6.130
Subnet Mask: 255.255.255.192
Gateway: 212.45.6.129

This meets all of the criteria in your problem. Instead of having one single subnet with 256 hosts, you have four subnets with 64 hosts. You have enough addresses to fit all 60 hosts, and you've maximized your number of subnets from 1 subnet to 4 subnets given your range of addresses.

Hope this helps!
 
Thanks guys that makes it little bit clearer.

I was just so used to working with Class C IP's so when he threw in Class A and B it got little confusing, but I think I got it now.

Thanks
 
Back