From: Patrick McHardy <kaber@trash.net>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH 1/3] netfilter: arptables: add mcmangle target
Date: Mon, 09 Feb 2009 16:11:31 +0100 [thread overview]
Message-ID: <499047A3.9000505@trash.net> (raw)
In-Reply-To: <20090128145801.7501.44459.stgit@Decadence>
Pablo Neira Ayuso wrote:
> This patch adds the mcmangle target for arptables which allows
> altering the source hardware address in ARP with a multicast
> hardware address. This target can be used to make a switch flood
> packets to the ports that use the same MAC multicast address. This
> is useful to deploy load-sharing clusters in environments in which
> the switch does not provide a way to flood packets to several
> ports.
Great name. Took me a bit to realize the connection to "multicast" :)
> Since all the nodes receives the same packets, each decides if
> it handles the packet based on hashing approach (See the `cluster'
> iptables match that comes with this patchset).
>
> Theoretically, the use of the reserved VRRP hardware address should
> be fine for this, however, switches generally treat this hardware
> address space as normal unicast hardware address. Thus, in practise,
> it is not possible to have two nodes with the same VRRP hardware
> address.
>
> Please, note that this target violates RFC 1812 (section 3.3.2) since
> an ethernet device must not use a multicast link address.
>
> An example of the use of this target:
>
> arptables -I OUTPUT -o eth0 -j mcmangle --h-length 6 \
> --mc-mangle-mac 01:00:5e:00:01:01 --mc-mangle-dev eth0
> arptables -I INPUT -i eth0 --h-length 6 --destination-mac \
> 01:00:5e:00:01:01 -j mangle --mangle-mac-d 00:zz:yy:xx:5a:27
Wouldn't it be more generically usable if it was a simple "set
either source or destination mac address to any value" target?
In fact thats what it seems to be (or is there a multicast check?),
so perhaps we should call it S/DNAT for consistency with iptables
and ebtables?
I'm wondering though why the device is needed as a parameter ..
ah I see:
+ if (dev_mc_add(dev, mangle->mc_devaddr, ETH_ALEN, 0) < 0) {
+ printk(KERN_ERR "arpt_mcmangle: cannot set multicast "
+ "address\n");
+ return false;
+ }
Continuing the idea of a generic ARP address mangling target,
this would have to be done in userspace using SIOCADDMULTI.
I would also prefer that approach because the multicast mangling
seems a bit like a hack which only works when the requesting
host accepts a multicast MAC address in the ARP reply.
next prev parent reply other threads:[~2009-02-09 15:11 UTC|newest]
Thread overview: 27+ 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
2009-02-09 15:11 ` Patrick McHardy [this message]
2009-02-09 23:13 ` [PATCH 1/3] netfilter: arptables: add mcmangle target Pablo Neira Ayuso
2009-02-10 11:16 ` Pablo Neira Ayuso
-- strict thread matches above, loose matches on Subject: below --
2009-02-05 17:23 Pablo Neira Ayuso
2009-02-05 17:26 Pablo Neira Ayuso
2009-02-05 17:41 ` Pablo Neira Ayuso
2009-02-06 7:41 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=499047A3.9000505@trash.net \
--to=kaber@trash.net \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@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;
as well as URLs for NNTP newsgroup(s).