Sie sind auf Seite 1von 22

Subnetting a Class C

network address
Subnetting a Class C network can be a tricky process to
master. From MCSE to CCNA to RHCE to CNE, you'll
have to know it and know it well. Todd Lammle walks you
through clear instructions and step-by-step examples to
help you learn this skill.

Lets face it, some day you are going to have to subnet a network. Although IP
addressing isnt a network administrators favorite task, its a critical skill that you must
have. In this Daily Drill Down, I will continue our discussion of IP addressing by
exploring the process of taking a large IP address range and dividing it into smaller,
more manageable pieces. Since this is a complicated, involved process, I will only
discuss the process of breaking up Class C networks. First, we need to discuss why we
want to subnet a network and the advantages of doing so.

Why subnetting?
By creating smaller IP networks (instead of having one large network), we can obtain
better security, smaller collision and broadcast domains, and greater administrative
control of each network. Think of a network like streets in a city. Each house on this
network is known by the street and by the address. Think of the addresses on the
houses as the hardware addresses of a host. For IP to communicate with a host, the IP
address must be known, and the router connected to the network on which this host is
located must also know the hardware address of the house.

What if a city didnt have many blocks but just one long street? The mailman would go
crazy trying to get the mail delivered to each house correctly because he would have to
know the address of every house. Its the same scenario with IP. By creating smaller
networks, we can more effectively get data to each host.

Subnetting a Class C network


So you understand why you want to subnet, but how do you do it? Your goal is to look
at an IP address and subnet mask of a host and then determine three things quickly:
1. The subnet the host is located in
2. The broadcast address of the subnet
3. The valid host range of the subnet used to configure hosts

Once the subnet is determined, the broadcast address must be found. Why? Because
these are not valid host addresses and cannot be assigned to host configurations. Also,
by determining the subnet and broadcast addresses, we can easily determine the host
addresses because the valid host range is always the numbers between the subnet
address and the broadcast address.

If we use the default subnet mask with a Class C network address, then we already
know that three bytes are used to define the network and only one byte is used to define
the hosts on each network.

The default Class C mask is: 255.255.255.0. To make smaller networks, called
subnetworks, we will borrow bits from the host portion of the mask. Since the Class C
mask only uses the last octet for host addressing, we only have 8 bits at our disposal.
Therefore, only the following masks can be used with Class C networks (Table A).

Subset zero
Take note that in the table below I do not assume subnet zero. Cisco does teach a
subnet zero assumption but they do not test that way. I have chosen to follow the exam.

Table A
Mask Binary # Subnet bits # Host bits Subnets Hosts
255.255.255.128 10000000 1 7 2 126
255.255.255.192 11000000 2 6 2 62
255.255.255.224 11100000 3 5 6 30
255.255.255.240 11110000 4 4 14 14
255.255.255.248 11111000 5 3 30 6
255.255.255.252 11111100 6 2 62 2

Class C masks
You can see in Table A that the bits that are turned on (1s) are used for subnetting,
while the bits that are turned off (0s) are used for addressing of hosts. You can use
some easy math to determine the number of subnets and hosts per subnet for each
different mask.

To determine the number of subnets, use the 2 x-2, where the x exponent is the number
of subnet bits in the mask.

To determine the number of hosts, use the 2 x-2, where the x exponent is the number of
host bits in the mask.

To determine the mask you need for your network, you must first determine your
business requirements. Count the number of networks and the number of hosts per
network that you need. Then determine the mask by using the equations shown
aboveand dont forget to factor for growth.

For example, if you have eight networks and each requires 10 hosts, you would use the
Class C mask of 255.255.255.240. Why? Because 240 in binary is 11110000, which
means you have four subnet bits and four host bits. Using our math, wed get the
following:
24-2=14 subnets
24-2=14 hosts

Many people find it easy to memorize the Class C information because Class C
networks have few bits to manipulate. However, there is an easier way to subnet.

Easy subnetting
Instead of memorizing the entire table (Table A), its possible to glance at a host
address and quickly determine the necessary information if youve memorized key parts
of the table. First, you need to know your binary-to-decimal conversion. Memorize the
number of bits used with each mask that are shown in Table A. Second, you need to
remember the following:
256-192=64
256-224=32
256-240=16
256-248=8
256-252=4

Once you have the two steps memorized, you can begin subnetting. Our first example
will use the Class C mask of 255.255.255.192. Ask five simple questions to gather all
the facts:

1. How many subnet bits are used in this mask?


