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.
Hi can anyone point me in the direction of a good vlsm tutorial.I have looked around but can't seem to find one that lays it all out plain and simple.I would like just one good example.
Best regards Nige.
Not quite sure why you have mentioned the "hosts"
The question I have been given is .
I have a class A address of 10.0.0.0
I need to create a mask which will give me 850 subnets.
If i have this address
In binary this mask is
11111111 11111111 11000000 00000000
The first octet is owned by the network.So I then count the the 1s which is 10 so 10^2 = 1024
The zero's represent the host,so 14 zero's or 14^2 = 16384 - 2 = 16382
The hosts in my question are irrelevant as I am only working out a mask for the subnets.(This is because this question is part of course work)
Where I am stuck is I thought the idea of vlsm was so we do not waste ip addresses.Now with the mask I have created If I was to use one of my subnets on an interface I would waste a lot of ip addresses.I don't understand where vlsm comes in to this to stop this happening.
nrrg, yeah that is what you said wasn't it... christ.
OK, well VLSM has been around for a long time now, and it's really what's "normal". The hard part is working out what the original fixed mask version was and why anyone ever thought it was a good idea for the long term. i.e. a Class A like yours would only be used as a single subnet, mask 255.0.0.0. Simplest example is probably internal class's 192.168.0.0/16, which by definition are /24 subnets, so you only have 256 subnets of 254 hosts and that's it. vlsm just says, yeah sod that /24 restriction, do what you want, go nuts.
You are right. . .VLSM is to keep address space from getting wasted.
Think of it from the ISP standpoint. You have a 192.168.0.0/24 (or 192.168.0.0/255.255.255.0). Now, you don't want to hand out an address to a customer and have them able to talk with everyone else, right? So you give them a 192.168.0.0/30 (192.168.0.0/255.255.255.252) address. But wait! You have a business on your network that needs to be able to hook up more than one device, right? Say they have 13 devices. So you give them a 192.168.0.4/28 (192.168.0.4/255.255.255.240) address. They can hook up a possible pool of 14 devices with that address space. Then there's one more business that needs to be able to hook up 120 servers, so you give them 192.168.0.20/25 (192.168.0.20/255.255.255.128).
So now, you have a network (192.168.0.0/24) subnetted out with VLSM to create smaller, more appropriate networks. In a nutshell, VLSM lets you change the netmask on the fly to allow you to subnet out an already subnetted network. This is particularly useful in the ISP realm where you need to hand out routable addresses to your customers, and not so much beyond that. For example, the United States Department of Defense has an entire class A address space (22.214.171.124/8), which much of it going unused. This is what happened in the old days; a company or organization could ask for a Class A, Class B, or Class C address and get an entire classful network. (I think it's called classful).
It's been discussed for IANA (I believe) to go back and reclaim all those unused addresses, VLSM them out, and we could easily push back the date we're expecting to run out of IPv4 address for at least a year or two.
Subnets based on VLSM must be allocated at increments of the size of the subnet, starting at 0. That is to say, /30's must be allocated at 4 IP increments (0, 4, 8, 12, etc), /28's at 16 IP increments (0, 16, 32, 48, etc), /25's at 128 IP increments (0 and 128), etc. You cannot allocate a /28 directly after a /30, unless that /28 happens to be at at 16 IP increment, e.g.
192.168.0.16/28 can be allocated after 192.168.0.12/30.
192.168.0.4/28 is actually a host address of 192.168.0.0/28, which covers all IPs from 192.168.0.0 through to 192.168.0.15.
Likewise, 192.168.0.20/25 is a host address of 192.168.0.0/25, which covers everything from 192.168.0.0 to 192.168.0.127.
If you want to allocate a /30 to one user, a /28 to another, and a /25 to a 3rd, it must be done as follows:
First user gets 192.168.0.0/30, they can use 192.168.0.1 and 192.168.0.2.
Second user gets 192.168.0.16/28, they can use 192.168.0.17 through to 192.168.0.30.
And the third user gets 192.168.0.128/25, and they can use 192.168.0.129 through 192.168.0.254.
This leaves some gaps, but they can be filled with allocations at a later date.
Well I'm sure the last line is somewhat flippant, but it's also fair to say that it's easy to forget textbook definitions when you are just using it the wild. Just try telling someone how to drive a car 10 years after passing the test.
Oh, it was both. There are times I sit and scratch my head when dealing with subnetting, and other times I can do it in my head. lollers
I suppose clarification is always a good thing. I have a bad habit of expecting people to know stuff they should know in my eyes, but I forget that times change, and teaching methods change. When I was taught subnetting, it was assumed you were smart enough to figure some of those things out on your own. Needless to say, my CCNA class had some head scratching going on most of the time. lol
And I can tell someone how to drive a car, thank you very much. Right pedal makes it go vroom, left pedal makes it go "eerrrrt". Keep it between the lines, shiny side up, all four rubber thingies on the ground.
I understand that we can give different masks to make vlsm work for us.
What I don't understand is at what point we use vlsm.
VLSM being used in conjunction with how many host a subnet may have prior to devide the block. You know that a /32 (a single host or 255.255.255.255) is also a subnet mask. hence we need to know how many host a subnet may have.
your example of 10/8 network :
- create 10 subnets that contain 120 hosts?
- create 24 subnets that contain 24 hosts?
- create 6 subnets that contain point-to-point?
then we do the calculation from the bigger subnet first. why? bigger subnets require more bits than the smaller one --> so just to make sure that we will have enough bits left to further subnets.