IP Addressing And Subnetting - Leaman

Transcription

10110101000010110010101001101001010010IP AddressingandSubnettingWorkbookVersion 2.0Instructor’s Edition1111111010010101000110111101001110000110

IP Address ClassesClass A1 – 127(Network 127 is reserved for loopback and internal testing)00000000.00000000.00000000.00000000Leading bit pattern0Network .Host.Host.HostClass B128 – 191Leading bit pattern1010000000.00000000.00000000.00000000Class C192 – 223Leading bit pattern11011000000.00000000.00000000.00000000Class D224 – 239(Reserved for multicast)Class E240 – 255(Reserved for experimental, used for research)Network .Network .Network .NetworkHost. Network.HostHostPrivate Address SpaceClass A10.0.0.0 to 10.255.255.255Class B172.16.0.0 to 172.31.255.255Class C192.168.0.0 to 192.168.255.255Default Subnet MasksClass A255.0.0.0Class B255.255.0.0Class C255.255.255.0Produced by: Robb Jonesjonesr@careertech.net and/or Robert.Jones@fcps.orgFrederick County Career & Technology CenterCisco Networking AcademyFrederick County Public SchoolsFrederick, Maryland, USASpecial Thanks to Melvin Baker and Jim Dorschfor taking the time to check this workbook for errors,and to everyone who has sent in suggestions to improve the series.Workbooks included in the series:IP Addressing and Subnetting WorkbooksACLs - Access Lists WorkbooksVLSM Variable-Length Subnet Mask WorkbooksInstructors (and anyone else for that matter) please do not post the Instructors version on public websites.When you do this you are giving everyone else worldwide the answers. Yes, students look for answers this way.It also discourages others; myself included, from posting high quality materials.Inside Cover

Binary To Decimal Conversion128 ratch Area1281621466432164211191

Decimal To Binary ConversionUse all 8 bits for each problem128 6432168421 001570110001098101100111790000001022Scratch Area238-128110-6446-3214-86-42-2034-322-20

Address Class .56.0C3

Network & Host IdentificationCircle the network portionof these addresses:Circle the host portion ofthese .155.230.14220.200.23.110.250.1.14

Network AddressesUsing the IP address and subnet mask shown write out the network .0.0188 . 10 . 0 . 010 . 10 . 48 . 0192 . 149 . 24 . 0150 . 203 . 0 . 010 . 0 . 0 . 0186 . 13 . 23 . 0223 . 69 . 0 . 0200 . 120 . 135 . 027 . 0 . 0 . 0199 . 20 . 150 . 0191 . 55 . 165 . 028 . 212 . 0 . 05

Host AddressesUsing the IP address and subnet mask shown write out the host .55.165.135255.255.255.048.21.25.54255.255.0.060 . 0 . 18 . 20 . 0 . 0 . 800 . 0 . 0 . 110 . 0 . 230 . 190 . 10 . 10 . 100 . 0 . 0 . 110 . 0 . 23 . 200 . 0 . 0 . 2150 . 15 . 2 . 510 . 0 . 0 . 1350 . 0 . 0 . 1350 . 0 . 25 . 54

Default Subnet MasksWrite the correct default subnet mask for each of the following addresses:177.100.18.4255 . 255 . 0 . 0119.18.45.0255 . 0 . 0 . 0191.249.234.191255 . 255 . 0 . 0223.23.223.109255 . 255 . 255 . 010.10.250.1255 . 0 . 0 . 0126.123.23.1255 . 0 . 0 . 0223.69.230.250255 . 255 . 255 . 0192.12.35.105255 . 255 . 255 . 077.251.200.51255 . 0 . 0 . 0189.210.50.1255 . 255 . 0 . 088.45.65.35255 . 0 . 0 . 0128.212.250.254255 . 255 . 0 . 0193.100.77.83255 . 255 . 255 . 0125.125.250.1255 . 0 . 0 . 01.1.10.50255 . 0 . 0 . 0220.90.130.45255 . 255 . 255 . 0134.125.34.9255 . 255 . 0 . 095.250.91.99255 . 0 . 0 . 07

