Mailinglist Archive: opensuse (3441 mails)

< Previous Next >
Re: [opensuse] firewall semantics question
  • From: David Haller <opensuse@xxxxxxxxxx>
  • Date: Sun, 18 Jan 2009 22:51:03 +0100
  • Message-id: <20090118215103.GA7820@xxxxxxxxxxxxxxxxxx>
Hello,

On Thu, 15 Jan 2009, Patrick Shanahan wrote:
how do I denote a group of domains as:

xxx.xxx only the first two groups specified but all inclusive

similar to

224.112.221.0/24
which I understand to include all 224.112.221.###

Read http://en.wikipedia.org/wiki/CIDR#CIDR_and_masks

Perl has modules for conversion of IP-Ranges to CIDR and back. Read
'man Net::CIDR' and/or 'man Net::CIDR::Lite', the latter has a package
in the repos (perl-Net-CIDR-Lite), the former exists in the
build-service (at least for SLES/SLED, a 10.2 .spec also exists).

Sample conversion:
$ perl -e 'use Net::CIDR qw(range2cidr);
print join("\n", range2cidr("192.168.0.0-192.168.255.255")), "\n";'
192.168.0.0/16
$ perl -e 'use Net::CIDR::Lite; $c = new Net::CIDR::Lite;
$c->add_range("192.168.0.0-192.168.255.255");
print join("\n", $c->list()), "\n";'
192.168.0.0/16
$

There are also some graphic / web "IP / Mask calculators / converters"
out there.

HTH,
-dnh

--
I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my telephone.
-- Bjarne Stroustrup
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >
References