2. How many host bits are available per subnet?
3. What are the subnet addresses?
4. What is the broadcast address of each subnet?
5. What is the valid host range of each subnet?

You already know how to answer questions one and two. To answer question three, use
the formula 256-subnetmask to get the first subnet and your variable. Keep adding this
number to itself until you get to the subnet mask value to determine the valid subnets.
Once you verify all of the subnets, you can determine the broadcast address by looking
at the next subnets value. The broadcast address is the number just before the next
subnet number. Once you have the subnet number and broadcast address, the valid
hosts are the numbers in between.

Here are the answers using 255.255.255.192:

1. How many subnet bits are used in this mask?


Answer: 2
22-2=2 subnets
2. How many host bits are available per subnet?
Answer: 6
26-2=62 hosts per subnet
3. What are the subnet addresses?
Answer: 256-192=64 (the first subnet)
64+64=128 (the second subnet)
64+128=192. However, although 192 is the subnet mask value, its not a valid
subnet. The valid subnets are 64 and 128.
4. What is the broadcast address of each subnet?
Answer: 64 is the first subnet and 128 is the second subnet. The broadcast address
is always the number before the next subnet. The broadcast address of the 64
subnet is 127. The broadcast address of the 128 subnet is 191.
5. What is the valid host range of each subnet?
Answer: The valid hosts are the numbers between the subnet number and the mask.
For the 64 subnet, the valid host range is 64-126. For the 128 subnet, the valid host
range is 129-190.

Lets do a second example using the Class C mask of 255.255.255.224. Here are the
answers:

1. How many subnet bits are used in this mask?


Answer: 3 bits or 23-2=6 subnets
2. How many host bits are available per subnet?
Answer: 5 bits or 25-2=30 hosts per subnet
3. What are the subnet addresses?
Answer: 256-224 =32, 64, 96, 128, 160 and 192 (Six subnets found by continuing to
add 32 to itself.)
4. What is the broadcast address of each subnet?
Answer: The broadcast address for the 32 subnet is 63. The broadcast address for
the 64 subnet is 95. The broadcast address for the 96 subnet is 127. The broadcast
address for the 160 subnet is 191. The broadcast address for the 192 subnet is 223
(since 224 is the mask).
5. What is the valid host range of each subnet?
Answer: The valid hosts are the numbers in between the subnet and broadcast
addresses. For example, the 32 subnet valid hosts are 33-62.

Lets do a third example using the Class C mask of 255.255.255.240. Here are the
answers:

1. How many subnet bits are used in this mask?


Answer: 4 bits or 24-2=14 subnets
2. How many host bits are available per subnet?
Answer: 4 bits or 24-2=14 hosts per subnet
3. What are the subnet addresses?
Answer: 256-240 =16, 32, 48, 64, 80, 96, 112, 128, 144. 160, 176, 192, 208 and 224
(14 subnets found by continuing to add 16 to itself.)
4. What is the broadcast address of each subnet?
Answer: Here are some examples of the broadcast address: The broadcast address
for the 16 subnet is 31. The broadcast address for the 32 subnet is 47. The
broadcast address for the 64 subnet is 79. The broadcast address for the 96 subnet
is 111. The broadcast address for the 160 subnet is 175. The broadcast address for
the 192 subnet is 207.
5. What is the valid host range of each subnet?
Answer: The valid hosts are the numbers in between the subnet and broadcast
addresses. The 32 subnet valid hosts are 33-46.

Lets do a fourth example using the Class C mask of 255.255.255.248. Here are the
answers:

1. How many subnet bits are used in this mask?


Answer: 5 bits or 25-2=30 subnets
2. How many host bits are available per subnet?
Answer: 3 bits or 23-2=6 hosts per subnet
3. What are the subnet addresses?
Answer 256-248 =8, 16, 24, 32, 40, 48, and so forth. The last subnet is 240 (30
subnets found by continuing to add 8 to itself).
4. What is the broadcast address of each subnet?
Answer: The broadcast address for the 8 subnet is 15. The broadcast address for
the 16 subnet is 23. The broadcast address for the 48 subnet is 55.
5. What is the valid host range of each subnet?
Answer: The valid hosts are the numbers in between the subnet and broadcast
addresses. For example, the 32 subnet valid hosts are 33-38.

Lets do a fifth example using the Class C mask of 255.255.255.252. Here are the
answers:

1. How many subnet bits are used in this mask?


