* Multiple Address specification or match
@ 2004-09-30 5:09 Temp02
2004-09-30 6:42 ` Swapnil Nagle
0 siblings, 1 reply; 14+ messages in thread
From: Temp02 @ 2004-09-30 5:09 UTC (permalink / raw)
To: netfilter-devel
Hello,
How difficult would it be to extend netfilter/iptables to allow multiple
source/destination address pairs (with negation) 'anded' together, as in -s
192.168.0.0/24 -s 10.0.0.0/8 -s ! 230.22.22.0/24. Or a match to do this same
thing?
regards,
Andrew.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Multiple Address specification or match
2004-09-30 5:09 Multiple Address specification or match Temp02
@ 2004-09-30 6:42 ` Swapnil Nagle
2004-09-30 6:47 ` Temp02
2004-09-30 8:46 ` Andrew Hall
0 siblings, 2 replies; 14+ messages in thread
From: Swapnil Nagle @ 2004-09-30 6:42 UTC (permalink / raw)
To: Temp02; +Cc: netfilter-devel
>How difficult would it be to extend netfilter/iptables to allow multiple
>source/destination address pairs (with negation) 'anded' together, as in -s
>192.168.0.0/24 -s 10.0.0.0/8 -s ! 230.22.22.0/24. Or a match to do this same
>thing?
>
>
How can the source address be "anded" ?
The source address cannot be both 192.168.0.1 and 10.0.0.1.
-- Swapnil
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Multiple Address specification or match
2004-09-30 6:42 ` Swapnil Nagle
@ 2004-09-30 6:47 ` Temp02
2004-09-30 8:34 ` Henrik Nordstrom
2004-09-30 8:46 ` Andrew Hall
1 sibling, 1 reply; 14+ messages in thread
From: Temp02 @ 2004-09-30 6:47 UTC (permalink / raw)
To: Swapnil Nagle; +Cc: netfilter-devel
No obviously a single source can't be both addresses, but the intent is to
allow a single rule to be used to match sources from both source ranges.
----- Original Message -----
From: "Swapnil Nagle" <swapsn@rediffmail.com>
To: "Temp02" <temp02@bluereef.com.au>
Cc: <netfilter-devel@lists.netfilter.org>
Sent: Thursday, September 30, 2004 4:42 PM
Subject: Re: Multiple Address specification or match
>
> >How difficult would it be to extend netfilter/iptables to allow multiple
> >source/destination address pairs (with negation) 'anded' together, as
in -s
> >192.168.0.0/24 -s 10.0.0.0/8 -s ! 230.22.22.0/24. Or a match to do this
same
> >thing?
> >
> >
> How can the source address be "anded" ?
> The source address cannot be both 192.168.0.1 and 10.0.0.1.
>
> -- Swapnil
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Multiple Address specification or match
2004-09-30 6:47 ` Temp02
@ 2004-09-30 8:34 ` Henrik Nordstrom
2004-09-30 8:59 ` Temp02
0 siblings, 1 reply; 14+ messages in thread
From: Henrik Nordstrom @ 2004-09-30 8:34 UTC (permalink / raw)
To: Temp02; +Cc: netfilter-devel, Swapnil Nagle
On Thu, 30 Sep 2004, Temp02 wrote:
> No obviously a single source can't be both addresses, but the intent is to
> allow a single rule to be used to match sources from both source ranges.
There is two ways for doing this
a) Using two rules, one per IP address.
b) Using an ippool/ipset storing the IP addresses.
Regards
Henrik
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Multiple Address specification or match
2004-09-30 6:42 ` Swapnil Nagle
2004-09-30 6:47 ` Temp02
@ 2004-09-30 8:46 ` Andrew Hall
1 sibling, 0 replies; 14+ messages in thread
From: Andrew Hall @ 2004-09-30 8:46 UTC (permalink / raw)
To: Swapnil Nagle; +Cc: netfilter-devel
Yes you're right, I meant 'or'd not 'anded' together.
----- Original Message -----
From: "Swapnil Nagle" <swapsn@rediffmail.com>
To: "Temp02" <temp02@bluereef.com.au>
Cc: <netfilter-devel@lists.netfilter.org>
Sent: Thursday, September 30, 2004 4:42 PM
Subject: Re: Multiple Address specification or match
>
> >How difficult would it be to extend netfilter/iptables to allow multiple
> >source/destination address pairs (with negation) 'anded' together, as
in -s
> >192.168.0.0/24 -s 10.0.0.0/8 -s ! 230.22.22.0/24. Or a match to do this
same
> >thing?
> >
> >
> How can the source address be "anded" ?
> The source address cannot be both 192.168.0.1 and 10.0.0.1.
>
> -- Swapnil
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Multiple Address specification or match
2004-09-30 8:34 ` Henrik Nordstrom
@ 2004-09-30 8:59 ` Temp02
2004-09-30 17:05 ` Simon Lodal
0 siblings, 1 reply; 14+ messages in thread
From: Temp02 @ 2004-09-30 8:59 UTC (permalink / raw)
To: Henrik Nordstrom; +Cc: netfilter-devel, Swapnil Nagle
thanks for your feedback but neither of these solutions are particularly
elegant.
The first (using more than one rule), requires the use of a lot more rules
than are really necessary, as an example, lets say that I wanted to prevent
access a range of subnets but allow everything else. Ideally I should be
able to:
iptables -A PREROUTING -d ! 10.0.0.0/8 -d ! 192.168.1.0/24 -d !
172.16.0.0/16 -m whatever -j ACCEPT
instead I would need three explicit drop rules and then an allow everything
else rule. (assuming a default drop policy).
The problem with the IPset/pool options are that they match only on a range
of addresses, not specifically by source or destination, also they seem to
require the use of another userspace program to actually build the sets
which in itself complicates the process.
Is it hard to extend the source and destination match functions to accept
multiple arguments?
----- Original Message -----
From: "Henrik Nordstrom" <hno@marasystems.com>
To: "Temp02" <temp02@bluereef.com.au>
Cc: <netfilter-devel@lists.netfilter.org>; "Swapnil Nagle"
<swapsn@rediffmail.com>
Sent: Thursday, September 30, 2004 6:34 PM
Subject: Re: Multiple Address specification or match
> On Thu, 30 Sep 2004, Temp02 wrote:
>
> > No obviously a single source can't be both addresses, but the intent is
to
> > allow a single rule to be used to match sources from both source ranges.
>
> There is two ways for doing this
>
> a) Using two rules, one per IP address.
>
> b) Using an ippool/ipset storing the IP addresses.
>
> Regards
> Henrik
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Multiple Address specification or match
@ 2004-09-30 9:01 Temp02
2004-09-30 9:54 ` Eric Leblond
2004-09-30 11:38 ` Henrik Nordstrom
0 siblings, 2 replies; 14+ messages in thread
From: Temp02 @ 2004-09-30 9:01 UTC (permalink / raw)
To: Henrik Nordstrom; +Cc: netfilter-devel, Swapnil Nagle
thanks for your feedback but neither of these solutions are particularly
elegant.
The first (using more than one rule), requires the use of a lot more rules
than are really necessary, as an example, lets say that I wanted to prevent
access a range of subnets but allow everything else. Ideally I should be
able to:
iptables -A PREROUTING -d ! 10.0.0.0/8 -d ! 192.168.1.0/24 -d !
172.16.0.0/16 -m whatever -j ACCEPT
instead I would need three explicit drop rules and then an allow everything
else rule. (assuming a default drop policy).
The problem with the IPset/pool options are that they match only on a range
of addresses, not specifically by source or destination, also they seem to
require the use of another userspace program to actually build the sets
which in itself complicates the process.
Is it hard to extend the source and destination match functions to accept
multiple arguments?
> ----- Original Message -----
> From: "Henrik Nordstrom" <hno@marasystems.com>
> To: "Temp02" <temp02@bluereef.com.au>
> Cc: <netfilter-devel@lists.netfilter.org>; "Swapnil Nagle"
> <swapsn@rediffmail.com>
> Sent: Thursday, September 30, 2004 6:34 PM
> Subject: Re: Multiple Address specification or match
>
>
> > On Thu, 30 Sep 2004, Temp02 wrote:
> >
> > > No obviously a single source can't be both addresses, but the intent
is
> to
> > > allow a single rule to be used to match sources from both source
ranges.
> >
> > There is two ways for doing this
> >
> > a) Using two rules, one per IP address.
> >
> > b) Using an ippool/ipset storing the IP addresses.
> >
> > Regards
> > Henrik
> >
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Multiple Address specification or match
2004-09-30 9:01 Temp02
@ 2004-09-30 9:54 ` Eric Leblond
2004-09-30 11:42 ` Henrik Nordstrom
2004-09-30 11:38 ` Henrik Nordstrom
1 sibling, 1 reply; 14+ messages in thread
From: Eric Leblond @ 2004-09-30 9:54 UTC (permalink / raw)
To: netfilter-devel
[-- Attachment #1: Type: text/plain, Size: 431 bytes --]
On Thu, 2004-09-30 at 11:01, Temp02 wrote:
> thanks for your feedback but neither of these solutions are particularly
> elegant.
iptables/netfilter has to be efficient, rules generation script has to
be elegant. Having 3 rules is as efficient as your masked "or" rules if
it was coded and 3 separate rules are more simple than your global one
so in a way this is more elegant.
BR,
--
Eric Leblond <eric@inl.fr>
INL
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Multiple Address specification or match
2004-09-30 9:01 Temp02
2004-09-30 9:54 ` Eric Leblond
@ 2004-09-30 11:38 ` Henrik Nordstrom
2004-10-01 8:41 ` Temp02
1 sibling, 1 reply; 14+ messages in thread
From: Henrik Nordstrom @ 2004-09-30 11:38 UTC (permalink / raw)
To: Temp02; +Cc: netfilter-devel, Swapnil Nagle
On Thu, 30 Sep 2004, Temp02 wrote:
> The problem with the IPset/pool options are that they match only on a range
> of addresses, not specifically by source or destination
Eh? They match specificaly on either source or destination.
> also they seem to require the use of another userspace program to
> actually build the sets which in itself complicates the process.
True.
> Is it hard to extend the source and destination match functions to accept
> multiple arguments?
Yes and no.
It is not hard to make a custom match matching multiple IP addresses, but
it would be restricted in the number of addresses you can match.
If you need to group very many addresses then ippool/ipset is the correct
tool.
Regards
Henrik
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Multiple Address specification or match
2004-09-30 9:54 ` Eric Leblond
@ 2004-09-30 11:42 ` Henrik Nordstrom
0 siblings, 0 replies; 14+ messages in thread
From: Henrik Nordstrom @ 2004-09-30 11:42 UTC (permalink / raw)
To: Eric Leblond; +Cc: netfilter-devel
On Thu, 30 Sep 2004, Eric Leblond wrote:
> iptables/netfilter has to be efficient, rules generation script has to
> be elegant. Having 3 rules is as efficient as your masked "or" rules if
> it was coded and 3 separate rules are more simple than your global one
> so in a way this is more elegant.
For hipac this is true, but not really when using iptables.
Regards
Henrik
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Multiple Address specification or match
2004-09-30 8:59 ` Temp02
@ 2004-09-30 17:05 ` Simon Lodal
0 siblings, 0 replies; 14+ messages in thread
From: Simon Lodal @ 2004-09-30 17:05 UTC (permalink / raw)
To: netfilter-devel; +Cc: Temp02
> Is it hard to extend the source and destination match functions to accept
> multiple arguments?
Yes, they are pretty wired into iptables. And I would worry about their
performance.
But it should be easy to create a new match to do it. There is already
multiport and mport. The equivalent for addresses should not be hard.
Simon
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Multiple Address specification or match
2004-09-30 11:38 ` Henrik Nordstrom
@ 2004-10-01 8:41 ` Temp02
2004-10-01 8:47 ` Jozsef Kadlecsik
2004-10-01 10:39 ` Henrik Nordstrom
0 siblings, 2 replies; 14+ messages in thread
From: Temp02 @ 2004-10-01 8:41 UTC (permalink / raw)
To: Henrik Nordstrom; +Cc: netfilter-devel, Swapnil Nagle
The ippool and ipset matches only support linux 2.4 not 2.6 unfortunately.
The iprange match would suit my needs but it only allows a single match as
well. What would I need to change in iptables to allow the match to be
called more than once, as in:
iptables -m iprange 10.0.0.0-10.255.255.255 -m iprange
172.16.0.0-172.16.255.255
is this an easy to add switch somewhere?
thanks,
----- Original Message -----
From: "Henrik Nordstrom" <hno@marasystems.com>
To: "Temp02" <temp02@bluereef.com.au>
Cc: <netfilter-devel@lists.netfilter.org>; "Swapnil Nagle"
<swapsn@rediffmail.com>
Sent: Thursday, September 30, 2004 9:38 PM
Subject: Re: Multiple Address specification or match
> On Thu, 30 Sep 2004, Temp02 wrote:
>
> > The problem with the IPset/pool options are that they match only on a
range
> > of addresses, not specifically by source or destination
>
> Eh? They match specificaly on either source or destination.
>
> > also they seem to require the use of another userspace program to
> > actually build the sets which in itself complicates the process.
>
> True.
>
> > Is it hard to extend the source and destination match functions to
accept
> > multiple arguments?
>
> Yes and no.
>
> It is not hard to make a custom match matching multiple IP addresses, but
> it would be restricted in the number of addresses you can match.
>
> If you need to group very many addresses then ippool/ipset is the correct
> tool.
>
> Regards
> Henrik
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Multiple Address specification or match
2004-10-01 8:41 ` Temp02
@ 2004-10-01 8:47 ` Jozsef Kadlecsik
2004-10-01 10:39 ` Henrik Nordstrom
1 sibling, 0 replies; 14+ messages in thread
From: Jozsef Kadlecsik @ 2004-10-01 8:47 UTC (permalink / raw)
To: Temp02; +Cc: netfilter-devel, Swapnil Nagle, Henrik Nordstrom
On Fri, 1 Oct 2004, Temp02 wrote:
> The ippool and ipset matches only support linux 2.4 not 2.6 unfortunately.
I'm working on the rewriting of ipset, together with porting to 2.6.
> The iprange match would suit my needs but it only allows a single match as
> well. What would I need to change in iptables to allow the match to be
> called more than once, as in:
>
> iptables -m iprange 10.0.0.0-10.255.255.255 -m iprange
> 172.16.0.0-172.16.255.255
>
> is this an easy to add switch somewhere?
The basic problem is that iptables matches are AND-ed. In you example you
imply OR-ed matches.
Best regards,
Jozsef
-
E-mail : kadlec@blackhole.kfki.hu, kadlec@sunserv.kfki.hu
PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt
Address : KFKI Research Institute for Particle and Nuclear Physics
H-1525 Budapest 114, POB. 49, Hungary
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Multiple Address specification or match
2004-10-01 8:41 ` Temp02
2004-10-01 8:47 ` Jozsef Kadlecsik
@ 2004-10-01 10:39 ` Henrik Nordstrom
1 sibling, 0 replies; 14+ messages in thread
From: Henrik Nordstrom @ 2004-10-01 10:39 UTC (permalink / raw)
To: Temp02; +Cc: netfilter-devel, Swapnil Nagle
On Fri, 1 Oct 2004, Temp02 wrote:
> iptables -m iprange 10.0.0.0-10.255.255.255 -m iprange
> 172.16.0.0-172.16.255.255
>
> is this an easy to add switch somewhere?
Should work fine, except that it will then be a AND (both ranges must
match) so it does not make much sense..
Regards
Henrik
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2004-10-01 10:39 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-30 5:09 Multiple Address specification or match Temp02
2004-09-30 6:42 ` Swapnil Nagle
2004-09-30 6:47 ` Temp02
2004-09-30 8:34 ` Henrik Nordstrom
2004-09-30 8:59 ` Temp02
2004-09-30 17:05 ` Simon Lodal
2004-09-30 8:46 ` Andrew Hall
-- strict thread matches above, loose matches on Subject: below --
2004-09-30 9:01 Temp02
2004-09-30 9:54 ` Eric Leblond
2004-09-30 11:42 ` Henrik Nordstrom
2004-09-30 11:38 ` Henrik Nordstrom
2004-10-01 8:41 ` Temp02
2004-10-01 8:47 ` Jozsef Kadlecsik
2004-10-01 10:39 ` Henrik Nordstrom
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.