All of lore.kernel.org
 help / color / mirror / Atom feed
* ipset and interfaces
@ 2011-05-24 11:19 Oskar Berggren
  2011-05-24 11:52 ` Jozsef Kadlecsik
  0 siblings, 1 reply; 6+ messages in thread
From: Oskar Berggren @ 2011-05-24 11:19 UTC (permalink / raw)
  To: netfilter-devel

Hi,

Regarding ipsets.... how crazy would it be to add a set type
containing interface names?

And how crazy would it be to add a set type containing tuples of
ip-address and interface name?  (I.e. the set match would look for ip,
and match if a tuple with the proper interface is found)


/Oskar

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: ipset and interfaces
  2011-05-24 11:19 ipset and interfaces Oskar Berggren
@ 2011-05-24 11:52 ` Jozsef Kadlecsik
  2011-05-24 12:23   ` Oskar Berggren
  0 siblings, 1 reply; 6+ messages in thread
From: Jozsef Kadlecsik @ 2011-05-24 11:52 UTC (permalink / raw)
  To: Oskar Berggren; +Cc: netfilter-devel

On Tue, 24 May 2011, Oskar Berggren wrote:

> Regarding ipsets.... how crazy would it be to add a set type
> containing interface names?

Usually the number of interfaces are not quite high in a system, so it 
does not seem required.

> And how crazy would it be to add a set type containing tuples of
> ip-address and interface name?  (I.e. the set match would look for ip,
> and match if a tuple with the proper interface is found)

What is the case where a combination of matches does not solve the issue? 
Something like this

-N interfaces
-A interfaces -i foo -j ACTION
...

-A rule -m set --match-set src -j interfaces

and thus you can match IP addresses and possible (incoming) interfaces 
easily.

Best regards,
Jozsef
-
E-mail  : kadlec@blackhole.kfki.hu, kadlec@mail.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] 6+ messages in thread

* Re: ipset and interfaces
  2011-05-24 11:52 ` Jozsef Kadlecsik
@ 2011-05-24 12:23   ` Oskar Berggren
  2011-05-24 12:37     ` Jozsef Kadlecsik
  0 siblings, 1 reply; 6+ messages in thread
From: Oskar Berggren @ 2011-05-24 12:23 UTC (permalink / raw)
  To: Jozsef Kadlecsik; +Cc: netfilter-devel

2011/5/24 Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>:
> On Tue, 24 May 2011, Oskar Berggren wrote:
>
>> Regarding ipsets.... how crazy would it be to add a set type
>> containing interface names?
>
> Usually the number of interfaces are not quite high in a system, so it
> does not seem required.

I have machines with plenty of vlans. About 700 interfaces in the
largest instance currently.
That said, I don't have a clear use case for this particular set type
currently, but out of curiosity,
would it be reasonably doable within the ipset framework?


>
>> And how crazy would it be to add a set type containing tuples of
>> ip-address and interface name?  (I.e. the set match would look for ip,
>> and match if a tuple with the proper interface is found)
>
> What is the case where a combination of matches does not solve the issue?
> Something like this
>
> -N interfaces
> -A interfaces -i foo -j ACTION
> ...
>
> -A rule -m set --match-set src -j interfaces
>
> and thus you can match IP addresses and possible (incoming) interfaces
> easily.


As above, about 700 interfaces, each with a generally just a few
source ip-addresses
expected for each interface, or a few subnets. I.e. in the simplest
case a single ip is
acceptable for a single interface, for a total of a couple of hundred
interfaces. This
is similar to rp_filter, but I had trouble getting that to work
predictably with multiple
routing tables. Currently I've solved it with a tree structure of
iptables chains and rules,
but being able to use a single set for this would look so much nicer.

/Oskar
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: ipset and interfaces
  2011-05-24 12:23   ` Oskar Berggren
@ 2011-05-24 12:37     ` Jozsef Kadlecsik
  2011-05-24 12:42       ` Anton VG
  2011-05-24 12:43       ` Mr Dash Four
  0 siblings, 2 replies; 6+ messages in thread
From: Jozsef Kadlecsik @ 2011-05-24 12:37 UTC (permalink / raw)
  To: Oskar Berggren; +Cc: netfilter-devel

