You are on page 1of 37

# Subnetting & Supernetting

Marc Khayat, Technical Advocacy Team makhayat@cisco.com

October 2011

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

All webinars are available at http://lms.netacad.net/course/view.php?id=1201

2

Part I - Subnetting

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

All webinars are available at http://lms.netacad.net/course/view.php?id=1201

3

net/course/view.netacad. All rights reserved.php?id=1201 4 .• Number of required subnets • Number of required hosts per subnet © 2011 Cisco and/or its affiliates. All webinars are available at http://lms.

All rights reserved. All webinars are available at http://lms.© 2011 Cisco and/or its affiliates.php?id=1201 5 .net/course/view.netacad.

netacad.net/course/view. All rights reserved.• Using the numerical calculations • Using the graphical representation © 2011 Cisco and/or its affiliates. All webinars are available at http://lms.php?id=1201 6 .

including the network ID and the broadcast address • Magic nb is the same as the network size if prefix > /24 • Magic nb must always be between 1 and 255. All rights reserved. multiply by 256. the name ) • Don’t bother googling the term “magic nb”  © 2011 Cisco and/or its affiliates. • Every time you divide by 256. you move 1 octet to the right • Everything is a multiple of the magic nb (therefore. divide by 256.netacad. If greater than 255. you move 1 octet to the left • Every time you multiply by 256.Numerical Calculations • Network size is the number of IP addresses in a subnet. All webinars are available at http://lms. If smaller than 1.net/course/view.php?id=1201 7 .

then round up. 4. etc. 4. 8.net/course/view.). 16.php?id=1201 8 . Identify the first non-255 number in the mask Subtract that number from 256 Divide the outcome by the number of required subnets That’s your magic nb! © 2011 Cisco and/or its affiliates. 2. few easy steps: 1. 2. All webinars are available at http://lms.netacad. 3. If not. • To get the magic nb.Numerical Calculations • Nb of required subnets should be an exponential multiple of 2 (so. 32. All rights reserved.

0.255.240.0 First non-255 number is 0 256 – 0 = 256 256 / 8 = 32 (that’s the magic number) • Mask: (/20) 255. All webinars are available at http://lms.php?id=1201 9 .net/course/view.255.Numerical Calculations • Required number of subnets 5 (should be really looking at 8) • Mask: (/24) 255.255.255.0 First non-255 number is 240 256 – 240 = 16 16 / 8 = 2 (that’s the magic number) On the 4th octet On the 3rd octet On the 3rd octet © 2011 Cisco and/or its affiliates. All rights reserved.0 First non-255 number is 0 256 – 0 = 256 256 / 8 = 32 (that’s the magic number) • Mask: (/16) 255.netacad.

All rights reserved.240.0 First non-255 number is 240 256 – 240 = 16 16 / 16 = 1 (that’s the magic number) On the 4th octet On the 3rd octet • Mask: (/21) 255.0 First non-255 number is 248 Started on the 3rd but moved to the 4th octet 256 – 248 = 8 8 / 16 = 0.128 First non-255 number is 128 256 – 128 = 128 128 / 16 = 8 (that’s the magic number) • Mask: (/20) 255.5 * 256 = 128 (that’s the magic number) © 2011 Cisco and/or its affiliates.255.248.php?id=1201 10 .Numerical Calculations • Required number of subnets 12 (should be really looking at 16) • Mask: (/25) 255.255.255.net/course/view.255.netacad. All webinars are available at http://lms.

168.253.253.0 (/22) into 2.128 © 2011 Cisco and/or its affiliates.168.255.0 192.168.php?id=1201 11 .0 192. 4 or 8 subnets: 2 Subnets Magic Nb = (256-252)/2 = 2 4 Subnets Magic Nb = (256-252)/4 = 1 8 Subnets Magic Nb = (256-252)/8 = 128 (multiplied by 256) 192. All webinars are available at http://lms.254.252.0 192. All rights reserved.128 192.168.168.254.168.253.net/course/view.252.252.0 192.128 192.0 192.252.Numerical Calculations • Simply add the magic nb to the initial network.0 192.168.168.0 255.255.255.168.0 192.0 192.252.0 192.254.0 192.168.168.168.255.168.netacad.128 192.168.168.254.252. Example: subnetting 192.

255.254.255.php?id=1201 12 .0/22: 2 Subnets Magic Nb = 2 (3rd octet) 256 – 2 = 254 4 Subnets Magic Nb = 1 (3rd octet) 256 – 1 = 255 8 Subnets Magic Nb = 128 (4th octet) 256 – 128 = 128 255.255.Numerical Calculations • Subtract the magic number from 256. All rights reserved.128 (/25) © 2011 Cisco and/or its affiliates.netacad.255. So to continue with the previous example of subnetting 192.252.0 (/24) 255.168.0 (/23) 255.255.net/course/view. All webinars are available at http://lms.

