From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Patrick McHardy <kaber@trash.net>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH 3/3] netfilter: xtables: add cluster match
Date: Tue, 10 Feb 2009 00:23:14 +0100 [thread overview]
Message-ID: <4990BAE2.8090802@netfilter.org> (raw)
In-Reply-To: <49904AF5.7060809@trash.net>
Patrick McHardy wrote:
> Pablo Neira Ayuso wrote:
>> This patch adds the iptables cluster match. This match can be used
>> to deploy gateway and back-end load-sharing clusters. Assuming that
>> all the nodes see all packets (see arptables mcmangle target and
>> PKTTYPE iptables targets on how to do that), the cluster match
>> decides if this node has to handle a packet given:
>>
>> jhash(source IP) % nodeID == 0
>>
>> For related connections, the master conntrack is used. An example of
>> its use for a gateway cluster, in one of the cluster nodes:
>>
>> iptables -I PREROUTING -t mangle -i eth1 -m cluster \
>> --cluster-total-nodes 2 --cluster-local-node 1 \
>> --cluster-proc-name eth1 -j MARK --set-mark 0xffff
>> iptables -A PREROUTING -t mangle -i eth1 \
>> -m mark ! --mark 0xffff -j DROP
>> iptables -A PREROUTING -t mangle -i eth2 -m cluster \
>> --cluster-total-nodes 2 --cluster-local-node 1 \
>> --cluster-proc-name eth2 -j MARK --set-mark 0xffff
>> iptables -A PREROUTING -t mangle -i eth2 \
>
> While its simple and probably gives good distribution, using the
> source IP like this has the major disadvantage that when one node
> fails, all nodes need to change rulesets and the existing mapping
> of connections becomes at least partially invalid.
But this is the same problem that people have in fault-tolerant
primary-backup stateful firewall setups. That's why the conntrack-tools
are there, just in case that you want fault-tolerant stateful firewalls ;).
> Also using conntrack data implies that this can't be used in the
> raw table, which seems like the best place to drop foreign packets.
Indeed, but this relies on the conntrack data to hash the same tuple for
all the packets.
Look at the numbers, they are not that bad, I'm getting ~45% more
performance while having my two firewalls running (before one was idle
in my primary-backup setup).
--
"Los honestos son inadaptados sociales" -- Les Luthiers
next prev parent reply other threads:[~2009-02-09 23:23 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-28 14:58 [PATCH 1/3] netfilter: arptables: add mcmangle target Pablo Neira Ayuso
2009-01-28 14:58 ` [PATCH 2/3] netfilter: xtables: add PKTTYPE target Pablo Neira Ayuso
2009-01-28 16:11 ` Jan Engelhardt
2009-01-28 16:51 ` Pablo Neira Ayuso
2009-02-09 15:13 ` Patrick McHardy
2009-02-09 23:15 ` Pablo Neira Ayuso
2009-02-10 14:03 ` Patrick McHardy
2009-02-10 14:18 ` Jozsef Kadlecsik
2009-02-10 14:22 ` Patrick McHardy
2009-02-10 18:12 ` Pablo Neira Ayuso
2009-02-11 12:26 ` Patrick McHardy
2009-02-11 14:19 ` Pablo Neira Ayuso
2009-02-11 14:35 ` Patrick McHardy
2009-02-11 14:51 ` Pablo Neira Ayuso
2009-02-11 14:54 ` Patrick McHardy
2009-01-28 14:58 ` [PATCH 3/3] netfilter: xtables: add cluster match Pablo Neira Ayuso
2009-01-28 16:07 ` Jan Engelhardt
2009-01-28 16:38 ` Pablo Neira Ayuso
2009-02-09 15:25 ` Patrick McHardy
2009-02-09 23:23 ` Pablo Neira Ayuso [this message]
2009-02-09 15:11 ` [PATCH 1/3] netfilter: arptables: add mcmangle target Patrick McHardy
2009-02-09 23:13 ` Pablo Neira Ayuso
2009-02-10 11:16 ` Pablo Neira Ayuso
-- strict thread matches above, loose matches on Subject: below --
2009-02-06 7:41 Pablo Neira Ayuso
2009-02-06 7:42 ` [PATCH 3/3] netfilter: xtables: add cluster match Pablo Neira Ayuso
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=4990BAE2.8090802@netfilter.org \
--to=pablo@netfilter.org \
--cc=kaber@trash.net \
--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).