Calculate Subnet Mask and VLSM

How to calculate Subnet mask, Calculate Variable Length Subnet Mask (VLSM)

Few week back I face one confusion when one of our client require to increase their company computer from 200 to 1000’s PC, in the near future. They require to change the subnet mask in all their computer, server, and manageable switch. The client currently are using for their subnet mask, and require to change it to I have to assist them to change the setting in their 3Com manageable switches. I was confuse, why set to 252 instead of 255?

After Re-attend my CCNA class, CCNA in Penang, I understand how this work and also get the method on how to calculate subnet mask.

Normally for class C IP address, we will put the subnet mask as, but some other case, they are putting,,…. So when will use 128 or 192 or 225…. as your subnet mask?

For example, We use 128 (, when we require not more then 126’s PC in the network.

Method to calculate subnet mask
For, Binary is 11111111.1111111.11111111.10000000, we categories this binary as ,

NetID: 1 (1’s One)

HostID: 7 (7’s Zero)

How many PCs:

Formula: 2^ HostID -2= PC s

How many PC: 2^7-2=126 PC

How many Network:

Formula: 2^NetID=Network

How many Network: 2^1=2

Below are the table on calculate subnet mask for: (Max 126’s PC) (Max 62’s PC) (Max 30’s PC)

255.255.255. 240 (Max 14’s PC)

255.255.255. 248 (Max 6’s PC)

255.255.255. 252 (Max 2’s PC)

255.255.255. 254 (Serial subnet mask)

IT Engineer’s Life Experience
As above situation in my client side, they need 1000 PC’s, base on the formula above stated,

How many PCs:

Formula: 2^ HostID -2=number of PC

2^ ? =1024

2^10 =1024

HostID =10 (10’s zero)

The binary code for the subnet mask should be :


or we use as the subnet mask in the network that we need 1000’s PC

Base on the above diagram, subnet mask quick reference, you are able to decide what is the subnet mask that suitable your company or your network need.

Example your computer require 4000’s PC, refer to the MAX HOST above, look for the 4096 Max Host, and the subnet mask are without calculate subnet mask manually.

As above experience on my client side networking setting, now I know how to use suitable setting for the subnet mask in the future. Feel free to download the subnet mask quick reference and also copy down the above example on how to calculate subnet mask manually.

13 Responses to “Calculate Subnet Mask and VLSM”

  1. |1f34|-|1r3 December 8, 2008 at 2:07 am #

    that graph is a handy tool..thanks..but i prefer to use subnet calculator from boson’s freeware bro..get more hassle in calculating the subnets..LOL

    i remembered studying subnet masks for my CCNA but i have my CCNP, no longer calculating this and that…more to WAN stuff like advance routing and i’m in checkpoint stuff, so more to firewall guy now than network guy although they’re all related…wondering if I should renew my CCNP next year..

  2. calvyn December 8, 2008 at 7:58 am #

    |1f34|-|1r3 >
    Wow, sound interesting, after CCNP is CCIE rite? did you plan to take?

  3. erlynda December 8, 2008 at 9:03 am #

    Eh, this vlsm + subnet came out in my finals (for my Network Communication subject)… hahaha…

  4. |1f34|-|1r3 December 8, 2008 at 9:24 am #

    calvyn : not sure’s really hard to get CCIE certified..but once you got in..let’s just say you’re in heaven…some companies willing to pay rm10k++ for ccie holders because the cost of taking one is really high..but the interesting fact is this…you need to have CCNA to get CCNP certified…but you can go straight to CCIE without any CCNA or CCNP if you dare..hehe….

  5. Taukey December 8, 2008 at 9:51 am #

    damn. i just don’t know what you guys are talking about. hahahaha

  6. zool December 10, 2008 at 10:31 pm #

    Suvnet mask.. IP adress..TCP IP..
    I am phobia with that terms…
    I am totally dumb on networking

  7. Jayce December 11, 2008 at 2:42 pm #

    Forgot all of this after quit becoming an information system engineer. 😛

  8. NetworkBoy March 25, 2009 at 1:30 am #

    how can i solve for lists of IP’s when i made SUBNET?

  9. Network Expert ! March 25, 2009 at 9:42 pm #

    @NetworkBoy : Download Network calculator from Boson Utilities..that should solve your problem !

  10. M87W December 2, 2009 at 7:30 pm #

    Is there anyone here know how to make vlsm calculator?? ^^

  11. Sotha March 9, 2010 at 5:32 pm #

    Hello! i have a problem want you to help me.
    I got assignment to calculate subnet.
    Topic: IP Address:
    Subnet mask: (defualt)
    how can i calculate to continue from it by borrow 4 bits.
    Please show me the result!
    Thank for that!
    i hope to see your answer soon!

  12. Arthur April 5, 2010 at 6:29 am #

    Sotha let me your email addres and I will send you the asnwer :)

  13. nukeez June 9, 2011 at 6:33 am #

    Thanks for this, i study with this for my exam :)

Leave a Reply