net/course/view.128.x.x. .php?id=1201 13 .0.0. .Numerical Calculations • With a subnet mask of 255. All rights reserved.32.netacad.0 © 2011 Cisco and/or its affiliates.224. all network IDs would be a multiple of (256 – 128 = 128).128.0.255. . 4th octet. .x.255. all network IDs would be a multiple of (256 – 224 = 32).0. All webinars are available at http://lms. 3rd octet. ….255.224 • With a subnet mask of 255. so x. so x.64.

0 • Mask is 256 – 4 = 252 => 255.0 => 256 – 240 = 16 • 16 / 4 = 4 (magic number.192. All rights reserved.0.0. All webinars are available at http://lms.168.24.16. 192.255.240.255. on the 3rd octet) • Networks are: 192.28.168.168.net/course/view.168.netacad.20.252.php?id=1201 14 .168.0.0 or /22 © 2011 Cisco and/or its affiliates.0/20 into networks of 4 subnets • /20 => 255.Numerical Calculations • Subnet 192.16. 192.

Numerical Calculations • 1st and foremost: add the 2 IPs of network ID and broadcast address • Look for the closest exponentional multiple of 2 • That’s your network size. All webinars are available at http://lms. © 2011 Cisco and/or its affiliates.netacad. • Continue as previously explained.net/course/view.php?id=1201 15 . All rights reserved.

192.net/course/view.20. 192.168.28.252.192. All webinars are available at http://lms.0 • Mask is 256 – 4 = 252 => 255.168.netacad.0/20 into networks of 700 hosts per subnet • 700 => 702 => 1024 (network size) • 1024 / 256 = 4 (magic number.php?id=1201 16 .168.0.16.0.255.16.0.24. All rights reserved.Numerical Calculations • Subnet 192.0 or /22 © 2011 Cisco and/or its affiliates.168.168. on the 3rd octet) • Networks are: 192.

what is the network address? Answer: valid host.164. then get magic number. broadcast or valid host? If broadcast or valid host address. © 2011 Cisco and/or its affiliates.netacad.255/22: network.45.7. All rights reserved.Numerical Calculations • 123. network address is 100. network address is 123.64/18: network. then see the closest multiple of that number and match it to the appropriate value in the address provided above.0/22 • 100.198.45. get mask. All webinars are available at http://lms. broadcast or valid host? If broadcast or valid host address.net/course/view.php?id=1201 17 .164.0/18 • Hint: from prefix. what is the network address? Answer: valid host.198.0.

Numerical Calculations • It gets a little bit confusing when it is requested to subnet a network into several subnets.netacad. let’s start with an example! • VLSM = Variable Length Subnet Mask © 2011 Cisco and/or its affiliates. All webinars are available at http://lms. each with a different size.php?id=1201 18 .net/course/view. All rights reserved. • So.

168.0/24 to be subnetted into A (100 hosts).Numerical Calculations • 192.1.0 192. C (10 hosts).168. All webinars are available at http://lms.net/course/view. B (40 hosts).1.netacad. All rights reserved.(0+128=128) 192.168.168. Subnet Nb of Net Hosts Size Magic Mask Nb (4th octet) Prefix Subnet address A B C D 100 40 10 2 128 64 16 4 128 64 16 4 256-128=128 /25 256-64=192 256-16=240 256-4=252 /26 /28 /30 192.php?id=1201 19 . D (2 hosts).(192+16=208) • Remember to always start with the largest network first! © 2011 Cisco and/or its affiliates.1.(128+64=192) 192.168.1.1.

For the next network. • For subnet D.0).net/course/view. All rights reserved.Numerical Calculations • For subnet A. So.1.1.168.212  192. • For subnet B. All webinars are available at http://lms.208. So.168. start from the initial network address (192.php?id=1201 20 .255) © 2011 Cisco and/or its affiliates.208. Remember that we’re working on the 4th octet.netacad. so 192.1.168.1. address is 192.192. The next network would be a multiple of the magic nb. • The next network and all remaining addresses are free (192. we add the magic nb (16) to the current address. The next network would be a multiple of the magic nb. so we add 64 to 128.168. address is 192. the address is 192.1.1.192.1.168.168. the next network is: 192.1. • For subnet C.128.168.168.168.1.128. 192. as explained before.

All webinars are available at http://lms.(168+2=170).0 192.0 192.(0+128) 256-128=128 /25 (4th octet) 256-8=248 (4th octet) /29 • Free addresses: 192. © 2011 Cisco and/or its affiliates.168.(160+8=168).0/19 to be subnetted into A (2000 hosts).0 192.netacad. All rights reserved. D (4 hosts). Subnet Nb of Net Hosts Size Magic Nb Mask Prefix Subnet address A B C D 2000 500 100 4 2048 2048/256=8 256-8=248 (3rd octet) 512 128 8 512/256=2 128 8 256-2=254 (3rd octet) /21 /23 192.168.168.168.170.191.168.net/course/view. C (100 hosts).php?id=1201 21 .170.Numerical Calculations • 192.168. B (500 hosts).(128+8)  192.255.160.160.168.

All rights reserved.php?id=1201 22 .net/course/view. All webinars are available at http://lms.Numerical Calculations – section end Questions? © 2011 Cisco and/or its affiliates.netacad.

