Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Athan <netfilter@miggy.org>
To: Wayne McDougall <netfilter@codeworks.gen.nz>
Cc: netfilter@lists.netfilter.org
Subject: Re: [Q]: Filtering based on reverse DNS
Date: Sat, 12 Apr 2003 08:51:01 +0100	[thread overview]
Message-ID: <20030412075101.GA32561@miggy.org> (raw)
In-Reply-To: <NCBBIBNHAKHDGJGMPLPJCEKBKPAA.netfilter@codeworks.gen.nz>

[-- Attachment #1: Type: text/plain, Size: 1624 bytes --]

On Sat, Apr 12, 2003 at 07:24:42PM +1200, Wayne McDougall wrote:
> What I want to achieve is to filter based on a reverse name lookup on a source (and ideally destination) IP on initiating a connection.

  Doing this dynamically is going to get very hairy very quickly IMO.

  An alternative is to go via the whois info on the IP block an IP is
in.  A quick check on your own IP includes info about the APNIC
(Asia/Pacific NIC) registry at http://www.apnic.net/db/, looking a
little further on that page reveals:

	http://ftp.apnic.net/stats/apnic/

The latest file from there is:

	http://ftp.apnic.net/stats/apnic/apnic-2003-04-01

and the fields are explained at:

	ftp://ftp.apnic.net/pub/apnic/stats/apnic/_README-apnic-stats.txt

It should be possible to use this information to create a list of IP
blocks in CIDR notation that are assigned to NZ, and from that generate
a list of rules for firewalling/traffic shaping.
  Of course when dealing with a great number of rules like this you
should take the advice someone else offered which is to aggregate the
blocks into chunks, with top-level rules distinguishing between the
chunks jumping to chains that deal with smaller sub-chunks and so on
down to chains containing a few actual IP blocks.  This way you minimise
the number of rules traversed for any given block.

HTH,

-Ath
-- 
- Athanasius = Athanasius(at)miggy.org / http://www.miggy.org/
                  Finger athan(at)fysh.org for PGP key
	   "And it's me who is my enemy. Me who beats me up.
Me who makes the monsters. Me who strips my confidence." Paula Cole - ME

[-- Attachment #2: Type: application/pgp-signature, Size: 240 bytes --]

  reply	other threads:[~2003-04-12  7:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-12  7:24 [Q]: Filtering based on reverse DNS Wayne McDougall
2003-04-12  7:51 ` Athan [this message]
2003-04-13 15:46 ` waltdnes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030412075101.GA32561@miggy.org \
    --to=netfilter@miggy.org \
    --cc=netfilter@codeworks.gen.nz \
    --cc=netfilter@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox