Quick Subnetting - All in your head!

smashedpumpkinssmashedpumpkins Posts: 33Member ■■□□□□□□□□
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
  2. 10.200.10.18, mask 255.224.0.0
  3. 10.100.18.18, mask 255.240.0.0
  4. 10.100.18.18, mask 255.248.0.0
  5. 10.150.200.200, mask 255.252.0.0
  6. 10.150.200.200, mask 255.254.0.0
  7. 10.220.100.18, mask 255.255.0.0
  8. 10.220.100.18, mask 255.255.128.0
  9. 172.31.100.100, mask 255.255.192.0
  10. 172.31.100.100, mask 255.255.224.0
  11. 172.31.200.10, mask 255.255.240.0
  12. 172.31.200.10, mask 255.255.248.0
  13. 172.31.50.50, mask 255.255.252.0
  14. 172.31.50.50, mask 255.255.254.0
  15. 172.31.140.14, mask 255.255.255.0
  16. 172.31.140.14, mask 255.255.255.128
  17. 192.168.15.150, mask 255.255.255.192
  18. 192.168.15.150, mask 255.255.255.224
  19. 192.168.100.100, mask 255.255.255.240
  20. 192.168.100.100, mask 255.255.255.248
  21. 192.168.15.230, mask 255.255.255.252
  22. 10.1.1.1, mask 255.248.0.0
  23. 172.16.1.200, mask 255.255.240.0
  24. 172.16.0.200, mask 255.255.255.192
  25. 10.1.1.1, mask 255.0.0.0
Sample Answers
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

  • in3din3d Posts: 25Member ■□□□□□□□□□
  • str8outtajerzystr8outtajerzy Posts: 27Member ■□□□□□□□□□
    I came across this method as well, it's a time saver! Thanks!
  • jgq85jgq85 Posts: 8Member ■□□□□□□□□□
    How can you get the slash notation?
    So mask 255.192.0.0
    We'd know 255 is all 1's for first octet (total of icon_cool.gif

    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?
  • beach5563beach5563 Posts: 344Member ■■■□□□□□□□
    This looks like a really good method. What would be a good subletting method to learn before starting with this?
  • hannismhannism Posts: 112Member
    This is the same method I used to pass my CCNA:R&S.
    Obtained: CompTIA Linux+ [X] CompTIA Security + [X] CCENT [X] CCNA: Routing and Switching [X] CCNA: Security [X] CCNA: Wireless [X] Linux Server Professional (LPIC-1) [X] SUSE Certified Linux Administrator [X]
    Currently studying: Red Hat Certified System Administrator > Red Hat Certified System Engineer > CISSP
  • mojorojo2mojorojo2 Posts: 1Registered Users ■□□□□□□□□□
    I just came across this method of quickly solving sub netting problems, and I tried to apply this to the following problem and failed to do so, I would really appreciate if one of you cold help me solve it. Thanks in advance.

    IP-address- 9.87.181.240
    Subnet mask- 255.255.254.0

    This is a /23 class A address.
  • aca_coaaca_coa Posts: 1Registered Users ■□□□□□□□□□
    @mojorojo2
    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
  • JEFF_BDJEFF_BD Posts: 6Member ■□□□□□□□□□
    If you really want to learn and get the available hosts, broadcast,, etc... you should check out this site, https://www.adminsub.net/ipv4-subnet-calculator. It really lays out the information (below). Don't just use it as a calculator. Learn from it like I did. If you can figure out how the calculator gets the answers, then you are subnetting. Do more practice and it gets so much easier. I came to this page after searching the internet and i couldn't make sense of it at first. I felt there was something missing. Then I went to https://www.adminsub.net/ipv4-subnet-calculator and it was like a bulb went of in my head. After do several problems, I can resolve most of problems very quickly and in my head.

    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!
  • JEFF_BDJEFF_BD Posts: 6Member ■□□□□□□□□□
    192.168.28.45/28 11000000.10101000.00011100.00101101 = 192.168.28.45
    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)
  • JEFF_BDJEFF_BD Posts: 6Member ■□□□□□□□□□


    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


  • JEFF_BDJEFF_BD Posts: 6Member ■□□□□□□□□□
    Sorry for the repost. The spreadsheet above did not paste correctly. This should help give a better view.



    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


  • steele84steele84 Posts: 62Member ■■□□□□□□□□
    I love seeing all these different ways that people subnet! I personally use Todd Lammel's method and it works great for me. Block sizes my friends!
    “What lies behind us and what lies before us are tiny matters compared to what lies within us.”

    Ralph Waldo Emerson
  • alu408alu408 Posts: 45Member ■■□□□□□□□□
    i am understanding the quick way. how would you go about doing this

    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?
  • OctalDumpOctalDump Posts: 1,722Member
    alu408 wrote: »
    i am understanding the quick way. how would you go about doing this

    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.
    2017 Goals - Something Cisco, Something Linux, Agile PM
  • OctalDumpOctalDump Posts: 1,722Member
    jgq85 wrote: »
    How can you get the slash notation?
    So mask 255.192.0.0
    We'd know 255 is all 1's for first octet (total of icon_cool.gif

    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?

    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.
    2017 Goals - Something Cisco, Something Linux, Agile PM
  • alu408alu408 Posts: 45Member ■■□□□□□□□□
    Okay thanks for clarifying that. So if we were to do the last 2 increments, would it look something like this. network address is 172.16.254.192 and 172.16.255.256? and the broadcast of the last would be 172.16.254.191 and 172.16.255.255. one less than the next subnet.
    OctalDump wrote: »
    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.
  • emeeks7870emeeks7870 Posts: 1Member ■■■□□□□□□□
    I struggled with this so badly. Was really considering giving up. This helped me immensely and I can't thank you enough!
Sign In or Register to comment.