Answer: 6 bits or 26-2=62 subnets
2. How many host bits are available per subnet?
Answer: 2 bits or 22-2=2 hosts per subnet
3. What are the subnet addresses?
Answer: 256-252 =4, 8, 12, 16, 20, and so forth. The last subnet is 248 (62 subnets
found by continuing to add 4 to itself).
4. What is the broadcast address of each subnet?
Answer: The broadcast address for the 4 subnet is 7. The broadcast address for the
8 subnet is 11. The broadcast address for the 12 subnet is 15. The broadcast
address for the 20 subnet is 23.
5. What is the valid host range of each subnet?
Answer: The valid hosts are the numbers in between the subnet and broadcast
addresses. For example, the 16 subnet valid hosts are 17 and 18.

How do I use this information?


Lets take a look at an example that will highlight how the above information is applied.

A host configuration has an IP configuration of 192.168.10.17 255.255.255.248. What


are the subnet, broadcast address, and host range that this host is a member of? The
answer is: 256-248=8, 16, 24. This host is in the 16 subnet, the broadcast address of
the 16 subnet is 23, and the valid host range is 17-22. Pretty easy!

Here is an explanation of this example: First, I used 256-subnetmask to get the variable
and first subnet. Then I kept adding this number to itself until I passed the host address.
The subnet is the number before the host address, and the broadcast address is the
number right before the next subnet. The valid hosts are the numbers in between the
subnet and broadcast address.

Lets examine a second example. A host configuration has an IP configuration of


192.168.10.37 255.255.255.240. What are the subnet, broadcast address, and host
range this host is a member of? The answer is: 256-240=16, 32, 48. This host is in the
32 subnet, the broadcast address of the 32 subnet is 47, and the valid host range is 33-
46.

Lets go through a third example: A host configuration has an IP configuration of


192.168.10.44 255.255.255.224. What are the subnet, broadcast address, and host
range this host is a member of? The answer is: 256-224=32, 64. This host is in the 32
subnet, the broadcast address of the 32 subnet is 63, and the valid host range is 33-62.

Heres a fourth example: A host configuration has an IP configuration of 192.168.10.17


255.255.255.252. What are the subnet, broadcast address, and host range this host is a
member of? The answer is: 256-252=4, 8, 12, 16, 20. This host is in the 16 subnet, the
broadcast address of the 16 subnet is 19, and the valid host range is 17-18.

Lets go through a final example. A host configuration has an IP configuration of


192.168.10.88 255.255.255.192. What are the subnet, broadcast address and host
range this host is a member of? The answer is: 256-192=64, 128. This host is in the 64
subnet, the broadcast address of the 64 subnet is 127, and the valid host range must be
65-126.

Conclusion
It is important to be able to subnet quickly and efficiently. After studying the examples
presented in this Daily Drill Down, you should be familiar with this process with Class C
addresses. Practice your subnetting as much as possible, and the process will get
easier and easier. In my next Daily Drill Down, Ill take subnetting a step further and
discuss subnetting a Class B network address.
Subnetting a Class B
network address
Subnetting a Class B network can involve some serious
thought! As a network administrator, you'll have to know it
and know it well. Todd Lammle walks you through clear
instructions and simple examples to help you learn this
skill.

In my last Daily Drill Down, we went step-by-step through subnetting a Class C network
address. Be sure you have read the previous two Daily Drill Downs, which discussed IP
addressing and subnetting, before reading this Daily Drill Down.

In this Daily Drill Down, we will continue to subnet IP addresses, but we will use Class B
network addresses. Class B network addresses provide us with more subnet and host
bits to manipulate, which can be fun, not painful, when it is done correctly.

Class B subnets
In my last Daily Drill Down, we borrowed bits from the host portion of a Class C network
address. Class C network addresses only have eight bits to manipulate into subnets.
However, a Class B has 16 bits to play with. This will allow more subnets with more
hosts per subnet than a Class C network ever could.

Table 1 lists all of the possible Class B subnets:

Table 1
Mask Binary Subnets Hosts per subnet
255.255.128.0 10000000.00000000 2 32,766
255.255.192.0 11000000.00000000 2 16,382
255.255.224.0 11100000.00000000 6 8,190
255.255.240.0 11110000.00000000 14 4,094
255.255.248.0 11111000.00000000 30 2,046
255.255.252.0 11111100.00000000 62 1,022
255.255.254.0 11111110.00000000 126 510
255.255.255.0 11111111.00000000 254 254
255.255.255.128 11111111.10000000 510 126
255.255.255.192 11111111.11000000 1022 62
255.255.255.224 11111111.11100000 2,046 30
255.255.255.240 11111111.11110000 4,094 14
255.255.255.248 11111111.11111000 8,190 6
255.255.255.252 11111111.11111100 16,382 2
All possible Class B subnets