netacad. All webinars are available at http://lms.php?id=1201 23 . All rights reserved. • You’re done! Step 3 © 2011 Cisco and/or its affiliates.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 won’t waste/forget networks Step 1 Step 2 • Identify your magic numbers (already know how to do it) • Segment and reserve networks on the bar graph starting with the largest network first.net/course/view.

net/course/view. so 256 values • You are only allowed to split a segment in half 128 • Golden rule still applies: always start with the largest network first • Choose the subnet locations according to the requirements 8 64 4 32 256 16 © 2011 Cisco and/or its affiliates. All webinars are available at http://lms.php?id=1201 24 .netacad.Graphical Representation • The bargraph shows a complete octet (from 0 till 0 255). All rights reserved.

168.10.168.168. C (10 hosts) All on the 4th octet.255 Width of 64 255 © 2011 Cisco and/or its affiliates.Graphical Representation 0 • Subnet 192.10.10.0 /25 of 256 Width 192.160 /28 4th C (16) 176 Width of 32 192. Subnet A B C FREE Magic Nb 128 32 16 Subnet ID 192.168.php?id=1201 25 .10.net/course/view. B (20 hosts).128 /27 This represents the 128 A (128) B (32) octet 160 192. FREE Addresses All webinars are available at http://lms.0/24 into: A (100 hosts).176 Width of 16 Width of 128 192. All rights reserved.168.168.netacad.10.10.

Graphical Representation – section end Questions? © 2011 Cisco and/or its affiliates.netacad. All webinars are available at http://lms.net/course/view.php?id=1201 26 . All rights reserved.

php?id=1201 27 .net/course/view.Supernetting © 2011 Cisco and/or its affiliates. All rights reserved. All webinars are available at http://lms.Part II .netacad.

net/course/view.© 2011 Cisco and/or its affiliates. All webinars are available at http://lms.php?id=1201 28 .netacad. All rights reserved.

php?id=1201 29 . © 2011 Cisco and/or its affiliates.netacad.net/course/view. these are the reverse methods of those of subnetting.• Using the numerical calculations • Using the graphical representation • Actually. All rights reserved. All webinars are available at http://lms.

• To get the mask. 32. 4. If not. 2.php?id=1201 30 .net/course/view. © 2011 Cisco and/or its affiliates. etc. then round up. All rights reserved.) • Has to start from a multiple of that number. 16.Numerical Calculations • Look for the number that encompasses all subnets • Must be an exponential multiple of 2 (so. All webinars are available at http://lms.netacad. 8. deduct this number from 256 on the appropriate octet.

php?id=1201 31 .0/24.netacad.255.168. All rights reserved.255.168. 192.0.0 255. Supernet address is 192. Supernet address is 192.224.0 255.168. All webinars are available at http://lms.168.0 255.124.168.Numerical Calculations • Networks: 192.168.0 © 2011 Cisco and/or its affiliates.0 • Networks: 192. 192. 192.96.0/24.168. starts from 96.0/22.23.96.25.120. 192.0/21. at 3rd octet.2.29. at 3rd octet.0/20.0/24.0/23 • Number is 32. 192.0/24 • Number is 4.168.168.0/24 • Number is 16.252.3.16.0/24.168.112. starts from 0.240.0/24.1.net/course/view.27. Supernet address is 192.168. starts from 16.168.255. 192.168.0 • Networks: 192. 192.168. at 3rd octet. 192.

Numerical Calculations – section end Questions? © 2011 Cisco and/or its affiliates.php?id=1201 32 .netacad.net/course/view. All webinars are available at http://lms. All rights reserved.

php?id=1201 33 .net/course/view.Graphical Representation • Very easy to operate within one octet • Map subnets to the famous bar graph • Stack networks onto each other. in order • Supernet should be a number that: • Is an exponential multiple of 2 • Has to start from a multiple of that number. then round up. All webinars are available at http://lms.netacad. 8 64 0 128 4 32 256 16 © 2011 Cisco and/or its affiliates. All rights reserved. If not.

php?id=1201 34 .128 /27 192.0/24 160 C (16) 176 192 FREE Addresses 255 © 2011 Cisco and/or its affiliates.160 /28 128 A (128) B (32) Supernet address: 192.net/course/view.168.168.10. All rights reserved. All webinars are available at http://lms.10.10.168.Graphical Representation 0 Subnet A B C Net Size 128 32 16 Subnet ID 192.10.netacad.0 /25 192.168.

0 /24 192.10.14.12.net/course/view.0/21 FREE 10 A (1) 11 12 FREE B (2) 14 C (1) 15 255 16 © 2011 Cisco and/or its affiliates. FREE 35 All webinars are available at http://lms.0 /23 192.168.168.php?id=1201 . All rights reserved.168.netacad.0 /24 128 8 64 Supernet address: 192.8.168.Graphical Representation 0 0 16 32 Subnet A B C Net Size 1 2 1 Subnet ID 192.

php?id=1201 36 .net/course/view. All webinars are available at http://lms.Graphical Representation – section end Questions? © 2011 Cisco and/or its affiliates.netacad. All rights reserved.

.Thank you.