Simple Subnetting Trick - How useful is it?
DissonantData
Member Posts: 158
in CCNA & CCENT
As I have studied for the Network+, I figured out a simple trick to determining the host range.
Here is the equation: 2^(32-x) - 2, where x is the subnet mask.
Suppose you have the network ID 192.168.1.0/26.
The subnet mask is /26 in this case, so the number of hosts is 2^(32-26) - 2 = 62.
The range of addresses possible is 192.168.1.1 to 192.168.1.62.
Is there anything else I should understand about subnetting before taking the CCNA? If I don't have the subnet mask then finding the host range can be difficult.
Here is the equation: 2^(32-x) - 2, where x is the subnet mask.
Suppose you have the network ID 192.168.1.0/26.
The subnet mask is /26 in this case, so the number of hosts is 2^(32-26) - 2 = 62.
The range of addresses possible is 192.168.1.1 to 192.168.1.62.
Is there anything else I should understand about subnetting before taking the CCNA? If I don't have the subnet mask then finding the host range can be difficult.
Comments
-
networker050184 Mod Posts: 11,962 ModYou should just memorize the easy ones like that and not have to use an equation.
2, 4, 8, 16, 32, 64, 128, 192
A /26 give you 6 host bits so count up six spots. 2, 4, 6, 8, 16, 32, 64 Now subtract 2 for your network and broadcast.An expert is a man who has made all the mistakes which can be made. -
Hondabuff Member Posts: 667 ■■■□□□□□□□/26= 192 Mask
256 - 192 = 64 Network ID
64-2= 62 Hosts
/27= 224
256-224=32
32-2=30 Hosts
Works with Every Mask *256 Magic Number minus the subnet mask* finds the block size
"Is there anything else I should understand about subnetting before taking the CCNA? If I don't have the subnet mask then finding the host range can be difficult."
Yes, Read the Cisco Press book, Wendell Odom teaches you the magic number trick.“The problem with quotes on the Internet is that you can’t always be sure of their authenticity.” ~Abraham Lincoln -
xnx Member Posts: 464 ■■■□□□□□□□I've Just memorised 128, 192, 224, 240, 248, 252, 254... (/25, /26 etc..)
I'm pretty good at subnetting - can get 20 + on subnetting.netGetting There ...
Lab Equipment: Using Cisco CSRs and 4 Switches currently -
Gngogh Member Posts: 165 ■■■□□□□□□□/26= 192 Mask
256 - 192 = 64 Network ID
64-2= 62 Hosts
/27= 224
256-224=32
32-2=30 Hosts
Works with Every Mask *256 Magic Number minus the subnet mask* finds the block size
"Is there anything else I should understand about subnetting before taking the CCNA? If I don't have the subnet mask then finding the host range can be difficult."
Yes, Read the Cisco Press book, Wendell Odom teaches you the magic number trick.
The Magic Number is what works best for me, just go up and down according to your subnet mask. -
TheGoon Member Posts: 12 ■□□□□□□□□□I need help with subneting. I don't quite understand the rules here. If I have an IP address, and a given number of subnets i need, how do i go about getting the : subnet mask, subnet ID and the amount of hosts per subnet? I know the classes and can figure out the mask part...i get lost after that.
-
Deathmage Banned Posts: 2,496I've Just memorised 128, 192, 224, 240, 248, 252, 254... (/25, /26 etc..)
I'm pretty good at subnetting - can get 20 + on subnetting.net
I feel like I keep forgetting subnetting.
so it goes
128 (/25!), 192 (/26!), 224 (/27!), 240 (/28!), 252 (/29!), 254 (/30!)?
I feel like I learn it and then a week later I've forgotten it.... it's annoying... -
networker050184 Mod Posts: 11,962 ModClose but no cigar there Deathmage.An expert is a man who has made all the mistakes which can be made.
-
TheGoon Member Posts: 12 ■□□□□□□□□□I need help with subneting. I don't quite understand the rules here. If I have an IP address, and a given number of subnets i need, how do i go about getting the : subnet mask, subnet ID and the amount of hosts per subnet? I know the classes and can figure out the mask part...i get lost after that.
can anyone help with my situation? -
markulous Member Posts: 2,394 ■■■■■■■■□□can anyone help with my situation?
A lot of what you will do will be based off of the last used bit in the subnet mask.
For instance, say you're given a scenario where they say create a subnet from a class b subnet (255.255.0.0) with an IP of 10.12.0.0 that will be ideal for a group of 450 computers. Well, we know that there are 256 bits in each octet so the last octet is going to be all 0's for the hosts. If we use the last bit in the 3rd octet for hosts, it allows for 512 (-2 for the network and broadcast) so that will be enough and 256 would be too little (remember 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, etc). So our new subnet mask would be 255.255.254.0 (e.g. 11111111.11111111.11111110.00000000).
Now even though that last 0 in the 3rd octet represents 512 host bits, we still start over when it comes to actually subnetting our network. As I said, you use the last on bit, which is the 7th 1 in the 3rd octet. So all of our networks are going to be increments of 2 base off of that bit because it represents a 2 (the one to the left of it represents a 4, the one to the left of that represents an 8, etc).
So it would look like this:
10.12.0.0 - 10.12.1.255
10.12.2.0 - 10.12.3.255
10.12.4.0 - 10.12.5.255
etc. -
Deathmage Banned Posts: 2,496networker050184 wrote: »Close but no cigar there Deathmage.
i'll figure it out; been doing subnetting on lunch the past few days.... been 'remembering' how to do it.... -
xnx Member Posts: 464 ■■■□□□□□□□I feel like I keep forgetting subnetting.
so it goes
128 (/25!), 192 (/26!), 224 (/27!), 240 (/28!), 252 (/29!), 254 (/30!)?
I feel like I learn it and then a week later I've forgotten it.... it's annoying...Getting There ...
Lab Equipment: Using Cisco CSRs and 4 Switches currently -
xnx Member Posts: 464 ■■■□□□□□□□A lot of what you will do will be based off of the last used bit in the subnet mask.
For instance, say you're given a scenario where they say create a subnet from a class b subnet (255.255.0.0) with an IP of 10.12.0.0 that will be ideal for a group of 450 computers. Well, we know that there are 256 bits in each octet so the last octet is going to be all 0's for the hosts. If we use the last bit in the 3rd octet for hosts, it allows for 512 (-2 for the network and broadcast) so that will be enough and 256 would be too little (remember 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, etc). So our new subnet mask would be 255.255.254.0 (e.g. 11111111.11111111.11111110.00000000).
Now even though that last 0 in the 3rd octet represents 512 host bits, we still start over when it comes to actually subnetting our network. As I said, you use the last on bit, which is the 7th 1 in the 3rd octet. So all of our networks are going to be increments of 2 base off of that bit because it represents a 2 (the one to the left of it represents a 4, the one to the left of that represents an 8, etc).
So it would look like this:
10.12.0.0 - 10.12.1.255
10.12.2.0 - 10.12.3.255
10.12.4.0 - 10.12.5.255
etc.Getting There ...
Lab Equipment: Using Cisco CSRs and 4 Switches currently -
markulous Member Posts: 2,394 ■■■■■■■■□□Seems like a complicated way to do things IMO
Takes me like 10-15 seconds to do it. To each their own though. -
Deathmage Banned Posts: 2,496I feel like I keep forgetting subnetting.
so it goes
128 (/25!), 192 (/26!), 224 (/27!), 240 (/28!), 252 (/29!), 254 (/30!)?
I feel like I learn it and then a week later I've forgotten it.... it's annoying...
whoops!
128 (/25!), 192 (/26!), 224 (/27!), 240 (/28!), 248 (/29!), 252 (/30!), 254 (/31!), 255(/32!)
on this same topic; been re-doing subnetting lately and I just want to make sure my notes are accurate from a few weeks ago.
Example:
what subnet does 172.15.30.5/21 belong too?
24-21 = 3 ....2^3 = 2 x 2 x 2 = 8 .... 8 is our block size.
So I do this: (erg these didn't line up correctly, the A is offset to the 2nd octet)
A B C
8 16 24 32
172.15.30.5
since this is a class B subnet we know the interesting octet is the 3rd one.
So I'm doing my math like so:
172.15.0.0
172.15.8.0
172.15.16.0
172.15.24.0
172.15.32.0
.....Answer: 172.15.30.5 belongs to the 172.15.24.0 subnet with a range of 172.15.25.0 to 172.15.31.0
is this correct?
took me about 30 seconds to do this in my head but typing this took longer....
also here is a question for you guys if (/25!) = 128.
does 128, 64, 32, 16, 8, 4, 2, 1 also apply for the number below /25! in like the 3rd, and 2nd octets or does the number reduce?
like to me, I'm guess if the 4th octet is /25! to /32! would it be safe to presume that the 3rd octet would be /17! to /23! while using the 128 (/17!) upward to 1 (/23!)?