From: "J. Bakshi" <joydeep@infoservices.in>
To: netfilter@vger.kernel.org
Subject: iptree question
Date: Tue, 08 Sep 2009 11:59:00 +0530 [thread overview]
Message-ID: <4AA5F9AC.8000701@infoservices.in> (raw)
Hello list,
I am opening this new thread as I am working in a new direction with
ipset ( as many of you suggested ).
The present rules I am using to auto blacklist ips is like below
````````````````````````````
iptables -N syn-flood
iptables -A INPUT -i $IFACE -p tcp --syn -j syn-flood
iptables -A syn-flood -p tcp --syn -m hashlimit \
--hashlimit 4/sec --hashlimit-burst 4 --hashlimit-htable-expire 300000 \
--hashlimit-mode srcip --hashlimit-name testlimit -j RETURN
# Drop bad IP and put then in blacklist
iptables -A syn-flood -m recent --name blacklist --set -j DROP
`````````````````````````````````
To manage the ips properly I like to save ips in iptree which is an
option from ipset. Is there any way to migrate the ips from ipt_recent
to iptree ?
Or a new way as below ?
```````````````````
ipset --create blacklistIP iptree --timeout 3600
iptables -A PREROUTING blacklistIP -j DROP
iptables -N syn-flood
iptables -A INPUT -i $IFACE -p tcp --syn -j syn-flood
iptables -A syn-flood -p tcp --syn -m hashlimit \
--hashlimit 4/sec --hashlimit-burst 4 --hashlimit-htable-expire 300000 \
--hashlimit-mode srcip --hashlimit-name testlimit -j RETURN
# Drop bad IP
iptables -A syn-flood -j DROP
# save the src IP
ipset -N blacklistIP -j SET --add-set src
ipset -N blacklistIP -j syn-flood
``````````````````````
Am I on the right way ?
next reply other threads:[~2009-09-08 6:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-08 6:29 J. Bakshi [this message]
2009-09-08 7:57 ` iptree question Anatoly Muliarski
2009-09-08 8:02 ` J. Bakshi
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=4AA5F9AC.8000701@infoservices.in \
--to=joydeep@infoservices.in \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox