30 Mar 2013
kenglong@gmail.com
<-- Back to problem description page
This exercise requires us to create an efficient addressing plan using variable length subnetting given the following:
192.168.1.0 /24
The way to approach this is to start with the subnet that requires the most hosts, 60.
Since 60 is not an even power of 2,
use 64 which is 26.
32 – 6 = 26 network + subnet bits, or /26.
255.255.255.11000000
Convert the partial binary number above to decimal. to give us a mask of 255.255.255.192
.
Notice the first "one" from the right. It's in the "64" placeholder making our magic number 64.
So our first two subnets will be:
192.168.1.0 /26
(We calculate this one only to make it easy to get the broadcast,
192.168.1.64
last host and first host as well as the network number to use for the next subnet calculation.)
Now let’s work on the next subnet which requires 25 hosts. We start with the network 192.168.1.64
.
Since 25 is not an even power of two, we’ll use 32 which is 25.
32 – 5 = 27 so our cidr
is /27.
255.255.255.11100000
That gives us a mask of 255.255.255.224
with a magic number of 32. Our next two subnets will be:
192.168.1.64 /27
(We calculate this one only to make it easy to get the broadcast,
192.168.1.96
last host and first host as well as the network number to use for the next subnet calculation.)
The next one requires 10 hosts. Since 10 is not an even power of 2, we use 16 which is 24.
32 – 4 = 28 so our cidr is /28.
255.255.255.11110000
That gives us a mask of 255.255.255.240
with a magic number of 16. Our next two subnets will be:
192.168.1.96 /28
(We calculate this one only to make it easy to get the broadcast,
192.168.1.112
last host and first host as well as the network number to use for the next subnet calculation.)
Our next subnet requires 7 hosts. Since 7 is not an even power of 2, we will use 8 which is 23.
32 – 3 = 29 so our cidr is /29.
255.255.255.11111000
That gives us a mask of 255.255.255.248
with a magic number of 8. Our next two subnets will be:
192.168.1.112 /29
(We calculate this one only to make it easy to get the broadcast,
192.168.1.120
last host and first host as well as the network number to use for the next subnet calculation.)
Lastly, we need three subnets with two hosts each for our router interconnections. We start with the
network 192.168.1.120
.
Two is an even power of two so we can use it directly.
32 – 2 = 30 so our cidr is /30.
255.255.255.11111100
That gives us a
mask 255.255.255.252
with a magic number of 4. Our subnets will be:
192.168.1.120 /30
(We calculate this one only to make it easy to get the broadcast,
192.168.1.124
192.168.1.128
192.168.1.132
last host and first host.)