[olug] Subnet mask
Bob McCoy
bob at mccoy.net
Tue Dec 16 13:13:56 UTC 2003
The problem is that the answer is wrong. The answer is wrong because
the question was wrong.
You will not have a subnet end with a 93 -- ever. The reason? As you
look at the output, you'll notice that the last subnet only has two
addresses, 92 & 93, which is invalid -- you end up with a network
address and a broadcast address an no usable host addresses. If you use
95 as the top-end address, you end up with a 32-address network with 30
usable addresses. I suspect 94 was taken out of the range of addresses
since it would probably serve as the default gateway for that net.
Remember, he was working with *one* subnet. The way the tool has to
carve it up to fit within the original stated range, you end up with
four subnets (each with a unique mask), with only 22 usable addresses
(as opposed to 30).
Otherwise, it's a very cool tool. But you have to start with some valid
assumptions about subnet boundaries.
Bob
-----Original Message-----
From: olug-bounces at olug.org [mailto:olug-bounces at olug.org] On Behalf Of
Jay Hannah
Sent: Monday, December 15, 2003 10:26 PM
To: dan at linder.org; Omaha Linux User Group
Cc: omaha-list at happyfunball.pm.org
Subject: Re: [olug] Subnet mask
Subnets for that range:
http://jays.net/cgi-bin/ipr.pl?ip1=205.202.101.64&ip2=205.202.101.93
Source code:
http://jays.net/ipr.pl.txt
Omaha Perl Mongers:*
http://omaha.pm.org
j
* Anyone sick of me plugging this yet? If so I'll quit.
On Saturday, December 13, 2003, at 04:11 PM, Daniel Linder wrote:
>> I am having a brain freeze and I cannot for the life of me figure
this
>> out. I have been given a range of numbers to use at my job and I
>> cannot
>> figure out the subnet mask...Help!
>> The numbers are 205.202.101.64-205.202.101.93. Class C address from
>> authority. I know that by thinking about it, it is divided into 4
>> subnets, right? (30 numbers into 128 is 4 times+). ugh. My head
>> hurts
>> today...
>
> Here is a handy perl code snippet to help in times like these...
> (Might need to run "perl -MCPAN -e 'install Net::CIDR'" to install the
> Net::CIDR module.)
>
> --- Begin perl code ---
> #!/usr/bin/perl
> use Net::CIDR;
> use Net::CIDR ':all';
>
>
> @list2=();
> $x=64;
> while ($x <= 93) {
> $line = "205.202.101.".$x;
> push(@list2,$line);
> $x++;
> }
>
> printf ("These addresses:\n");
> foreach (@list2) {
> @cidr_list=Net::CIDR::cidradd($_, @cidr_list);
> printf ("$_, ");
> }
> printf ("\n\nSummarize to the following:\n");
>
> foreach (@cidr_list) {
> printf ("-->$_\n");
> }
> --- End perl code ---
>
> This program roduces this output:
> --- Begin output ---
> These addresses:
> 205.202.101.64, 205.202.101.65, 205.202.101.66, 205.202.101.67,
> 205.202.101.68, 205.202.101.69, 205.202.101.70, 205.202.101.71,
> 205.202.101.72, 205.202.101.73, 205.202.101.74, 205.202.101.75,
> 205.202.101.76, 205.202.101.77, 205.202.101.78, 205.202.101.79,
> 205.202.101.80, 205.202.101.81, 205.202.101.82, 205.202.101.83,
> 205.202.101.84, 205.202.101.85, 205.202.101.86, 205.202.101.87,
> 205.202.101.88, 205.202.101.89, 205.202.101.90, 205.202.101.91,
> 205.202.101.92, 205.202.101.93,
>
> Summarize to the following:
> -->205.202.101.64/28
> -->205.202.101.80/29
> -->205.202.101.88/30
> -->205.202.101.92/31
> --- End output ---
>
> So, these are the four subnet ranges that cover the .64 through .93
> inclusively.
>
> Dan
> _______________________________________________
> OLUG mailing list
> OLUG at olug.org
> http://lists.olug.org/mailman/listinfo/olug
_______________________________________________
OLUG mailing list
OLUG at olug.org
http://lists.olug.org/mailman/listinfo/olug
More information about the OLUG
mailing list