ANDING WithDefault subnet masksEvery IP address must be accompanied by a subnet mask. By now you should be able to lookat an IP address and tell what class it is. Unfortunately your computer doesn’t think that way.For your computer to determine the network and subnet portion of an IP address it must“AND” the IP address with the subnet mask.Default Subnet Masks:Class A255.0.0.0Class B255.255.0.0Class C255.255.255.0ANDING Equations:1 AND 1 11 AND 0 00 AND 1 00 AND 0 0Sample:What you see.IP Address:192 . 100 . 10 . 33What you can figure out in your head.Address Class:Network Portion:Host Portion:C192 . 100 . 10 . 33192 . 100 . 10 . 33In order for you computer to get the same information it must AND the IP address withthe subnet mask in binary.NetworkHostIP Address: 1 1 0 0 0 0 0 0 . 0 1 1 0 0 1 0 0 . 0 0 0 0 1 0 1 0 . 0 0 1 0 0 0 0 1Default Subnet Mask: 1 1 1 1 1 1 1 1 . 0 1 1 1 1 1 1 1 . 1 1 1 1 1 1 1 1 . 0 0 0 0 0 0 0 0AND: 1 1 0 0 0 0 0 0 . 0 1 1 0 0 1 0 0 . 0 0 0 0 1 0 1 0 . 0 0 0 0 0 0 0 0(192 . 100 . 10 . 33)(255 . 255 . 255 . 0)(192 . 100 . 10 . 0)ANDING with the default subnet mask allows your computer to figure out the networkportion of the address.8

ANDING WithCustom subnet masksWhen you take a single network such as 192.100.10.0 and divide it into five smaller networks(192.100.10.16, 192.100.10.32, 192.100.10.48, 192.100.10.64, 192.100.10.80) the outsideworld still sees the network as 192.100.10.0, but the internal computers and routers see fivesmaller subnetworks. Each independent of the other. This can only be accomplished by usinga custom subnet mask. A custom subnet mask borrows bits from the host portion of theaddress to create a subnetwork address between the network and host portions of an IPaddress. In this example each range has 14 usable addresses in it. The computer must stillAND the IP address against the custom subnet mask to see what the network portion is andwhich subnetwork it belongs to.IP Address:Custom Subnet Mask:Address Ranges:192 . 100 . 10 . 0255.255.255.240192.10.10.0 to 192.100.10.15192.100.10.16 to 192.100.10.31192.100.10.32 to 192.100.10.47 (Range in the sample below)192.100.10.48 to 192.100.10.63192.100.10.64 to 192.100.10.79192.100.10.80 to 192.100.10.95192.100.10.96 to 192.100.10.111192.100.10.112 to 192.100.10.127192.100.10.128 to 192.100.10.143192.100.10.144 to 192.100.10.159192.100.10.160 to 192.100.10.175192.100.10.176 to 192.100.10.191192.100.10.192 to 192.100.10.207192.100.10.208 to 192.100.10.223192.100.10.224 to 192.100.10.239192.100.10.240 to 192.100.10.255SubNetwork HostNetworkIP Address: 1 1 0 0 0 0 0 0 . 0 1 1 0 0 1 0 0 . 0 0 0 0 1 0 1 0 . 0 0 1 0 0 0 0 1 (192 . 100 . 10 . 33)Custom Subnet Mask: 1 1 1 1 1 1 1 1 . 0 1 1 1 1 1 1 1 . 1 1 1 1 1 1 1 1 . 1 1 1 1 0 0 0 0 (255 . 255 . 255 . 240)AND: 1 1 0 0 0 0 0 0 . 0 1 1 0 0 1 0 0 . 0 0 0 0 1 0 1 0 . 0 0 1 0 0 0 0 0 (192 . 100 . 10 . 32)Four bits borrowed from the hostportion of the address for thecustom subnet mask.The ANDING process of the four borrowed bitsshows which range of IP addresses thisparticular address will fall into.In the next set of problems you will determine the necessary information to determine thecorrect subnet mask for a variety of IP addresses.9

How to determine the number of subnets and thenumber of hosts per subnetTwo formulas can provide this basic information:Number of subnets 2 s(Second subnet formula: Number of subnets 2s - 2)Number of hosts per subnet 2 h - 2Both formulas calculate the number of hosts or subnets based on the number of binary bitsused. For example if you borrow three bits from the host portion of the address use thenumber of subnets formula to determine the total number of subnets gained by borrowing thethree bits. This would be 23 or 2 x 2 x 2 8 subnetsTo determine the number of hosts per subnet you would take the number of binary bits used inthe host portion and apply this to the number of hosts per subnet formula If five bits are in thehost portion of the address this would be 2 5 or 2 x 2 x 2 x 2 x 2 32 hosts.When dealing with the number of hosts per subnet you have to subtract two addresses fromthe range. The first address in every range is the subnet number. The last address in everyrange is the broadcast address. These two addresses cannot be assigned to any device inthe network which is why you have to subtract two addresses to find the number of usableaddresses in each range.For example if two bits are borrowed for the network portion of the address you can easilydetermine the number of subnets and hosts per subnets using the two formulas.195. 223 . 50 . 0The number of subnetscreated by borrowing 2bits is 2 2 or 2 x 2 4subnets.0000000The number of hosts created byleaving 6 bits is 26 - 2 or2 x 2 x 2 x 2 x 2 x 2 64 - 2 62usable hosts per subnet.What about that second subnet formula:sNumber of subnets 2 - 2In some instances the first and last subnet range of addresses are reserved. This is similar tothe first and last host addresses in each range of addreses.The first range of addresses is the zero subnet. The subnet number for the zero subnet isalso the subnet number for the classful subnet address.The last range of addresses is the broadcast subnet. The broadcast address for the lastsubnet in the broadcast subnet is the same as the classful broadcast address.10

