[olug] Subnet mask
Bob McCoy
bob at mccoy.net
Sat Dec 13 22:29:02 UTC 2003
First of all, you're still using the 93 address which is highly unlikely
to be used.
Secondly, if you're going to go to that much trouble, why not just go to
http://www.telusplanet.net/public/sparkman/netcalc.htm and let them do
it for you?
Bob
-----Original Message-----
From: olug-bounces at olug.org [mailto:olug-bounces at olug.org] On Behalf Of
Daniel Linder
Sent: Saturday, December 13, 2003 4:11 PM
To: Omaha Linux User Group
Cc: olug at olug.org
Subject: Re: [olug] Subnet mask
> 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
More information about the OLUG
mailing list