Every time I try to understand subnetting I am able to so but quickly forget
it once I haven't thought about it in a while. (Kind of like Calculus). This
time, I decided to create a table that would help me out. I'm sure I'm
duplicating work but I have never been able to find this information
presented in this manner. With this document you can figure out how to subnet
with out having to know the underlying binary arithmetic.
Example:
You have a registered class C network with the address range
206.153.120.0-255. (very hard to get nowadays) This is all your are given by
your ISP and you have to work with it. You want to create a WAN and distribut
this network to other parts of your company. The way to do it by looking at
the chart below is to use the subnet mask 255.255.255.224. This will allow
you 8 different subnets under 206.153.120 and you will be able to put up to
30 individual addresses on that network. Configuring the router to do this is
another story....
There are also cases where you can subnet a class B address (you can play with
the last two octets not just the last one) but people that have class B
networks usually don't have to subnet unless they expect to have more than 254
IP addresses per site. In that case, you can multiply your possiblilities by
254 because each combination can have up 254 different addresses in the last
(non subnetted) octet. Subnetting the third octet the way you would with a
class B with a mask of 224 gives you:
8 subnets
30 * 254 = 7620 ip addresses/subnet
you only get 8 subnets instead of 254 but you can fit 7620 addresses in each
subnet as opposed to 254.
Subnetting tables
=================
binary subnet decimal subnet
-------------- --------------
100000000 128 2 subnetworks
126 addresses/subnetwork
address ranges broadcast zero address
-------------- --------- ------------
1-126 127 0
129-254 255 128
===========================================================================
binary subnet decimal subnet
------------- --------------
11000000 192 4 subnetworks
62 addresses/subnetwork
address ranges broadcast zero address
-------------- --------- ------------
1-62 63 0
65-126 127 64
129-190 191 128
192-254 255 192
===========================================================================
binary subnet decimal subnet
------------- --------------
11100000 224 8 subnetworks
30 addresses/subnetwork
address ranges broadcast zero address
-------------- --------- ------------
1-30 31 0
33-62 63 32
65-94 95 64
95-126 127 96
129-158 159 128
161-190 191 160
193-222 223 192
225-254 255 224
===========================================================================
Binary subnet Decimal Subnet
------------- --------------
11110000 240 16 subnetworks
14 addresses/subnetwork
address ranges broadcast zero address
--------- --------- ------------
1-14 15 0
17-30 31 16
33-46 47 32
49-62 63 48
65-78 79 64
81-94 95 80
97-110 111 96
113-126 127 112
129-142 143 128
145-158 159 144
161-174 175 160
177-190 191 176
192-206 207 192
209-222 223 208
225-238 239 224
241-254 255 240
===========================================================================
Binary subnet Decimal Subnet
------------- --------------
11111000 248 32 subnetworks
6 addresses/subnetwork
address ranges broadcast zero address
-------------- --------- ------------
1-6 7 0
9-14 15 8
17-22 23 16
25-30 31 24
33-38 39 32
41-46 47 40
49-54 55 48
57-62 63 56
65-70 71 64
73-78 79 72
81-86 87 80
89-94 95 88
97-102 103 96
105-110 111 104
113-118 119 112
121-126 127 120
129-134 135 128
137-142 143 136
145-150 151 144
153-158 159 152
161-166 167 160
169-174 175 168
177-182 183 176
185-190 191 184
193-198 199 192
201-206 207 200
209-214 215 208
217-222 223 216
225-230 231 224
233-238 239 232
241-246 247 240
249-254 255 248
===========================================================================
There's another case where the subnet mask is 252 this allows for 64
subnetworks but only 2 addresses/subnetwork. I don't know if it would be
useful outside of a lab so I'm not going to go through the trouble of making
a table.
===========================================================================
Notes
-----
- broadcast is used to set the broadcast address for broadcast packets. This
is if broadcast packets are to stay within a specific subnet. If you use 255
for the broadcast address then it will traverse subnets (assuming the router
will forward broadcasts).
- The zero address is unused. It's like using a zero address when not
subnetting. Cisco IOS has an option for allowing the zero address but it's a
non-standard and confusing thing and to be avoided. Other IP stacks may get
confused.