[-- Attachment #1: Type: TEXT/PLAIN, Size: 2144 bytes --]

On Tue, 24 May 2011, Oskar Berggren wrote:

> 2011/5/24 Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>:
> > On Tue, 24 May 2011, Oskar Berggren wrote:
> >
> >> Regarding ipsets.... how crazy would it be to add a set type
> >> containing interface names?
> >
> > Usually the number of interfaces are not quite high in a system, so it
> > does not seem required.
> 
> I have machines with plenty of vlans. About 700 interfaces in the 
> largest instance currently. That said, I don't have a clear use case for 
> this particular set type currently, but out of curiosity, would it be 
> reasonably doable within the ipset framework?

Yes, I don't see any problem here.
 
> >> And how crazy would it be to add a set type containing tuples of
> >> ip-address and interface name?  (I.e. the set match would look for ip,
> >> and match if a tuple with the proper interface is found)
> >
> > What is the case where a combination of matches does not solve the issue?
> > Something like this
> >
> > -N interfaces
> > -A interfaces -i foo -j ACTION
> > ...
> >
> > -A rule -m set --match-set src -j interfaces
> >
> > and thus you can match IP addresses and possible (incoming) interfaces
> > easily.
> 
> As above, about 700 interfaces, each with a generally just a few source 
> ip-addresses expected for each interface, or a few subnets. I.e. in the 
> simplest case a single ip is acceptable for a single interface, for a 
> total of a couple of hundred interfaces. This is similar to rp_filter, 
> but I had trouble getting that to work predictably with multiple routing 
> tables. Currently I've solved it with a tree structure of iptables 
> chains and rules, but being able to use a single set for this would look 
> so much nicer.

So it looks like a valid case, for a new set type with interfaces and IP 
addresses/networks ;-) I'll work on it.

Best regards,
Jozsef
-
E-mail  : kadlec@blackhole.kfki.hu, kadlec@mail.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] 6+ messages in thread

* Re: ipset and interfaces
  2011-05-24 12:37     ` Jozsef Kadlecsik
@ 2011-05-24 12:42       ` Anton VG
  2011-05-24 12:43       ` Mr Dash Four
  1 sibling, 0 replies; 6+ messages in thread
From: Anton VG @ 2011-05-24 12:42 UTC (permalink / raw)
  To: Jozsef Kadlecsik; +Cc: Oskar Berggren, netfilter-devel

Hm, my largest instance is about 200 vlan's ;)

2011/5/24 Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>:
> On Tue, 24 May 2011, Oskar Berggren wrote:
>
>> 2011/5/24 Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>:
>> > On Tue, 24 May 2011, Oskar Berggren wrote:
>> >
>> >> Regarding ipsets.... how crazy would it be to add a set type
>> >> containing interface names?
>> >
>> > Usually the number of interfaces are not quite high in a system, so it
>> > does not seem required.
>>
>> I have machines with plenty of vlans. About 700 interfaces in the
>> largest instance currently. That said, I don't have a clear use case for
>> this particular set type currently, but out of curiosity, would it be
>> reasonably doable within the ipset framework?
>
> Yes, I don't see any problem here.
>
>> >> And how crazy would it be to add a set type containing tuples of
>> >> ip-address and interface name?  (I.e. the set match would look for ip,
>> >> and match if a tuple with the proper interface is found)
>> >
>> > What is the case where a combination of matches does not solve the issue?
>> > Something like this
>> >
>> > -N interfaces
>> > -A interfaces -i foo -j ACTION
>> > ...
>> >
>> > -A rule -m set --match-set src -j interfaces
>> >
>> > and thus you can match IP addresses and possible (incoming) interfaces
>> > easily.
>>
>> As above, about 700 interfaces, each with a generally just a few source
>> ip-addresses expected for each interface, or a few subnets. I.e. in the
>> simplest case a single ip is acceptable for a single interface, for a
>> total of a couple of hundred interfaces. This is similar to rp_filter,
>> but I had trouble getting that to work predictably with multiple routing
>> tables. Currently I've solved it with a tree structure of iptables
>> chains and rules, but being able to use a single set for this would look
>> so much nicer.
>
> So it looks like a valid case, for a new set type with interfaces and IP
> addresses/networks ;-) I'll work on it.
>
> Best regards,
> Jozsef
> -
> E-mail  : kadlec@blackhole.kfki.hu, kadlec@mail.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
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: ipset and interfaces
  2011-05-24 12:37     ` Jozsef Kadlecsik
  2011-05-24 12:42       ` Anton VG
@ 2011-05-24 12:43       ` Mr Dash Four
  1 sibling, 0 replies; 6+ messages in thread
From: Mr Dash Four @ 2011-05-24 12:43 UTC (permalink / raw)
  To: Jozsef Kadlecsik; +Cc: Oskar Berggren, netfilter-devel


> So it looks like a valid case, for a new set type with interfaces and IP 
> addresses/networks ;-) I'll work on it.
>   
Keep in mind though, that interfaces can be specified in "-i" as well as 
"-o" (i.e. input as well as output) - so you need to create some sort of 
matching mechanism which distinguishes between these. Obviously this is 
currently resolved in iptables with the "-i" and -"o" options respectively.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-05-24 12:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-24 11:19 ipset and interfaces Oskar Berggren
2011-05-24 11:52 ` Jozsef Kadlecsik
2011-05-24 12:23   ` Oskar Berggren
2011-05-24 12:37     ` Jozsef Kadlecsik
2011-05-24 12:42       ` Anton VG
2011-05-24 12:43       ` Mr Dash Four

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.