Subnetting Worked Examples and Exercises

The best way of learning subnetting is to do it. Here are a selection of worked examples to help you get started.

At the end are some links to online quizes so you can do it yourself.

1- You have been allocated a class A network address of You need to create at least 20 networks and each network will support a maximum of 160 hosts. Would the following two subnet masks Work? and or

Yes both would work.

Mask has 8 bits for the subnet and 16 bits for the host

8 bits would accommodate 28=256 subnets

16 bits would accommodate 216= over 64000 hosts

Mask has 16 bits for the subnet and 8 bits of the host.

Have possible 28 -2 hosts =254 which is enough

2. – You have been allocated a class B network address of and and need to create 4 subnets each with around 200 hosts what is the easiest mask to use to satisfy the criteria?

Easiest is to sub net on a byte boundary which would mean a subnet mask of

This would allocate 8 bits for the subnet and 8 bits for the host.

We need to accommodate around 200 hosts which requires 8 bits which we have.

We need 4 subnets which require 4 bits and we have 8 bits. So we have more than enough.

3.  Write the IP address mask in CIDR notation

Decimal 192 =11000000 binary which means that 2 bits of this octet are used for the subnet. Now add the 24 bits 255.255.255 and we have 26 bits. So we write:

4. Write the IP address mask 255.255. 248.0 in CIDR notation

Decimal 248 =11111000 binary which means that 5 bits of this octet are used for the subnet. Now add the 16 bits 255.255. and we have 21 bits. So we write:


5 – You have been allocated a class C network address of and are using the default subnet mask of how may hosts can you have?

A class C address has 8 bits of the host which will give 28 -2  =254 hosts

6 .Subnet the Class C IP Address So that you have 10 subnets each with a maximum 12 hosts on each subnet. List the Address on host 1 on subnet 0,1,2,3,10

Current mask=

Bits needs for 10 subnets =4 =24 =16 possible subnets

Bits needs for 12 hosts = 4 = 24  = 16-2=14 possible hosts.

So our mask in binary =11110000= 240 decimal

Final Mask =


7. Subnet the Class C IP Address so that you have 30 subnets.

What is the subnet mask for the maximum number of hosts?

How many hosts can each subnet have?

What is the IP address of host 3 on subnet 2 ?

Current mask=

Bits needs for 30 subnets =5 =25 =32 possible subnets

Bits left for hosts = 3 = 23  = 8-2=6 possible hosts.

So our mask in binary =11111000= 248 decimal

Final Mask =

Address of host 3 on subnet 2 is

subnet 2 =00010000 host 3 =000000011

Add the two together =00010011=19

therefore IP address of host 3 on subnet  2 =

8. Subnet the Class C IP Address So that you have at least 2 subnets each subnet must have room for 48 hosts .

What are the two possible subnet masks?

Current mask=

Bits needs for 48 hosts = 6 = 26  = 64-2=62 possible hosts.

Bits needs for 2 subnets =1 =21 =2 possible subnets

Total of 7 bits needed so therefore we can use either 1 bit or 2 bits for the subnet. So we could have

1 bit subnet 7 bits hosts or 2 bits subnet 6 bit host

masks are 10000000 and 11000000 =128 decimal and 192 decimal.

Final possible masks are: and

9 .Given the subnet Mask What is the host address and subnet of the following IP address

192 in binary =11000000 gives 4 possible subnets of (showing 2 most significant bits):


67 in binary =01000011

So Applying Mask:




Related Tutorials and Resources:

Subnet Quizzes

Test you knowledge using these online quizzes

Please rate? And use Comments to let me know more
[Total: 6    Average: 4.2/5]


  1. 1. Calculate IP addresses and subnet mask for 3 nodes (indexes are listed into the 3rd line) for three subnets (indexes are listed in the 2nd line). Network can contain some amount of subnets and no less than it is specified (the 1st line, S). Each subnet can contain no less than specific numbers of nodes (the 1st line, H).
    Result: final nodes IP and masks with calculaations
    300, 3, 140
    1, 2, 3
    11, 12, 13 / 1, 22, 23

    The 1st line: N, S, H; N – total nodes amount, S – subnet amount, H – subnet nodesamount.
    The 2nd line: A, B, C; A & B & C – subnet indexes
    The 3rd line: a1, a2, a3 / b1, b2, b3; ai и bi – node indexes to calculate. ci is equal to bi

    Help please if someone knows

  2. give the following subnets ,represnt them with a single network address

  3. Amazing, amazing work! You have no idea how much these exercises have helped, and the explanations are all very clear as well. Thank you very much!

    p.s. I love the font

  4. Hi Steve, thanks for producing this tutorial.
    In question 9 – is this assuming a Class C network? E.g. if it were a Class B network with subnet mask of then there would be 10 bits for the subnets rather than 2.

    1. Four valid subnets are to be created in a class B IP address
      Calculate the required Subnet mask and fill in the table below.

  5. The answer “therefore IP address of host 3 on subnet 2 =” of question 7 is wrong and by the way the question is wrong, because if you calculate the ip address of 2nd host pf 3rd subnet then you will get the answer as…….

    And if we go according to question the real ans should be……

    Correct me if I’m wrong!

    1. The answer is correct.
      The first sub network address is 00001xxx =decimal 8 and the second is 00010xxx =decimal 16

  6. Very useful exercises 😉 but I have a question about exercise 6: Shouldn’t it be instead of Because if we choose the last one we will get more than the 12 hosts.

      1. Yes but since it is typed “10 subnets each with a maximum 12 hosts on each subnet.” and 8 is smaller than 12 I assume is the correct answer.

  7. Sir its a very very help full for beginners and also for experience but i need ur more help to learn total subneting as class a b and c,

Leave a Reply

Your email address will not be published. Required fields are marked *