Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Also, you're misunderstanding the subnet usability as far as I can see. If you have 192.168.1.0 and need it divided into 3 usable subnets, they obviously can't all be the same size. Also, it isn't subnets that are usable/unusable, all subnets can be used, it is just that the first and last host address within each subnet are not available, because one becomes the network's address, and the other the broadcast address for that subnet.
If all 3 subnets must be the same size, than you'd break the full subnet up into 4 parts, not 8 as you tried to do with the wrong math above.
The subnetmask should be 255.255.255.192 for 4 identically sized subnets -
0 192.168.1.0-63 0 being network and 63 being broadcast can't be used
1 192.168.1.64-127 64 being network and 127 being broadcast can't be used
2 192.168.1.128-191 128 being network and 191 being broadcast can't be used
3 192.168.1.192-255 192 being network and 255 being broadcast can't be used
If you want to break the subnet up into 3 and only 3 parts, then you'd make 2 of the networks 255.255.255.192 and the 3rd would be 255.255.255.128. The larger subnet needs to either be the first or last group, you can't make a 255.255.255.128 sandwiched between two 255.255.255.192 subnets. So either -
0 192.168.1.0-127 0 being network 127 being broadcast can't be used (mask 255.255.255.128)
1 192.168.1.128-191 128 being network 192 being broadcast can't be used (255.255.255.192)
2 192.168.1.192-255 192 being network 255 being broadcast can't be used (255.255.255.192)
Or flip that around
0 192.168.1.0-63 0 being network 63 being broadcast can't be used (255.255.255.192)
1 192.168.1.64-127 64 being network 127 being broadcast can't be used (255.255.255.192)
2 192.168.1.128-255 128 being network 255 being broadcast can't be used (255.255.255.128)
It gets a little confusing. Even Brian who normally gives dead on answers was off, because he began counting from 1 instead of from 0. His example should have looked like this:
I figured out my error last night, silly little math error, i was incrementing by the wrong value.
and I was following the CCNA examples on how to do this strait from there curiculum wich showed borrowing 3 bits would leave me 5 left and i would take 2 the 5th power to find out how much to increment by, but what i should of done was just add up the left over bits places to get 31 instead of 32.
But the CCNA does say that the first and last subnet as well as the first and last address in every subnet will not be usable.
But thanks for the help and here is the text I was following
tep 1 – IP Address Basics.
Explanation: IP network addresses are assigned by the Internet Network Information Center (InterNIC). If your organization has a class "A" IP network address, the first octet (8 bits) is assigned be InterNIC and your organization can use the remaining 24 bits to define up to 16,777,214 hosts on your network. This is a lot of hosts! It is not possible to put all of these hosts on one physical network without separating them with routers and subnets. A workstation may be on one network or subnet and a server may be on another network or subnet. When the workstation needs to retrieve a file from the server it will need to use its subnet mask to determine the network or subnet that the server is on. The purpose of a subnet mask is to help hosts and routers determine the network location where a destination host can be found. Refer to the following table to review IP address classes, default subnet masks and the number of networks and hosts that can be created with each class of network address.
Cls 1st Octet Decimal Range 1st Octet High Order Bits Network / Host ID (N=Network, H=Host) Default Subnet Mask Number of Networks Hosts per Network (usable addresses)
A 1 – 126* 0 N.H.H.H 255.0.0.0 126 (27 – 2) 16,777,214 (2 24 – 2)
B 128 – 191 1 0 N.N.H.H 255.255.0.0 16,382 (214 - 2) 65,534 (2 16 – 2)
C 192 – 223 1 1 0 N.N.N.H 255.255.255.0 2,097,150 (221 – 2) 254 (2 8 – 2)
D 224 – 239 1 1 1 0 Reserved for Multicasting
E 240 – 254 1 1 1 1 0 Experimental, used for research
Step 2 – The "ANDing" process.
Explanation: Hosts and routers use the "ANDing" process to determine if a destination host is on the same network or not. The ANDing process is done each time a host wants to send a packet to another host on an IP network. If you want to connect to a server, you may know the IP address of the server you want to connect to or you may just enter the host name (e.g. www.cisco.com) and a Domain Name Server (DNS) will convert the host name to an IP address. First the source host will compare (AND) its own IP address to its own subnet mask. The result of the ANDing is to identify the network where the source host resides. It will then compare the destination IP address to its own subnet mask. The result of the 2nd ANDing will be the network that the destination host is on. If the source network address and the destination network address are the same they can communicate directly. If the results are different then they are on different networks or subnets and will need to communicate through routers or may not be able to communicate at all.
ANDing depends on the subnet mask. A default subnet mask for a Class C network is 255.255.255.0 or 11111111.111111111.111111111.00000000. This is compared to the source IP address bit for bit. The first bit of the IP address is compared to the first bit of the subnet mask and the second bit to the second etc. If the two bits are both ones, then the ANDing result is a ONE. If the two bits are a zero and a one or two zeros then the ANDing result is a ZERO. Basically this means that a combination of 2 ones results in a ONE, anything else is a zero. The result of the ANDing process is the network or subnet number that the source or destination address is on.
Step 3 – Two Class C networks using the default subnet mask.
Explanation: This example will show how a Class C default subnet mask can be used to determine which network a host is on. A default subnet mask does not break an address into subnets. If the default subnet mask is used then the network is not being "subnetted". Host X (source) on network 126.96.36.199 has an IP address of 188.8.131.52 and wants to send a packet to host Z (destination) on network 184.108.40.206 and has an IP address of 220.127.116.11. All hosts on each network are connected to hubs or switches and then to a router. Remember that with a Class C network address ARIN (American Registry for Internet Numbers) assigns the first 3 octets (24 bits) as the network address so these are two different class C networks. This leaves one octet (8 bits) for hosts so each class C network could have up to 254 hosts (2^8 power = 256 – 2 = 254).
The ANDing process will help the packet get from host 18.104.22.168 on network 22.214.171.124 to host 126.96.36.199 on network 188.8.131.52 using the following steps.
1. Host X compares its own IP address to its own subnet mask using the ANDing process
Host X IP address 184.108.40.206 11001000.00000001.00000001.00000101
Subnet Mask 255.255.255.0 11111111.11111111.11111111.00000000
ANDing Result (220.127.116.11) 11001000.00000001.00000001.00000000
NOTE: The result of step 3a of the ANDing process is the network address of host X which is 18.104.22.168
2. Next host X compares the IP address of the Host Z destination to its own subnet mask using the ANDing process.
Host Z IP address 22.214.171.124 11001000.00000001.00000010.00001000
Subnet Mask 255.255.255.0 11111111.11111111.11111111.00000000
ANDing Result (126.96.36.199) 11001000.00000001.00000010.00000000
NOTE: The result of step3b ANDing process is the network address of host Z which is 188.8.131.52.
Host X compares the ANDing results from step A and the ANDing result from step B and they are different. Host X now knows that host Z is not in its Local Area Network (LAN) and it must send the packet to its "Default Gateway" which is the IP address of the router interface of 184.108.40.206 on network 220.127.116.11. The router will then repeat the ANDing process to determine which router interface to send the packet out.
Step 4 – One Class C network using a Custom subnet mask.
Explanation: This example uses a single Class C network address (18.104.22.168) and will show how a class C custom subnet mask can be used to determine which subnetwork (or subnet) a host is on and to route packets from one subnetwork to another. Remember that with a class C network address ARIN assigns the first 3 octets (24 bits) as the network address. This leaves 8 bits (one octet) for hosts so each class C network could have up to 254 hosts (2^8 power = 256 – 2 = 254).
Perhaps you want less than 254 host (workstations and servers) all on one network and you want to create 2 sub-networks and separate them with a router for security reason or to reduce traffic. This will create smaller independent broadcast domains and can improve network performance and increase security since these subnetworks will be separated by a router. Assume you will need at least 2 subnetworks and at least 50 hosts per subnetwork. Since you only have one Class C network address you have only 8 bits in the fourth octet available for a total of 254 possible hosts, you must create a Custom Subnet mask. You will use the custom subnet mask to "BORROW" bits from the host portion of the address. The following steps will help accomplish this:
1. The first step to "subnetting" is to determine how many subnets are needed. In this case you will need 2 subnetworks. To see how many bits you should borrow from the host portion of the network address, add the bit values from right to left until the total (decimal value) is greater than the number of subnets you will need. Since we need 2 subnets, add the one bit and the two bit which equals three. This is over the number of subnets we need, so we will need to borrow at least two bits from the host address starting from the left side of the octet that contains the host address.
Network address: 22.214.171.124
4th octet Host address bits: 1 1 1 1 1 1 1 1
Host address bit values (from right) 128 64 32 16 8 4 2 1
(Add bits starting from the right side (the 1 and the 2) until you get more than the number of subnets needed)
2. Once we know how many bits to borrow we take them from the left side of the first octet of the host address. Every bit we borrow from the host leaves fewer bits for the hosts. Even though we increase the number of subnets, we decrease the number of hosts per subnet. Since we need to borrow 2 bits from the left side, we must show that new value in our subnet mask. Our existing default subnet mask was 255.255.255.0 and our new "Custom" subnet mask is 255.255.255.192. The 192 comes from the value of the first two bits from the left (128 + 64 = 192). These bits now become 1s and are part of the overall subnet mask. This leaves 6 bits for host IP addresses or 2^6 = 64 hosts per subnet.
4th Octet borrowed bits for subnet: 1 1 1 1 1 1 1 1
Subnet bit values: (from left side) 128 64 32 16 8 4 2 1
With this information you can build the following table. The first two bits are the Subnet binary value. The last 6 bits are the host bits. By borrowing 2 bits from the 8 bits of the host address you can create 4 subnets with 64 hosts each. The 4 networks created are the "0" net, the "64" net, the "128" net and the "192" net. The "0" net and the "192" net are considered unusable. This is because the "0" net has all zeros in the subnet portion of the address and the 192 net has all ones in the subnet portion of the address.
Subnet No. Subnet bits borrowed Binary value Subnet bits Decimal Value Host bits possible binary values (range) (6 bits) Subnet / Host Decimal range Useable?
Subnet #0 00 0 000000 – 111111 0 – 63 NO
Subnet #1 01 64 000000 – 111111 64 – 127 YES
Subnet #2 10 128 000000 – 111111 128 – 191 YES
Subnet #3 11 192 000000 – 111111 192 – 254 NO
Notice that the first subnet always starts at 0 and, in this case, increases by 64 which is the number of hosts on each subnet. One way to determine the number of hosts on each subnet or the start of each subnet is to take the remaining host bits to the power of 2. Since we borrowed two of the 8 bits for subnets and have six bits left, the number of hosts per subnet is 2^6 or 64. Another way to figure the number of host per subnet or the "increment" from one subnet to the next is to subtract the subnet mask value in decimal (192 in the fourth octet) from 256 (which is maximum number of possible combinations of 8 bits) which equals 64. This means you start at 0 for the first network and add 64 for each additional subnetwork. If we take the second subnet (the 64 net) as an example the IP address of 126.96.36.199 cannot be used for a host ID because it is the "network ID" of the "64" subnet (host portion is all zeros) and the IP address of 188.8.131.52 cannot be used because it is the broadcast address for the 64 net (host portion is all ones).
Yeah, there is a very sharp double-edged sword with any type of certification. A CCNA isn't a joke, but there are somethings about it that just aren't practical, like this subnetting for example. What is confusing is that you don't have to lose subnets at all. I work for an ISP, and like the example, we often break a full 255.255.255.0 subnet up into parts, and regardless of the size of those subnets, we don't lose any of them to subnetting. You can divide a 255.255.255.0 block into 255.255.255.192 blocks, and use all 4 of them, yet the CCNA says you can't. Since it is their test and their certification, it obviously is best to use their answers, but that doesn't change the fact that they seem to be wrong in this case.
In any case, best of luck to you, and once you get certified, do your best to forget all of it, and learn the way it actually "works".
That being said, I can attest that nobody in the company I work for has any cisco certification, yet we've been up and online for at least the past 10 years.