There are quite a few more masks we can use with a Class B network address than we
can with a Class C network address. Remember that this is not harder than subnetting
with Class C, but it can get confusing if you dont pay attention to where the subnet bits
and host bits are in a mask. This takes practice!

In this Daily Drill Down, I will use the same techniques I used in the Class C article to
subnet a network. Well start with the Class B subnet mask of 255.255.192.0 and figure
out the subnets, broadcast address, and valid host range. We will answer the same five
questions we answered for the Class C subnet masks:

1. How many subnets does this mask provide?


2. How many hosts per subnet does this mask provide?
3. What are the valid subnets?
4. What is the broadcast address for each subnet?
5. What is the host range of each subnet?

Before we answer these questions, there is one difference you need to be aware of
when subnetting a Class B network address. When subnetting in the third octet, you
need to add the fourth octet. For example, on the 255.255.192.0 mask, the subnetting
will be done in the third octet. To create a valid subnet, you must add the fourth octet of
all 0s and all 1s for the network and broadcast address (0 for all 0s and 255 for all 1s).

Example 1: Answers for the 255.255.192.0 mask

1. 2-2=2 subnets
2. 2-2=16,382 hosts per subnet
3. 256-192=64.0, 128.0
4. Broadcast for the 64.0 subnet is 127.255. Broadcast for the 128.0 subnet is 191.255.
5. The valid hosts are:

Subnet 64.0 128.0


first host 64.1 128.1
last host 127.254 191.254
broadcast 127.255 191.255

Notice that the numbers in the third octet are the same numbers we used in the fourth
octet when subnetting the 192 mask. The only difference is that we add 0 and 255 in the
fourth octet.

For the 64.0 subnet, all the hosts between 64.1 and 127.254 are in the 64 subnet. In the
128.0 subnet, the hosts are 128.1 through 191.254.

I know this is confusing, but I promise if you read this complete Daily Drill Down
carefully, I can make it easier for you.

Work through a few more with me, and it should start to become clearer.

Example 2: 255.255.240.0

1. 2-2=14 subnets
2. 2-2=4094 hosts per subnet
3. 256-240=16.0, 32.0, 48.0, 64.0, etc.
4. Broadcast for the 16.0 subnet is 31.255. Broadcast for the 32.0 subnet is 47.255,
etc.
5. The valid hosts are:

Subnet 16.0 32.0 48.0 64.0


first host 16.1 32.1 48.1 64.1
last host 31.254 47.254 63.254 79.254
broadcast 31.255 47.255 63.255 79.255

Example 3: 255.255.248.0

1. 2-2=30 subnets
2. 2-2=2,046 hosts per subnet
3. 256-248=8.0, 16.0, 24.0, 32.0, 40.0, 48.0, 56.0, 64.0, etc.
4. Broadcast for the 8.0 subnet is 15.255. Broadcast for the 16.0 subnet is 23.255, etc.
5. The valid hosts are:
Subnet 8.0 16.0 24.0 32.0 40.0 48.0 56.0 64.0
first host 8.1 16.1 24.1 32.1 40.1 48.1 56.1 64.1
last host 15.254 23.254 31.254 39.254 47.254 55.254 63.254 71.254
broadcast 15.255 23.255 31.255 39.255 47.255 55.255 63.255 71.255

Example 4: 255.255.252.0

1. 2-2=62 subnets
2. 2-2=1,022 hosts per subnet
3. 256-252=4.0, 8.0, 12.0, 16.0, 20.0, 24.0, 28.0, 32.0, etc.
4. Broadcast for the 4.0 subnet is 7.255. Broadcast for the 8.0 subnet is 11.255, etc.
5. The valid hosts are:

Subnet 4.0 8.0 12.0 16.0 20.0 24.0 28.0 32.0


first host 4.1 8.1 12.1 16.1 20.1 24.1 28.1 32.1
last host 7.254 11.254 15.254 19.254 23.254 27.254 31.254 35.254
broadcast 7.255 11.255 15.255 19.255 23.255 27.255 31.255 35.255

Example 5: 255.255.255.0

1. 2-2=254 subnets
2. 2-2=254 hosts per subnet
3. 256-255=1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, etc.
4. Broadcast for the 1.0 subnet is 1.255. Broadcast for the 2.0 subnet is 2.255, etc.
5. The valid hosts are:

