From: Patrick McHardy <kaber@trash.net>
To: Amin Azez <azez@ufomechanic.net>
Cc: Jan Engelhardt <jengelh@computergmbh.de>,
Netfilter Developer Mailing List
<netfilter-devel@vger.kernel.org>
Subject: Re: NF [PATCH 4/4] xt_gateway
Date: Tue, 27 Nov 2007 14:03:09 +0100 [thread overview]
Message-ID: <474C158D.9050004@trash.net> (raw)
In-Reply-To: <474BE470.2050209@ufomechanic.net>
Amin Azez wrote:
> * Patrick McHardy wrote, On 27/11/07 00:19:
>> The version Jan posted doesn't match on mac but on IP address.
> It should be refusing to match mac if the ip's do match in the --gateway
> match, because if the IP matches then the host is being addressed
> directly and not as a gateway.
> That's why it also checks IP.
>
> + if (memcmp(&info->gateway_v4, &neigh->primary_key, tbl->key_len) != 0)
> + return false;
>
> It checks mac as the primary key of the neighbour table.
The primary key is the IP address.
>> So I still don't see the point. You have a route with a gateway
>> address, which you can match on. The fact that some MAC spoofing
>> is done seems irrelevant.
> Take the case of a numbered layer 2 bridge. The bridged packets are not
> routed by the bridge, but you might still want to snat or dnat some
> certain packets to a certain gateway. I know networks that do this.
> (Maybe the nat helpers are better on the bridge than on the nat-ing
> router or something). Hey - thats what brouters are for.
>
> If there is mac spoofing where you are not routing, then it helps to
> identify the box doing the spoofing; and it is best to do so by IP
> address which in such cases usually identifies the role.
> For example, if you have a win2K box doing internet connection sharing
> on an ISDN dialup to another office on the same subnet, the box doing
> the sharing (which may change) will generally have the same IP address.
> There is no route to that box, but the xt_gateway match still has a use
> here to recognize traffic that will be going over the ISDN link and may
> want to be marked for shaping.
I don't even see how that would work, if the box is doing mac spoofing
then you have an arp entry for every IP behind the ISDN link. So you
have the choice of adding n "gateway" rules or n destination IP rules.
In case of destination IP rules it might at least be able to use masks.
If I'm still not getting you (which might be possible since my brain is
not really up to 100% because of sickness), just make an example using
the actual rules you'd use.
>> Since we already have a crapload of stuff in the kernel, I prefer to
>> only add things that extend the expressiveness of iptables to things
>> not possible otherwise. Mere simplifications can be done in userspace
>> IMO.
>>
>
> This mere simplification is, in user-space, (as explained above) a
> complication, and doubly so because there are no generally available
> routing table manipulation tools to match iptables-save/iptables-restore.
>
> However, I think then by your criteria above you will accept xt_gateway
> because it extends the expressiveness of iptables to do things not
> possible by realm (detection of gateways on a box that did not route)
> and to do other things which are possible, but in (as you say) a simpler
> way (albeit not in userspace), and by my judgement, a more expressive way.
>
> I think I met your criteria.... :-)
Possibly, but I didn't get it :) So please explain it using an example.
A completely different issue is that the neighbour entry is created
after a packet has traversed all netfilter hooks, so you might set up
incorrect NAT mappings (in your example). How do you deal with that?
next prev parent reply other threads:[~2007-11-27 13:03 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-25 19:05 NF [PATCH 1/4] xt_owner Jan Engelhardt
2007-11-25 19:06 ` NF [PATCH 2/4] xt_TEE Jan Engelhardt
2007-11-25 19:39 ` Krzysztof Oledzki
2007-11-25 19:55 ` Jan Engelhardt
2007-11-25 20:22 ` Krzysztof Oledzki
2007-11-26 7:24 ` Patrick McHardy
2007-11-26 20:14 ` Jan Engelhardt
2007-11-27 0:12 ` Patrick McHardy
2007-12-05 17:24 ` nf_inet_address (was: NF [PATCH 2/4] xt_TEE) Jan Engelhardt
2007-12-05 17:35 ` Jan Engelhardt
2007-12-06 9:54 ` nf_inet_address Patrick McHardy
2007-11-25 19:06 ` NF [PATCH 3/4] xt_TCPOPTSTRIP Jan Engelhardt
2007-11-26 7:24 ` Patrick McHardy
2007-11-26 16:19 ` Jan Engelhardt
2007-11-26 16:19 ` Patrick McHardy
2007-11-26 16:25 ` Jan Engelhardt
2007-11-27 12:37 ` Patrick McHardy
2007-11-27 14:50 ` Jan Engelhardt
2007-11-27 15:25 ` Patrick McHardy
2007-11-25 19:07 ` NF [PATCH 4/4] xt_gateway Jan Engelhardt
2007-11-26 7:30 ` Patrick McHardy
2007-11-26 9:17 ` Amin Azez
2007-11-26 15:35 ` Patrick McHardy
2007-11-26 16:34 ` Amin Azez
2007-11-27 0:19 ` Patrick McHardy
2007-11-27 9:33 ` Amin Azez
2007-11-27 13:03 ` Patrick McHardy [this message]
2007-11-27 13:33 ` Amin Azez
2007-12-03 14:19 ` Jan Engelhardt
2007-12-03 14:23 ` Amin Azez
2007-11-25 19:07 ` IPT [PATCH 1/4] libxt_owner Jan Engelhardt
2007-11-25 19:08 ` IPT [PATCH 2/4] libxt_TEE Jan Engelhardt
2007-11-25 19:08 ` IPT [PATCH 3/4] libxt_TCPOPTSTRIP Jan Engelhardt
2007-11-25 19:08 ` IPT [PATCH 4/4] libxt_gateway Jan Engelhardt
2007-11-26 7:12 ` NF [PATCH 1/4] xt_owner Patrick McHardy
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=474C158D.9050004@trash.net \
--to=kaber@trash.net \
--cc=azez@ufomechanic.net \
--cc=jengelh@computergmbh.de \
--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 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.