Class C Address unsubnetted:195. 223 . 50 . 0195.223.50.0to195.223.50.255Notice that the subnet andbroadcast addresses match.Class C Address subnetted (2 bits borrowed):195. 223 . 50 . 000000195.223.50.0(1) 195.223.50.64(2) 195.223.50.128(Invalid range) (3) 195.223.50.192(Invalid range) .191195.223.50.255The primary reason the the zero and broadcast subnets were not used had to do pirmarily withthe broadcast addresses. If you send a broadcast to 195.223.255 are you sending it to all 255addresses in the classful C address or just the 62 usable addresses in the broadcast range?The CCNA and CCENT certification exams may have questions which will require you todetermine which formula to use, and whehter or not you can use the first and last subnets. Usethe chart below to help decide.When to use which formula to determine the number of subnetsssUse the 2 - 2 formula and don’t use thezero and broadcast ranges if.Use the 2 formula and use the zero andbroadcast ranges if.Classful routing is usedClassless routing or VLSM is usedRIP version 1 is usedRIP version 2, EIGRP, or OSPF is usedThe no ip subnet zero command isconfigured on your routerThe ip subnet zero command isconfigured on your router (default setting)No other clues are givenBottom line for the CCNA exams; if a question does not give you any clues as to whether or notto allow these two subnets, assume you can use them.sThis workbook has you use the number of subnets 2 formula.11

Custom Subnet MasksProblem 1Number of needed subnets 14Number of needed usable hosts 14Network Address 192.10.10.0CAddress class255 . 255 . 255 . 0Default subnet mask255 . 255 . 255 . 240Custom subnet mask16Total number of subnets16Total number of host addresses14Number of usable addresses4Number of bits borrowedShow your work for Problem 1 in the space below.Number ofSubnets192 . 10 . 10 .256 128 64 32-28 16128 64 32 160Add the binary valuenumbers to the left of the line tocreate the custom subnet mask.12401286432 16240001683264 128 256804042016-214210-Number ofHosts- Binary valuesObserve the total number ofhosts.Subtract 2 for the number ofusable hosts.

Custom Subnet MasksProblem 2Number of needed subnets 1000Number of needed usable hosts 60Network Address 165.100.0.0BAddress class255 . 255 . 0 . 0Default subnet mask255 . 255 . 255 . 192Custom subnet mask1,024Total number of subnets64Total number of host addresses62Number of usable addresses10Number of bits borrowedShow your work for Problem 2 in the space below.1 . 128 64 32 168400 .064-26200000422153665,76832,8416,3028,19128 64192028964,08204128643216Add the binary valuenumbers to the left of the line to8create the custom subnet mask.42 125504128 256.410208. 256 128 64 32 16512016512165 . 100 . 016 32 6441,02Binary values - 128 64 32482,08964,0428,1928416,3-76832,Number ofSubnets53665,Number ofHosts -0Observe the total number ofhosts.Subtract 2 for the number ofusable hosts.130

Custom Subnet MasksProblem 3Network Address 148.75.0.0 /26BAddress class/26 indicates the total number ofbits used for the network andsubnetwork portion of theaddress. All bits remaining belongto the host portion of the address.255 . 255 . 0 . 0Default subnet mask255 . 255 . 255 . 192Custom subnet mask1,024Total number of subnets64Total number of host addresses62Number of usable addresses10Number of bits borrowedShow your work for Problem 3 in the space below.21 . 128 64 32 168400 .064-2620000Observe the total number ofhosts.Subtract

a custom subnet mask. A custom subnet mask borrows bits from the host portion of the address to create a subnetwork address between the network and host portions of an IP address. In this example each range has 14 usable addresses in it. The computer must still AND the IP address against the custom subnet mask to see what the network portion is and