Subnet 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0


first host 1.1 2.1 3.1 4.1 5.1 6.1 7.1 8.1
last host 1.254 21.254 3.254 4.254 5.254 6.254 7.254 8.254
broadcast 1.255 2.255 3.255 4.255 5.255 6.255 7.255 8.255

That last example was pretty simple. I hope you notice a pattern now. All the numbers
were basically the same except we added the fourth octet into the address.

The more difficult process of subnetting a Class B network address is when you start
using bits in the fourth octet for subnetting. For example, what happens when you use
this mask with a Class B network address: 255.255.255.128? Is that valid? Absolutely!
There are nine bits for subnetting and seven bits for hosts. That is 510 subnets, each
with 126 hosts. However, it is the most difficult mask to figure out the valid hosts for.

Example 6: The Class B 255.255.255.128 subnet mask:

1. 2-2=510 subnets
2. 2-2=126 hosts per subnet
3. For the third octet, the mask would be 256-255=1, 2, 3, 4, 5, 6, etc.
4. For the fourth octet, the mask would be 256-128=128, which is one subnet if it is
used. However, if you turn the subnet bit off, the value is 0. This means that for
every subnet in the third octet, the fourth octet has two subnets: 0 and 128, for
example 1.0 and 1.128.
5. Broadcast for the 0.128 subnet is 128.255; the broadcast for the 1.0 subnet is 1.127.
Broadcast for the 1.128 subnet is 1.255, etc.
6. The valid hosts are:

Subnet 0.128 1.0 1.128 2.0 2.128 3.0 3.128 4.0


first host 0.129 1.1 1.129 2.1 2.129 3.1 3.129 4.1
last host 0.254 1.126 1.254 2.126 2.254 3.126 3.254 4.126
broadcast 0.255 1.127 1.255 2.127 2.255 3.127 3.255 4.127

The thing to remember is that for every subnet in the third octet, there are two in the
fourth octet: 0 and 128. For the 0 subnet, the broadcast address is always 127. For the
128 subnet, the broadcast address is always 255.

Lets continue with more subnetting into the fourth octet. This is exactly like subnetting a
Class C network address, but the third octet is part of the subnet address.

Example 7: Class B network 255.255.255.192

1. 2-2=1022 subnets
2. 2-2=62 hosts per subnet
3. 256-255=1.0, 2.0, 3.0, etc. for the third octet. 256-192=64, 128, 192 for the fourth
octet. For every valid subnet in the third octet, we get four subnets in the fourth
octet: 0, 64, 128, and 192.
4. Broadcast for the 1.0 subnet is 1.63, since the next subnet is 1.64. Broadcast for the
1.64 subnet is 1.127, since the next subnet is 1.128. Broadcast for the 1.128 subnet
is 1.191, since the next subnet is 1.192. Broadcast for the 1.192 subnet is 1.255.
5. The valid hosts are as follows:
Subnet 0.64 0.128 0.192 1.0 1.64 1.128 1.192 2.0
first host 0.65 0.129 0.193 1.1 1.65 1.129 1.193 2.1
last host 0.126 0.190 0.254 1.62 1.126 1.190 1.254 2.62
broadcast 0.127 0.191 0.255 1.63 1.127 1.191 1.255 2.63

On this one, the 0 and 192 subnets are valid, since we are using the third octet as well.
The subnet range is 0.64 through 255.128. 0.0 is not valid since no subnet bits are on.
255.192 is not valid because then all subnet bits would be on.

Example 8: Class B network 255.255.255.224

1. 2-2=2046 subnets
2. 2-2=30 hosts per subnet
3. 256-255=1.0, 2.0, 3.0, etc. for the third octet. 256-224=32, 64, 96, 128, 160, 192 for
the subnet value. (For every value in the third octet, we get eight subnets in the
fourth octet: 0, 32, 64, 96, 128, 160, 192, 224.)
4. Broadcast for the 1.0 subnet is 1.63, since the next subnet is 1.64. Broadcast for the
1.64 subnet is 1.127, since the next subnet is 1.128. Broadcast for the 1.128 subnet
is 1.191, since the next subnet is 1.192. Broadcast for the 1.192 subnet is 1.255.
5. The valid hosts are:

Subnet 0.32 0.64 0.96 0.128 0.160 0.192 0.224 1.0


first host 0.33 0.65 0.97 0.129 0.161 0.193 0.225 1.1
last host 0.62 0.94 0.126 0.158 0.190 0.222 0.254 1.30
broadcast 0.63 0.95 0.127 1.159 0.191 0.223 0.255 1.31

