From: Aidas Kasparas <a.kasparas@gmc.lt>
To: "José Pablo Pérez" <josepablo@correo.co.cr>
Cc: netfilter@vger.kernel.org
Subject: Re: Capturing a C Class range dynamically into an ipset table within iptables. Possible?‏
Date: Fri, 15 Jun 2012 05:52:21 +0300 [thread overview]
Message-ID: <4FDAA365.7040007@gmc.lt> (raw)
In-Reply-To: <20120614163444.7wwufjwdc0ok4osc@correo.co.cr>
On 2012.06.15 01:34, José Pablo Pérez wrote:
> Currently with ipset iam able to send to a table the inidivual (/32)
> source IP of a connection...
>
> I need a way to send to iptables the C Class to an ipset .
>
> In other words I need the historical list of last 30 min of C class
> ranges that have requested my server.
>
> I need this preferably done without something outside of iptables (such
> as a daemon).
>
just use parameter netmask 24 while creating ipset and you're done.
test:~# ipset create test hash:ip timeout 60 netmask 24
test:~# ipset add test 127.0.1.2
test:~# ipset add test 127.3.4.5
test:~# ipset list test
Name: test
Type: hash:ip
Header: family inet hashsize 1024 maxelem 65536 netmask 24 timeout 60
Size in memory: 16632
References: 0
Members:
127.0.1.0 timeout 50
127.3.4.0 timeout 55
test:~# ipset test test 127.0.1.1
127.0.1.1 is in set test.
test:~#
--
Aidas Kasparas
next prev parent reply other threads:[~2012-06-15 2:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-14 22:34 Capturing a C Class range dynamically into an ipset table within iptables. Possible?‏ José Pablo Pérez
2012-06-15 2:52 ` Aidas Kasparas [this message]
2012-06-15 5:39 ` José Pablo Pérez
2012-06-15 6:00 ` Aidas Kasparas
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=4FDAA365.7040007@gmc.lt \
--to=a.kasparas@gmc.lt \
--cc=josepablo@correo.co.cr \
--cc=netfilter@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.