LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 03-29-2008, 07:13 AM   #1
master
Member
 
Registered: Oct 2003
Location: Birmingham/Eng/UK
Distribution: /Debian3.1/suse/XP/Win7
Posts: 677

Rep: Reputation: 30
VLSM Tutorial


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.
 
Old 03-29-2008, 08:16 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,373

Rep: Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962
googling for VLSM brings up a plethora of them, cisco being the first hit, and that looks just fine to me. try that one and if you have specific questions, fire away.
 
Old 03-30-2008, 04:07 AM   #3
master
Member
 
Registered: Oct 2003
Location: Birmingham/Eng/UK
Distribution: /Debian3.1/suse/XP/Win7
Posts: 677

Original Poster
Rep: Reputation: 30
Hi,
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.

My example:

I have a class A address of 10.0.0.0
I need to create a mask which will give me 850 subnets.
I used 255.255.192.0 (I got this from from 2^10 = 1024)
(as 2^9 = 512) which is not enough.

So my last subnet address would be 10.255.192.0 255.255.192.0

Now I have worked out what address/mask creates 850 subnets I need to vlsm a further 70 subnets.

What address am I supposed to use to vlsm a further 70 subnets,is it the last address in my original working out when I created 850 subnets.
"ie" 10.255.192.0 255.255.192.0

Regards Nige
 
Old 03-30-2008, 10:31 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,373

Rep: Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962
well firstly your math is a little off...

255.255.255.0 = 8 host bits = 254 hosts (256 - 2)

so...

255.255.254.0 = 9 host bits = 510 hosts (512 -2)

and

255.255.252.0 = 10 host bits = 1022 hosts (1024 - 2)

your choice, 255.255.192.0 is 14 host bits, which is.. a bunch more hosts.

I don't quite understand what you mean about what address to use... vlsm is a mask, that mask is consistent whatever the actual IP is.

personally i also frequent http://jodies.de/ipcalc when i'm getting confused...
 
Old 03-30-2008, 11:49 AM   #5
master
Member
 
Registered: Oct 2003
Location: Birmingham/Eng/UK
Distribution: /Debian3.1/suse/XP/Win7
Posts: 677

Original Poster
Rep: Reputation: 30
Hi ,
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

10.0.0.0 255.255.192.0

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.

Regards Nige.
 
Old 03-30-2008, 01:42 PM   #6
master
Member
 
Registered: Oct 2003
Location: Birmingham/Eng/UK
Distribution: /Debian3.1/suse/XP/Win7
Posts: 677

Original Poster
Rep: Reputation: 30
Just thought I would say I found this quite good

http://www.ciscopress.com/articles/a...30807&seqNum=4
 
Old 03-30-2008, 02:51 PM   #7
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,373

Rep: Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962
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.
 
Old 03-30-2008, 02:59 PM   #8
ARC1450
Member
 
Registered: Jun 2005
Location: Odenton, MD
Distribution: Gentoo
Posts: 290

Rep: Reputation: 30
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 (7.0.0.0/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.
 
Old 04-11-2008, 10:26 PM   #9
TomS_
LQ Newbie
 
Registered: Apr 2008
Posts: 6

Rep: Reputation: 0
Quote:
Originally Posted by ARC1450 View Post
...
Erm, your subnetting skills need some work.

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.

Last edited by TomS_; 04-12-2008 at 03:08 AM.
 
Old 04-12-2008, 06:19 AM   #10
ARC1450
Member
 
Registered: Jun 2005
Location: Odenton, MD
Distribution: Gentoo
Posts: 290

Rep: Reputation: 30
This was more to illustrate a point. VLSM saves wasted space.

It's the same way it was explained to me way back when actually. You just kind of assume people are smart enough to understand where the boundaries go.

But thanks for the lesson in subnetting. Guess after a few years of doing it, I just don't know how to do it.
 
Old 04-12-2008, 09:42 AM   #11
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,373

Rep: Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962
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.
 
Old 04-12-2008, 11:20 AM   #12
ARC1450
Member
 
Registered: Jun 2005
Location: Odenton, MD
Distribution: Gentoo
Posts: 290

Rep: Reputation: 30
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.
 
Old 04-12-2008, 10:34 PM   #13
TomS_
LQ Newbie
 
Registered: Apr 2008
Posts: 6

Rep: Reputation: 0
Hey no hard feelings.

My job is a network admin for a national ISP working with Cisco gear all day long, so to me subnetting comes naturally.

But stick me infront of a Linux box, different story.
 
Old 04-13-2008, 08:45 AM   #14
rossonieri#1
Member
 
Registered: Jun 2007
Posts: 359

Rep: Reputation: 34
hi master,

Quote:
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.

HTH.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP-MySQL tutorial and Linux Networking tutorial needed Please dlux45 Linux - Software 6 04-19-2010 01:10 PM
LXer: Tutorial: An Easy Tutorial on IP Tables and Port Knocking LXer Syndicated Linux News 0 02-04-2008 04:20 PM
how to configure VLSM on dhcp jayashree Red Hat 1 05-16-2006 07:44 PM
VLSM , Dhcp shipon_97 Linux - Networking 1 02-11-2006 06:32 PM
How about a weekly tutorial? or just a tutorial Alinuxnoob LQ Suggestions & Feedback 2 04-09-2002 08:30 PM


All times are GMT -5. The time now is 07:11 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration