netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Fred Moyer <fred@redhotpenguin.com>
To: Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [ANNOUNCE] new iptables module match large amount of ip addresses
Date: Thu, 17 Sep 2009 16:05:23 -0700	[thread overview]
Message-ID: <ad28918e0909171605m67a899b9l6c37483cba79628f@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0909172100220.27299@artax.karlin.mff.cuni.cz>

On Thu, Sep 17, 2009 at 12:15 PM, Mikulas Patocka
<mikulas@artax.karlin.mff.cuni.cz> wrote:
> Hi
>
> Here I submit an iptables module that can match large amounts (millions)
> of ip addresses efficiently using binary search. I needed it to protect my
> home network from spam. It may be useful for other people too, so if you
> want it, you can take it and add it to the kernel.

I'm not familiar with xt_geoip or ipset, but from the first look at
this module I want to say thank you!  This is the perfect tool for a
problem I have been wanting to solve for a while.



>
> Get the patches for netfilter and kernel at:
> http://artax.karlin.mff.cuni.cz/~mikulas/xt_ipfile/
> (you need to copy the file include/linux/netfilter/xt_ipfile.h from kernel
> sources to /usr/include/linux/netfilter/ to compile the userspace)
>
> The main features:
> - fast matching of large amount of ip addresses using binary search.
> - an ability to match ranges of addresses or address/mask subnets.
> - fast loading of the addresses (on Pentium 3 850, 2 million addresses
> load in 5.5s, if they are already sorted in the file, the load time is
> just 1.5s).
> - memory efficient --- consumes only 8 bytes per address.
>
> USAGE:
>
> prepare a file with addreses, in this example /root/firewall/bad-ips. One
> entry per line, the allowed formats are:
> 1.2.3.4
> 1.2.3.0/24
> 1.2.3.4-1.2.3.8
>
> insert it into iptables with:
> iptables -A SPAM -m ipfile --src-file /root/firewall/bad-ips -j DROP
>
> The module doesn't support ipv6 because I don't use it, but it's generic
> enough that it could be extended for it. It could be also extended to
> match ethernet MAC addresses.
>
> Mikulas
> --
> To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      parent reply	other threads:[~2009-09-17 23:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-17 19:15 [ANNOUNCE] new iptables module match large amount of ip addresses Mikulas Patocka
2009-09-17 20:03 ` Eric Leblond
2009-09-17 20:36   ` Mikulas Patocka
2009-09-17 22:50 ` Jan Engelhardt
2009-09-17 23:01   ` Mikulas Patocka
2009-09-17 23:33     ` Jan Engelhardt
2009-09-17 23:46       ` Mikulas Patocka
2009-09-17 23:05 ` Fred Moyer [this message]

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=ad28918e0909171605m67a899b9l6c37483cba79628f@mail.gmail.com \
    --to=fred@redhotpenguin.com \
    --cc=mikulas@artax.karlin.mff.cuni.cz \
    --cc=netfilter-devel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).