For this subnet mask, the 0 and 224 subnets are valid as long as not all subnet bits in
the third octet are off or all subnet bits in the fourth octet are on.

When would we use this valuable information? All the time! For example, if you have a
host configuration of 172.16.10.33 255.255.255.224, what subnet, broadcast address,
and valid host range is this host a member of? (We would solve this question with the
information presented above.)
256-224=32, 64

Bingo! In the fourth octet, the host address is 33. That is between 32 and 64, so the
host is in the 32 subnet, which has a broadcast address of 63, and the valid host range
is 33-62. Easy. Just remember that the subnet is 10.32 because the third octet is part of
the subnet address.

Lets try another one. You have a host configuration of 172.16.10.33 255.255.255.240.
What subnet, broadcast address, and valid host range is this host a member of?

Since we did not go through this mask in this Daily Drill Down, youll have to figure it out
on your own. It is done the same way as all the others.
256-240=16, 32, 48

Bingo! The host is in the 10.32 subnet, which has a broadcast address of 10.47 and a
valid host range of 10.33 through 10.46.

Lets keep going: You have a host configuration of 172.16.10.33 255.255.255.248. What
subnet, broadcast address, and valid host range is this host a member of?
256-248=8, 16, 24, 32, 40

Bingo! The host is in the 10.32 subnet, which has a broadcast address of 10.39 and
valid host range of 10.33 through 10.38. Easy, huh?

One more: You have a host configuration of 172.16.10.17 255.255.255.252. What


subnet, broadcast address, and valid host range is this host a member of?
256-252=4, 8, 12, 16, 20

Bingo! You have a subnet of 10.16, with a broadcast of 10.19 and valid host range of
10.17 through 10.18.

Conclusion
This Daily Drill Down presented a continuation of IP addressing and subnetting, which
has taken many Daily Drill Downs to discuss. I am still not done! My future Daily Drill
Downs will discuss IP routing, which is the process of fragmenting packets of data and
switching them through an internetwork.

To continue on with IP routing, you must have a fundamental understanding of the


devices that work at each layer as well as IP addressing and subnetting. Look back and
read my past Daily Drill Downs that include both Layer 2 and Layer 3 switching. For
more in-depth information, please see my Sybex CCNA Study Guide.
Subnet a Class A network
with ease
Class A subnetting is a form of network addressing
typically reserved for the government and larger
institutions. It can have a large number of unique nodes,
which can prove quite a challenge. Here, Todd Lammle
offers a simple approach to this addressing.

The Class A networking address scheme is designed for the government and large
institutions needing a great deal of unique nodes. Although the Class A network has
only 254 unique network addresses, it can contain approximately 17 million unique
nodes, which can make subnetting such a network a nightmare.

Getting up to speed with subnetting Class A addresses requires a little forethought,


some basic information, and a lot of practice. Here, I will explain Class A subnet masks
and how to assign valid subnets and host addresses to provide flexibility in configuring
your network.

Info on Class B and Class C subnetting


If you need more information on subnetting other types of networks, take a look at Todd
Lammles other subnetting articles: "Subnetting a Class B network
address," and "Subnetting a Class C network address."

The mask
Class A subnet masks must start with 255.0.0.0 at a minimum, because the whole first
octet of an IP address (the IP address describes the specific location on the network) is
used to define the network portion (the network portion describes the street that IP
addresses are located on). Routers use the network portion to send packets through an
internetwork. Routers aren't concerned about host addresses. They need to know only
the street on which hosts are located and that the MAC address is used to find a host
on a LAN. The last three octets of a Class A subnet mask are used to address hosts on
a LAN; the 24 bits you can manipulate however you wish.

If you wanted to create smaller networks (subnetworks) out of a Class A network ID,
youd borrow bits from the host portion of the mask. The more bits you borrow, the more
subnets you can have, but this means fewer hosts per subnet. However, with a Class A
mask, you have 24 bits to manipulate, so this isnt typically a problem.

Table A lists all the available Class A subnet masks:

Table A
Mask Prefix Subnets Hosts
255.0.0.0 (/8) 1 network with 16,777,214 hosts
255.128.0.0 (/9) 2 subnets with 8,388,606 hosts each
255.192.0.0 (/10) 4 subnets with 4,194,302 hosts each
255.224.0.0 (/11) 8 subnets with 2,097,150 hosts each
255.240.0.0 (/12) 16 subnets with 1,048,574 hosts each
255.248.0.0 (/13) 32 subnets with 524,286 hosts each
255.252.0.0 (/14) 64 subnets with 262,142 hosts each
255.254.0.0 (/15) 128 subnets with 131,070 hosts each
255.255.0.0 (/16) 256 subnets with 65,534 hosts each
255.255.128.0 (/17) 512 subnets with 32,766 hosts each
255.255.192.0 (/18) 1,024 subnets with 16,384 hosts each
255.255.224.0 (/19) 2,048 subnets with 8,190 hosts each
255.255.240.0 (/20) 4,096 subnets with 4,094 hosts each
255.255.248.0 (/21) 8,192 subnets with 2,046 hosts each
255.255.252.0 (/22) 16,384 subnets with 1,022 hosts each
255.255.254.0 (/23) 32,768 subnets with 510 hosts each
255.255.255.0 (/24) 65,536 subnets with 254 hosts each
255.255.255.128 (/25) 131,072 subnets with 126 hosts each
255.255.255.192 (/26) 262,144 subnets with 62 hosts each
255.255.255.224 (/27) 524,288 subnets with 30 hosts each
255.255.255.240 (/28) 1,048,576 subnets with 14 hosts each
255.255.255.248 (/29) 2,097,152 subnets with 6 hosts each
255.255.255.252 (/30) 4,194,304 subnets with 2 hosts each

Available Class A subnet masks

Subnet zero
This chart assumes you can use subnet zero. If youre not using subnet zero, subtract
two from each number in the Subnets column in Table A above.

Once you have an idea what your network will look like, write down the number of
physical subnets you have and the number of hosts needed for each subnet. For
example, on a WAN point-to-point link, you need only two IP addresses, so you can use
a /30 mask.

/30
The slash (/) indicates the number of mask bits turned on. It saves you from typing, or
pronouncing, the whole mask. For example, /8 means 255.0.0.0, /16 is 255.255.0.0, and
/24 is 255.255.255.0. You pronounce it as "configure a slash 24 mask on that network."
It's just an easier way of saying "configure a 255.255.255.0 mask on that network."

Figure A is an example of assigning masks on a case-by-case basis or, in this instance,


LAN by LAN. It shows a network with eight LANs and two WANs connected to the
corporate office, along with one additional point-to-point, Fast Ethernet LAN connection
to another building located next to the main corporate office. This figure is an example
of how I would draw out the network.

Figure A
Notice that I indicated the number of host addresses needed for each network connection.

Using this type of drawing, you can now look at the chart and assign a mask that fits
each network. Just remember to keep growth projections in mind.

Classless routingthe practice of assigning different size masks on your network


does not work unless you run a routing protocol that supports prefix routing. RIP version
2, OSPF, and EIGRP are examples of routing protocols that can support classless
routing. Classful routing, on the other hand, means that all hosts have the same size
mask. RIP version 1 and IGRP are classful routing protocols, and neither will work in a
classless environment.

Classless routing
For more information on the protocols supporting classless routing, read these Todd
Lammle articles:

"Configure EIGRP with IP and IPX on Cisco routers"


"Configuring OSPF with multiple areas"
Subnet addresses
Once you have the mask assigned to each network, you must assign the valid subnet
addresses and host ranges to each network. To determine the valid subnets and host
addresses for each network, you need to answer three easy questions:

1. What is the valid subnet address?


2. What is the broadcast address?
3. What is the valid host range?
4. Here are some tips for finding the answers:

Valid subnet address: To figure out the valid subnet address, simply subtract the
subnet mask from 256. For example, if you had a Class A mask of 255.240.0.0, the
equation would be 256-240=16. The number 16 is the first subnet and also your
block size. Keep adding the block size (in this case 16) to itself until you reach the
subnet mask value. The valid subnets in this example are 16, 32, 48, 64, 80, 96,
112, 128, 144, 160, 176, 192, 208, 224. As another example, if you had a Class A
subnet mask of 255.255.240.0, youd use the mask on the second and third octets
minus 256. The second octet would be 256-255=1, 2, 3, etc., all the way to 254; the
third octet would be 256-240=16, 32, 48, etc.
Broadcast address: To determine the broadcast address of each subnet, just
subtract 1 from the next subnet value. For example, within the 16 subnet, the next
subnet is 32, so the broadcast address of the 16 subnet is 31. The broadcast
address for the 32 subnet is 47, because the next subnet is 48. The broadcast
address for the 48 subnet is 63, because the next subnet is 64.
Valid host range: The valid hosts are the numbers between the subnet address
and the broadcast address. For the 16 subnet, the valid host range you can assign
on a network is 17-30 because the subnet number is 16 and the broadcast address
is 31. For the 32 subnet, the valid host range is 33 to 46 because the subnet number
is 32 and the broadcast address is 47. You cant use the subnet number and
broadcast addresses as valid host addresses.

