Está en la página 1de 24

Fast and Easy Subnetting

Marc Khayat, Technical Advocacy Team makhayat@cisco.com

May 2011

Number of required subnets


Number of required hosts per subnet

2011 Cisco and/or its affiliates. All rights reserved.

Using the numerical calculations


Using the graphical representation

2011 Cisco and/or its affiliates. All rights reserved.

Numerical Calculations
Network size is the number of IP addresses in a subnet, including the

network ID and the broadcast address


Magic nb is the same as the network size if prefix > /24 Magic nb should always be between 1 and 255. If greater than 255,

divide by 256. If smaller than 1, multiply by 256.


Every time you divide by 256, you move 1 octet to the left Every time you multiply by 256, you move 1 octet to the right Everything is a multiple of the magic nb (therefore, the name )

Dont bother googling the term magic nb

2011 Cisco and/or its affiliates. All rights reserved.

Numerical Calculations
Nb of required subnets should be an exponential multiple of 2 (so, 2, 4,

8, 16, 32, etc.). If not, then round up.


To get the magic nb, few easy steps: 1. 2. 3. 4. Identify the first non-255 number in the mask Subtract that number from 256 Divide the outcome by the number of required subnets Thats your magic nb!

2011 Cisco and/or its affiliates. All rights reserved.

Numerical Calculations
Required number of subnets 5 (should be really looking at 8)
Mask: (/24) 255.255.255.0 First non-255 number is 0 256 0 = 256 256 / 8 = 32 (thats the magic number) Mask: (/16) 255.255.0.0 First non-255 number is 0 256 0 = 256 256 / 8 = 32 (thats the magic number)

On the 4th octet

On the 3rd octet

Mask: (/20) 255.255.240.0 First non-255 number is 240 256 240 = 16 16 / 8 = 2 (thats the magic number)

On the 3rd octet

2011 Cisco and/or its affiliates. All rights reserved.

Numerical Calculations
Required number of subnets 12 (should be really looking at 16)
Mask: (/25) 255.255.255.128 First non-255 number is 128 256 128 = 128 128 / 16 = 8 (thats the magic number) Mask: (/20) 255.255.240.0 First non-255 number is 240 256 240 = 16 16 / 16 = 1 (thats the magic number)

On the 4th octet

On the 3rd octet

Mask: (/21) 255.255.248.0 First non-255 number is 248 Started on the 3rd but moved to the 4th octet 256 248 = 8 8 / 16 = 0.5 * 256 = 128 (thats the magic number)

2011 Cisco and/or its affiliates. All rights reserved.

Numerical Calculations
Simply add the magic nb to the initial network. Example: subnetting

192.168.252.0 255.255.252.0 (/22) into 2, 4 or 8 subnets:


2 Subnets
Magic Nb = (256-252)/2 = 2 192.168.252.0 192.168.254.0

4 Subnets
Magic Nb = (256-252)/4 = 1 192.168.252.0 192.168.253.0 192.168.254.0 192.168.255.0

8 Subnets
Magic Nb = (256-252)/8 = 128 (multiplied by 256) 192.168.252.0 192.168.252.128 192.168.253.0 192.168.253.128 192.168.254.0 192.168.254.128

192.168.255.0
192.168.255.128
2011 Cisco and/or its affiliates. All rights reserved. 8

Numerical Calculations
Subtract the magic number from 256. So to continue with the previous

example of subnetting 192.168.252.0/22:

2 Subnets Magic Nb = 2 (3rd octet) 256 2 = 254 255.255.254.0 (/23)

4 Subnets Magic Nb = 1 (3rd octet) 256 1 = 255 255.255.255.0 (/24)

8 Subnets Magic Nb = 128 (4th octet) 256 128 = 128 255.255.255.128 (/25)

2011 Cisco and/or its affiliates. All rights reserved.

Numerical Calculations
With a subnet mask of 255.255.255.224, all network IDs would be a

multiple of (256 224 = 32), 4th octet, so x.x.x.0, .32, .64, , .224

With a subnet mask of 255.255.128.0, all network IDs would be a

multiple of (256 128 = 128), 3rd octet, so x.x.0.0, .128.0

2011 Cisco and/or its affiliates. All rights reserved.

10

Numerical Calculations
Subnet 192.168.16.0/20 into networks of 4 subnets

/20 => 255.255.240.0 => 256 240 = 16 16 / 4 = 4 (magic number, on the 3rd octet) Networks are: 192.168.16.0, 192.168.20.0, 192.168.24.0,192.168.28.0 Mask is 256 4 = 252 => 255.255.252.0 or /22

2011 Cisco and/or its affiliates. All rights reserved.

11

Numerical Calculations
1st and foremost: add the 2 IPs of network ID and broadcast address
Look for the closest exponentional multiple of 2 Thats your network size. Continue as previously explained.

2011 Cisco and/or its affiliates. All rights reserved.

12

Numerical Calculations
Subnet 192.168.16.0/20 into networks of 700 hosts per subnet

700 => 702 => 1024 (network size) 1024 / 256 = 4 (magic number, on the 3rd octet) Networks are: 192.168.16.0, 192.168.20.0, 192.168.24.0,192.168.28.0 Mask is 256 4 = 252 => 255.255.252.0 or /22

2011 Cisco and/or its affiliates. All rights reserved.

13

Numerical Calculations
123.45.164.255/22: network, broadcast or valid host? If broadcast or

valid host address, what is the network address?

100.198.7.64/18: network, broadcast or valid host? If broadcast or valid

host address, what is the network address?

Hint: from prefix, get mask, then get magic number, then see the closest

multiple of that number and match it to the appropriate value in the address provided above.

2011 Cisco and/or its affiliates. All rights reserved.

14

Numerical Calculations
It gets a little bit confusing when it is requested to subnet a network into

several subnets, each with a different size.

So, lets start with an example!

2011 Cisco and/or its affiliates. All rights reserved.

15

Numerical Calculations
192.168.1.0/24 to be subnetted into A (100 hosts), B (40 hosts), C (10

hosts), D (2 hosts).
Subnet Nb of Net Hosts Size A 100 128 Magic Mask Nb (4th octet) 128 Prefix Subnet address 192.168.1.0

256-128=128 /25

B
C D

40
10 2

64
16 4

64
16 4

256-64=192
256-16=240 256-4=252

/26
/28 /30

192.168.1.(0+128=128)
192.168.1.(128+64=192) 192.168.1.(192+16=208)

Remember to always start with the largest network first!


2011 Cisco and/or its affiliates. All rights reserved. 16

Numerical Calculations
For subnet A, start from the initial network address (192.168.1.0). The

next network would be a multiple of the magic nb, as explained before. So, 192.168.1.128. Remember that were working on the 4th octet;
For subnet B, the address is 192.168.1.128. The next network would be

a multiple of the magic nb, so we add 64 to 128. So, the next network is: 192.168.1.192.
For subnet C, address is 192.168.1.192. For the next network, we add

the magic nb (16) to the current address, so 192.168.1.208.


For subnet D, address is 192.168.1.208.

The next network and all remaining addresses are free

(192.168.1.212 192.168.1.255)

2011 Cisco and/or its affiliates. All rights reserved.

17

Numerical Calculations
192.168.160.0/19 to be subnetted into A (2000 hosts), B (500 hosts), C

(100 hosts), D (4 hosts).


Subnet Nb of Net Magic Nb Hosts Size A 2000 Mask Prefix Subnet address /21 192.168.160.0

2048 2048/256=8 256-8=248 (3rd octet)

B
C D

500
100 4

512
128 8

512/256=2
128 8

256-2=254 (3rd octet)

/23

192.168.(160+8=168).0
192.168.(168+2=170).0 192.168.170.(0+128)

256-128=128 /25 (4th octet) 256-8=248 (4th octet) /29

Free addresses: 192.168.170.(128+8) 192.168.191.255.


2011 Cisco and/or its affiliates. All rights reserved. 18

Magic Number section end


Questions?

2011 Cisco and/or its affiliates. All rights reserved.

19

Graphical Representation
Graphically map addresses of an octet
Very easy to operate within one octet Rule of thumb: always divide in half Will ensure that you wont waste/forget networks

Step 1: identify your magic numbers (already know how to do it) Step 2: Segment and reserve networks on the bargraph starting with the

largest network first.


Step 3: Youre done!

2011 Cisco and/or its affiliates. All rights reserved.

20

Graphical Representation
The bargraph shows a complete octet (from 0 till
0 128

255), so 256 values


You are only allowed to split a segment in half Golden rule still applies: always start with the

largest network first


Choose the subnet locations according to needs
64

4 32 256 16
2011 Cisco and/or its affiliates. All rights reserved. 21

Graphical Representation
0

Subnet 192.168.10.0/24 into:

A (100 hosts), B (20 hosts), C (10 hosts)


Subnet A B Magic Nb 128 32 Subnet ID 192.168.10.0 /25 192.168.10.128 /27 of 256 Width
This represents the 4 octet
128

A (128)

C
FREE

16

192.168.10.160 /28th
192.168.10.176

B (32)
160

C (16)
176

Width of 32 Width of 16 Width of 128

192.168.10.255
Width of 64
255
2011 Cisco and/or its affiliates. All rights reserved.

FREE Addresses

22

Graphical representation section end


Questions?

2011 Cisco and/or its affiliates. All rights reserved.

23

Thank you.

También podría gustarte