Quick Subnetting - All in your head!

in CCNA & CCENT
This probably isn't new for most of you guys, but I thought I'd share what my book taught me. It makes subnetting quick and easy to figure out in seconds. No binary needed. Since this is to help you answer questions fast, you should already have a basic understanding in subnetting. Practicing this method will allow you to find everything about a subnet in mere seconds.
Question: What's the subnet number, broadcast address, and host range of the below address?
172.21.92.251
255.255.240.0
Lets first find the subnet number. First you need to find the interesting octet of the mask. It may be easier for you to stack the IP and mask as I've done above. Take a look at each octet in the mask and see if it's a 255, 0, or some other number. If the octet is neither a 255 or 0, that's your interesting octet. In our case, in red, shows the interesting octet.
255.255.240.0
Now that we have the interesting octet, compare the mask to the IP address. Anything on the left of the interesting octet, signals that you should copy the IP address octet to your subnet number. (X means it's currently unknown)
172.21.X.X
Anything on the right of the interesting octet, signals that you should copy a 0 down into the subnet number.
172.21.X.0
All that's left to find is the value of the interesting octet for our subnet number. This part is a little confusing at first, but will get easier with practice. The first step is to calculate the magic number. There's nothing magic about it, but it has many uses. To find the magic number, simply subtract the number 256 from the interesting octet in the mask.
256 - 240 = 16
Next you need to take the magic number and find the multiples of this number that is closest to or less than the interesting octet in the IP address. This can be done easy by doubling the magic number until you have a number that is closest to/equal to but not more than the interesting octet in the IP address. Since our interesting octet in the IP address is 92 you'll find the multiples as follows.
16, 32, 48, 64, 80, 96
As you can see, 80 is the closest number to 92 without actually going over 92. Guess what? We now have our subnet number. Simply place 80 in the interesting octet.
172.21.80.0
Finding the broadcast address is very easy. You again deal with the interesting octet first, but you're now using the subnet number that we just found out. Simply take the interesting octet (80) and add the magic number (16) then subtract 1. This gives you your interesting octet for the broadcast address.
80 + 16 -1 = 95
Lastly, anything to the right of your interesting octet will now change from 0 to 255. Now you have your broadcast address.
172.21.95.255
Lets pull together what we have.
Subnet Number - 172.21.80.0
Broadcast Address - 172.21.95.255
To find the host range, simply add 1 to the final octet of the subnet number and subtract 1 from the final octet of the broadcast address.
Host Range - 172.21.80.1 - 172.21.95.254
And now you have your subnet number, broadcast address, and host range without having to use any binary. If you practice this a few times you'll find it very easy to do in your head. This will help you answer mostly any subnetting question on the ICND1 test.
Sample Problems
1. 10.180.10.18, mask 255.192.0.0
---- Subnet Number - 10.128.0.0
---- Broadcast Address - 10.191.255.255
---- Host Range - 10.128.0.1 - 10.191.255.254
2. 10.200.10.18, mask 255.224.0.0
---- Subnet Number - 10.192.0.0
---- Broadcast Address - 10.223.255.255
---- Host Range - 10.192.0.1 - 10.223.255.254
... To be Continued
Question: What's the subnet number, broadcast address, and host range of the below address?
172.21.92.251
255.255.240.0
Lets first find the subnet number. First you need to find the interesting octet of the mask. It may be easier for you to stack the IP and mask as I've done above. Take a look at each octet in the mask and see if it's a 255, 0, or some other number. If the octet is neither a 255 or 0, that's your interesting octet. In our case, in red, shows the interesting octet.
255.255.240.0
Now that we have the interesting octet, compare the mask to the IP address. Anything on the left of the interesting octet, signals that you should copy the IP address octet to your subnet number. (X means it's currently unknown)
172.21.X.X
Anything on the right of the interesting octet, signals that you should copy a 0 down into the subnet number.
172.21.X.0
All that's left to find is the value of the interesting octet for our subnet number. This part is a little confusing at first, but will get easier with practice. The first step is to calculate the magic number. There's nothing magic about it, but it has many uses. To find the magic number, simply subtract the number 256 from the interesting octet in the mask.
256 - 240 = 16
Next you need to take the magic number and find the multiples of this number that is closest to or less than the interesting octet in the IP address. This can be done easy by doubling the magic number until you have a number that is closest to/equal to but not more than the interesting octet in the IP address. Since our interesting octet in the IP address is 92 you'll find the multiples as follows.
16, 32, 48, 64, 80, 96
As you can see, 80 is the closest number to 92 without actually going over 92. Guess what? We now have our subnet number. Simply place 80 in the interesting octet.
172.21.80.0
Finding the broadcast address is very easy. You again deal with the interesting octet first, but you're now using the subnet number that we just found out. Simply take the interesting octet (80) and add the magic number (16) then subtract 1. This gives you your interesting octet for the broadcast address.
80 + 16 -1 = 95
Lastly, anything to the right of your interesting octet will now change from 0 to 255. Now you have your broadcast address.
172.21.95.255
Lets pull together what we have.
Subnet Number - 172.21.80.0
Broadcast Address - 172.21.95.255
To find the host range, simply add 1 to the final octet of the subnet number and subtract 1 from the final octet of the broadcast address.
Host Range - 172.21.80.1 - 172.21.95.254
And now you have your subnet number, broadcast address, and host range without having to use any binary. If you practice this a few times you'll find it very easy to do in your head. This will help you answer mostly any subnetting question on the ICND1 test.
Sample Problems
- 10.180.10.18, mask 255.192.0.0
- 10.200.10.18, mask 255.224.0.0
- 10.100.18.18, mask 255.240.0.0
- 10.100.18.18, mask 255.248.0.0
- 10.150.200.200, mask 255.252.0.0
- 10.150.200.200, mask 255.254.0.0
- 10.220.100.18, mask 255.255.0.0
- 10.220.100.18, mask 255.255.128.0
- 172.31.100.100, mask 255.255.192.0
- 172.31.100.100, mask 255.255.224.0
- 172.31.200.10, mask 255.255.240.0
- 172.31.200.10, mask 255.255.248.0
- 172.31.50.50, mask 255.255.252.0
- 172.31.50.50, mask 255.255.254.0
- 172.31.140.14, mask 255.255.255.0
- 172.31.140.14, mask 255.255.255.128
- 192.168.15.150, mask 255.255.255.192
- 192.168.15.150, mask 255.255.255.224
- 192.168.100.100, mask 255.255.255.240
- 192.168.100.100, mask 255.255.255.248
- 192.168.15.230, mask 255.255.255.252
- 10.1.1.1, mask 255.248.0.0
- 172.16.1.200, mask 255.255.240.0
- 172.16.0.200, mask 255.255.255.192
- 10.1.1.1, mask 255.0.0.0
1. 10.180.10.18, mask 255.192.0.0
---- Subnet Number - 10.128.0.0
---- Broadcast Address - 10.191.255.255
---- Host Range - 10.128.0.1 - 10.191.255.254
2. 10.200.10.18, mask 255.224.0.0
---- Subnet Number - 10.192.0.0
---- Broadcast Address - 10.223.255.255
---- Host Range - 10.192.0.1 - 10.223.255.254
... To be Continued
Fortune favors the brave.
Comments
So mask 255.192.0.0
We'd know 255 is all 1's for first octet (total of
Would you then just do 256 - 192 = 64
Then knowing that 64 for next octet is 2, so 8 + 2 = 10, slash notation would be /10?
Currently studying: Red Hat Certified System Administrator > Red Hat Certified System Engineer > CISSP
IP-address- 9.87.181.240
Subnet mask- 255.255.254.0
This is a /23 class A address.
9.87.181.240
255.255.254.0
So, per first post, our interesting octet is third one:
255.255.254.0
Now, you need to find your network increment, 256-254=2 <-- we will use number 2 to increment our third octet.
9.87.0.0 - 9.87.1.255
9.87.2.0 - 9.87.3.255
9.87.4.0 - 9.87.5.255
...
9.87.180.0 - 9.87.181.255
9.87.182.0 - 9.87.183.255
....
Now, our IP address is in range 9.87.180.0/23.
Network address = 9.87.180.0
Broadcast address = 9.87.181.255
Usable host range = 9.87.180.1 - 9.87.181.254
P.S. use a binary calculator unless you want to write all day. You should know how to write decimal to binary and binary to decimal first. After you know how to that, use a calculator.
Good luck and have fun. It really is that easy!
Netmask 11111111.11111111.11111111.11110000 = 255.255.255.240
Wild Card 00000000.00000000.00000000.00001111 = 15
Network 11000000.10101000.00011100.00100000 = 192.168.28.32
Broadcast 11000000.10101000.00011100.00101111 = 192.168.28.47
First IP 11000000.10101000.00011100.00100001 = 192.168.28.33 ß ALWAYS one more than your Network
Last IP 11000000.10101000.00011100.00101110 = 192.168.28.46 ß ALWAYS one less than your Broadcast
Hosts = 14
IP 10.180.10.18 Mask: 255.192.0.0
IP 10.180.10.18 00001010.10110100.00001010.00010010
Netmask 255.192.0.0 11111111.11000000.00000000.00000000
Wildcard 0.63.255.255 00000000.00111111.11111111.11111111 = 4194304 (2 to the 22nd power)
Network 10.128.0.0 00001010.10000000.00000000.00000000
Broadcast 10.191.255.255 00001010.10111111.11111111.11111111
First IP 10.128.0.1
Last IP 10.191.255.254
Hosts/Net 4194302 (minus 2 bits)
9.87.181.240/23
00001001.01010111.10110101.11110000
9.87.181.240
Netmask
11111111.11111111.11111110.00000000
255.255.254.0
Wild Card
00000000.00000000.00000001.11111111
512
Network
00001001.01010111.10110100.00000000
9.87.180.0
Broadcast
00001001.01010111.10110101.11111111
9.87.181.255
First IP
00001001.01010111.10110100.00000001
9.87.180.1
Last IP
00001001.01010111.10110101.11111110
9.87.180.254
Hosts
510
N,n,H,h
N.N.nnnnnnnh.H
10.100.18.18/11
00001010.01100100.00010010.00010010
10.100.18.18
Netmask
11111111.11100000.00000000.00000000
255.224.0.0
Wild Card
00000000.00011111.11111111.11111111
0.31.255.255 = 2097152
Network
00001010.01100000.00000000.00000000
10.96.0.0
Broadcast
00001010.01111111.11111111.11111111
10.127.255.255
First IP
19.96.0.1
Last IP
10.127.255.254
Hosts
2,097,150
N,n,H,h
N.nnnhhhhh.H.H
― Ralph Waldo Emerson
172.16.0.0
255.255.255.192
So basically the interesting octet here is the fourth.
Network increment is 256-192 which is 64.
172.16.0.0
172.16.0.64
172.16.0.128
172.16.0.192
I am guessing after this i will go on to 172.16.1.0? abit confused. please help.
172.16.0.0 is in the range.
so network address is 172.16.0.0
broadcast address is ?
usable host range?
Yeah, for the same subnet mask you would always increment by 64, and when you reach 256, you roll over to the next octet.
The broadcast address is 1 less than the next subnet address, so if the subnet addresses are 172.16.0.0, 172.16.0.64 etc, it will be one less than 172.16.0.64, or 172.16.0.63
The usable host range is everything between the subnet address 172.16.0.0 and the broadcast address 172.16.0.63, ie 172.16.0.1 to 172.16.0.62.
The way I get the slash notation is to find the power of 2 (64=2^6) and then take that from the octet boundary to the right /16 - because you've 'borrowed' 6 network bits (from 255.255.0.0 or /16) to make the subnet. This means also that you only need to know the powers of 2 up to 256, which is pretty easy.
You can also use a similar technique to find the subnet, broadcast etc when present with just the CIDR notation. For example /20, you can see that it is 4 less than /24, so you know that the third octet is the 'interesting' one (to the left of the /24 boundary) and that 4 bits have been used, which means the subnets are every 16 (2^4), so the third octet increments by 16.
I literally can't remember ever doing it the 'official' way of writing it all out in binary. It seems so tedious. I recall actually skipping all the binary conversion stuff in ICDN FLGs, since it just looked like a headache.