Assigning valid host addresses


Using Figure A as an example, lets assign networks and valid host ranges to each
network. First, create another table of usable block sizes. Figure B shows how to
assign block sizes to your network on a granular basis.

Figure B
In this example, the network ID used for the entire internetwork is 10.1.1.0.

You can build this network in many different ways, but I prefer to start with the WAN
links (block size of four) on the bottom and work my way up, while the largest LANs start
at the top and work toward the bottom. The network will work any way you construct it,
as long as you configure your block sizes correctly on the chart.

Now you have to assign the valid host ID to each LAN and WAN, and your network
should be up and running. It would be a good idea for you to use EIGRP as your routing
protocol to help you get this up and running quickly.

Assigning other Class A masks


Figure B is an example of variable length subnet masks and is typically the easiest way
youll assign IP addresses on an internetwork. However, lets go through a few practice
examples of subnetting Class A masks, to make sure you really understand the
process.
Practice Class A mask 255.240.0.0 (/12)
This mask provides you with only four subnet bits, or 16 subnets (14 if youre not using
subnet zero) with 1,048,574 hosts each. The valid subnets are 256-240=16, 32, 48, 64,
80, etc., all the way to 224. (Subnets 0 and 240 are available if youre using subnet
zero.)

The first subnet, assuming subnet zero, is:

Subnet: 10.0.0.0
Broadcast: 10.15.255.255
Valid host range: 10.0.0.1 through 10.15.255.254

The last subnet, assuming subnet zero, is:

Subnet: 10.240.0.0
Broadcast: 10.255.255.255
Valid host range: 10.240.0.1 through 10.255.255.254

Practice Class A mask 255.255.128.0


This mask provides you with nine bits of subnetting and 15 host bits (/17). This gives
you 512 subnets with 32,766 hosts each. The second octet is 256-255=1, 2, 3, etc., all
the way to 255. Zero is available in the second octet if you have either a subnet bit on in
the third octet or are, of course, using subnet zero.

The first available subnet is:

Subnet: 10.0.0.0
Broadcast: 10.0.127.255
Valid host range: 10.0.0.1 through 10.0.127.254

You must remember that the third octet is using only one subnet bit. This bit can be
either off or on; if it is off, the subnet is 0. If it is on, the subnet is 128.

Heres an example of the 10.0.128.0 subnet:

Subnet: 10.0.128.0
Broadcast: 10.0.255.255
Valid host range: 10.0.128.1 through 10.0.255.254
The last available subnet is:

Subnet: 10.255.128.0
Broadcast: 10.255.255.255
Valid host range: 10.255.128.1 through 10.255.255.254

Practice Class A mask 255.255.255.252


This mask is the easiest to subnet. Even if it werent a Class A mask, and you used this
mask with a Class B or Class C mask, youd always have only two available host IDs.
The reason you would use this with a Class A mask is because it can give you up to
4,194,304 subnets with two hosts each. This is a perfect mask for a point-to-point link,
so I suggest always saving a few block sizes of four (/30) masks for use on WANs and
point-to-point LAN connections.

If you use the 10.2.3.0 network, your subnets are always 2.3 in the second and third
octets, respectively. But the fourth octet is where it changes, as in 256-252=4, 8, 12, 16,
20, 24, 28, etc., all the way to 248. If you use subnet zero, your first subnets are 0, and
your last subnet is 255.

An example of the 10.2.3.0 subnet is:

Subnet: 10.2.3.0
Broadcast: 10.2.3.3
Valid hosts: 10.2.3.1 and 10.2.3.2

An example of the 10.2.3.252 subnet is:

Subnet: 10.2.3.252
Broadcast: 10.2.3.255
Valid hosts: 10.2.3.253 and 10.2.3.254

Using Class A network IDs


You should probably use Class A network IDs in most networks these days. Why?
Because the 10.0.0.0 network ID cannot be routed on the Internet. These private IP
address ranges allow you to create a more secure network and use port address
translation on your router to the Internet to do the translation for you. I suggest 10.0.0.0
to address your network because it provides the most flexibility for configuring networks.

Das könnte Ihnen auch gefallen