Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Stephen Frost <sfrost@snowman.net>
To: mailinglists <mailinglists@belfin.ch>
Cc: netfilter@lists.netfilter.org
Subject: Re: AW: iptables wishes
Date: Tue, 1 Apr 2003 07:13:06 -0500	[thread overview]
Message-ID: <20030401121306.GX18434@ns.snowman.net> (raw)
In-Reply-To: <65F646CE24EBF24AA3714070D537988E017F04@gargoyle.seaan.net>

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

* mailinglists (mailinglists@belfin.ch) wrote:
> Generally I think this is a problem of too large rule sets. Is there a way to make containers of src/dst addresses? e.g. like this:
> 
> container_untrusted_dns="ip.addr.A, ip.addr.B, ip.addr.C"
> container_trusted_dns"ip.addr.D, ip.addr.E"
> 
> iptables -A FORWARD -p 6 -m state -s $container_trusted_dns --sport 1024: -d $container_untrusted_dns --dport 53 -o $waneth --state NEW,ESTABLISHED -j ACCEPT

It's overkill for this but you can use ipt_recent for matching on many
disseperate addresses or ippool for faster matching on IP addresses in
small ranges.  ippool in netfilter currently uses a bitfield for it's
IP address storage so you have to specify the range ahead of time and if
the range is very large it takes up gobs of memory.  ipt_recent is meant
for doing matches on recently seen IP addresses but can also be used for
static lists without penalty if you use --rcheck for the check (and not
--update).  ipt_recent is implemented as a hash table and so you can
throw any address you want in it without concern for memory size beyond
the total number of IP addresses you want to be able to store at once
instead of their disparity.  More information on ipt_recent is available
in the netfilter extension FAQ and at the homepage
http://snowman.net/projects/ipt_recent/ .  ippool is documented as part
of netfilter.

	Stephen

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

  reply	other threads:[~2003-04-01 12:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-01  9:48 AW: iptables wishes mailinglists
2003-04-01 12:13 ` Stephen Frost [this message]
2003-04-01 12:29   ` iptable / packet flow Scott MacKay
2003-04-01 12:45     ` Scott MacKay
2003-04-01 14:32 ` iptables wishes Ivano Proietti Mucci
2003-04-01 15:35   ` Joel Newkirk
  -- strict thread matches above, loose matches on Subject: below --
2003-04-01  8:41 Joel Newkirk
2003-04-06  3:57 ` AW: " Michael Schoen

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=20030401121306.GX18434@ns.snowman.net \
    --to=sfrost@snowman.net \
    --cc=mailinglists@belfin.ch \
    --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