All of lore.kernel.org
 help / color / mirror / Atom feed
* Status of iptables target support in ipset
@ 2012-10-26 13:58 Csordás Csaba Ifj.
  2012-10-27  7:26 ` Jozsef Kadlecsik
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Csordás Csaba Ifj. @ 2012-10-26 13:58 UTC (permalink / raw)
  To: netfilter

Dear Reader,

I would like to ask when will it possible writing such rules as
mentioned in $SUBJECT.

For example:

ipset new foo hash:ip
ipset add foo 192.168.1.1 -t filter -A FORWARD -j LOG ... -t nat -A
POSTROUTING -j SNAT ... -t mangle -A PREROUTING -j MARK ...


Sorry for my bad English.

Regards,
Csord√°s Csaba Ifj.

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

* Re: Status of iptables target support in ipset
  2012-10-26 13:58 Status of iptables target support in ipset Csordás Csaba Ifj.
@ 2012-10-27  7:26 ` Jozsef Kadlecsik
  2012-11-07 10:03 ` Eliezer Croitoru
  2012-11-12 12:27 ` Ed W
  2 siblings, 0 replies; 9+ messages in thread
From: Jozsef Kadlecsik @ 2012-10-27  7:26 UTC (permalink / raw)
  To: Csordás Csaba Ifj.; +Cc: netfilter

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

On Fri, 26 Oct 2012, Csordás Csaba Ifj. wrote:

> I would like to ask when will it possible writing such rules as
> mentioned in $SUBJECT.
> 
> For example:
> 
> ipset new foo hash:ip
> ipset add foo 192.168.1.1 -t filter -A FORWARD -j LOG ... -t nat -A
> POSTROUTING -j SNAT ... -t mangle -A PREROUTING -j MARK ...

That's still on the todo list of ipset. Also, it requires some (small) 
changes in the netfilter core itself. After adding some locking 
improvements to ipset, hopefully I can start working on the subject.

Best regards,
Jozsef
-
E-mail  : kadlec@blackhole.kfki.hu, kadlecsik.jozsef@wigner.mta.hu
PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt
Address : Wigner Research Centre for Physics, Hungarian Academy of Sciences
          H-1525 Budapest 114, POB. 49, Hungary

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

* Re: Status of iptables target support in ipset
  2012-10-26 13:58 Status of iptables target support in ipset Csordás Csaba Ifj.
  2012-10-27  7:26 ` Jozsef Kadlecsik
@ 2012-11-07 10:03 ` Eliezer Croitoru
  2012-11-07 20:51   ` Jozsef Kadlecsik
  2012-11-12 12:27 ` Ed W
  2 siblings, 1 reply; 9+ messages in thread
From: Eliezer Croitoru @ 2012-11-07 10:03 UTC (permalink / raw)
  To: "Csordás Csaba Ifj."; +Cc: netfilter

On 10/26/2012 3:58 PM, Csordás Csaba Ifj. wrote:
> Dear Reader,
>
> I would like to ask when will it possible writing such rules as
> mentioned in $SUBJECT.
>
> For example:
>
> ipset new foo hash:ip
> ipset add foo 192.168.1.1 -t filter -A FORWARD -j LOG ... -t nat -A
> POSTROUTING -j SNAT ... -t mangle -A PREROUTING -j MARK ...
>
>
> Sorry for my bad English.

I wont say it will not give some benefits but it seems to me like a 
simple bash script can do the same thing.

Eliezer
>
> Regards,
> Csordás Csaba Ifj.


-- 
Eliezer Croitoru
https://www1.ngtech.co.il
IT consulting for Nonprofit organizations
eliezer <at> ngtech.co.il

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

* Re: Status of iptables target support in ipset
  2012-11-07 10:03 ` Eliezer Croitoru
@ 2012-11-07 20:51   ` Jozsef Kadlecsik
  2012-11-07 21:07     ` Eliezer Croitoru
  0 siblings, 1 reply; 9+ messages in thread
From: Jozsef Kadlecsik @ 2012-11-07 20:51 UTC (permalink / raw)
  To: Eliezer Croitoru; +Cc: "Csordás Csaba Ifj.", netfilter

On Wed, 7 Nov 2012, Eliezer Croitoru wrote:

> On 10/26/2012 3:58 PM, Csord?s Csaba Ifj. wrote:
> > 
> > I would like to ask when will it possible writing such rules as
> > mentioned in $SUBJECT.
> > 
> > For example:
> > 
> > ipset new foo hash:ip
> > ipset add foo 192.168.1.1 -t filter -A FORWARD -j LOG ... -t nat -A
> > POSTROUTING -j SNAT ... -t mangle -A PREROUTING -j MARK ...
> > 
> > 
> > Sorry for my bad English.
> 
> I wont say it will not give some benefits but it seems to me like a simple
> bash script can do the same thing.

No, the idea is to add targets per set entry. I.e. 

ipset add foo 192.168.1.1 -t filter -A FORWARD -j LOG --log-prefix foo
ipset add foo 192.168.1.2 -t filter -A FORWARD -j LOG --log-prefix bar

Best regards,
Jozsef
-
E-mail  : kadlec@blackhole.kfki.hu, kadlecsik.jozsef@wigner.mta.hu
PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt
Address : Wigner Research Centre for Physics, Hungarian Academy of Sciences
          H-1525 Budapest 114, POB. 49, Hungary

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

* Re: Status of iptables target support in ipset
  2012-11-07 20:51   ` Jozsef Kadlecsik
@ 2012-11-07 21:07     ` Eliezer Croitoru
  2012-11-07 21:42       ` Jozsef Kadlecsik
  0 siblings, 1 reply; 9+ messages in thread
From: Eliezer Croitoru @ 2012-11-07 21:07 UTC (permalink / raw)
  To: Jozsef Kadlecsik; +Cc: "Csordás Csaba Ifj.", netfilter

On 11/7/2012 10:51 PM, Jozsef Kadlecsik wrote:
> No, the idea is to add targets per set entry. I.e.
>
> ipset add foo 192.168.1.1 -t filter -A FORWARD -j LOG --log-prefix foo
> ipset add foo 192.168.1.2 -t filter -A FORWARD -j LOG --log-prefix bar
>
> Best regards,
> Jozsef
hoo now I understand.
but ipset was meant to be a "set match", no?
In iptables it's a module that match a rule if it matches a set...
it's kind of confusing from iptables idea point of view for me.

Regards,
Eliezer

-- 
Eliezer Croitoru
https://www1.ngtech.co.il
IT consulting for Nonprofit organizations
eliezer <at> ngtech.co.il

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

* Re: Status of iptables target support in ipset
  2012-11-07 21:07     ` Eliezer Croitoru
@ 2012-11-07 21:42       ` Jozsef Kadlecsik
  2012-11-08  0:47         ` Sven-Haegar Koch
  0 siblings, 1 reply; 9+ messages in thread
From: Jozsef Kadlecsik @ 2012-11-07 21:42 UTC (permalink / raw)
  To: Eliezer Croitoru; +Cc: "Csordás Csaba Ifj.", netfilter

On Wed, 7 Nov 2012, Eliezer Croitoru wrote:

> On 11/7/2012 10:51 PM, Jozsef Kadlecsik wrote:
> > No, the idea is to add targets per set entry. I.e.
> > 
> > ipset add foo 192.168.1.1 -t filter -A FORWARD -j LOG --log-prefix foo
> > ipset add foo 192.168.1.2 -t filter -A FORWARD -j LOG --log-prefix bar
> > 
> hoo now I understand.
> but ipset was meant to be a "set match", no?
> In iptables it's a module that match a rule if it matches a set...
> it's kind of confusing from iptables idea point of view for me.

The SET target then would be extended as a "match and return the result of 
the target(s) belonging to the element":

iptables -A FORWARD -j SET --match-set foo dst

Best regards,
Jozsef
-
E-mail  : kadlec@blackhole.kfki.hu, kadlecsik.jozsef@wigner.mta.hu
PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt
Address : Wigner Research Centre for Physics, Hungarian Academy of Sciences
          H-1525 Budapest 114, POB. 49, Hungary

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

* Re: Status of iptables target support in ipset
  2012-11-07 21:42       ` Jozsef Kadlecsik
@ 2012-11-08  0:47         ` Sven-Haegar Koch
  0 siblings, 0 replies; 9+ messages in thread
From: Sven-Haegar Koch @ 2012-11-08  0:47 UTC (permalink / raw)
  To: Jozsef Kadlecsik
  Cc: Eliezer Croitoru, "Csordás Csaba Ifj.", netfilter

On Wed, 7 Nov 2012, Jozsef Kadlecsik wrote:

> On Wed, 7 Nov 2012, Eliezer Croitoru wrote:
> 
> > On 11/7/2012 10:51 PM, Jozsef Kadlecsik wrote:
> > > No, the idea is to add targets per set entry. I.e.
> > > 
> > > ipset add foo 192.168.1.1 -t filter -A FORWARD -j LOG --log-prefix foo
> > > ipset add foo 192.168.1.2 -t filter -A FORWARD -j LOG --log-prefix bar
> > > 
> > hoo now I understand.
> > but ipset was meant to be a "set match", no?
> > In iptables it's a module that match a rule if it matches a set...
> > it's kind of confusing from iptables idea point of view for me.
> 
> The SET target then would be extended as a "match and return the result of 
> the target(s) belonging to the element":
> 
> iptables -A FORWARD -j SET --match-set foo dst

Sounds very interesting to me!

We currently have long chains with in principle:

	-d a.b.c.d -j MARK --set-mark 0x4711
	-d a.b.c.e -j MARK --set-mark 0x4712
and in a seperate chain
	-s a.b.c.d -j MARK --set-mark 0x4711
	-s a.b.c.e -j MARK --set-mark 0x4712

sorting users into tc shaping queues, one queue per user to limit him to 
his personal bandwidth limit (limit not shared with other users). With 
sometimes 200-400 users it hurts quite a bit. Creating sub-chains helped,
but it is still bad, and did not make the iptables-restore input 
generating easier.

An ipset support with targets sounds very nice!

Looking forward to it,

c'ya
sven-haegar

-- 
Three may keep a secret, if two of them are dead.
- Ben F.

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

* Re: Status of iptables target support in ipset
  2012-10-26 13:58 Status of iptables target support in ipset Csordás Csaba Ifj.
  2012-10-27  7:26 ` Jozsef Kadlecsik
  2012-11-07 10:03 ` Eliezer Croitoru
@ 2012-11-12 12:27 ` Ed W
  2012-11-12 15:18   ` Jozsef Kadlecsik
  2 siblings, 1 reply; 9+ messages in thread
From: Ed W @ 2012-11-12 12:27 UTC (permalink / raw)
  To: "Csordás Csaba Ifj."; +Cc: netfilter

On 26/10/2012 14:58, Csordás Csaba Ifj. wrote:
> Dear Reader,
>
> I would like to ask when will it possible writing such rules as
> mentioned in $SUBJECT.
>
> For example:
>
> ipset new foo hash:ip
> ipset add foo 192.168.1.1 -t filter -A FORWARD -j LOG ... -t nat -A
> POSTROUTING -j SNAT ... -t mangle -A PREROUTING -j MARK ...
>

At this point haven't you re-implemented almost the whole of netfilter 
inside ipset? (Or is that the point?).

Where do we draw the line?

Seems like an interesting idea anyway!

Ed W


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

* Re: Status of iptables target support in ipset
  2012-11-12 12:27 ` Ed W
@ 2012-11-12 15:18   ` Jozsef Kadlecsik
  0 siblings, 0 replies; 9+ messages in thread
From: Jozsef Kadlecsik @ 2012-11-12 15:18 UTC (permalink / raw)
  To: Ed W; +Cc: "Csordás Csaba Ifj.", netfilter

On Mon, 12 Nov 2012, Ed W wrote:

> On 26/10/2012 14:58, Csord?s Csaba Ifj. wrote:
> > Dear Reader,
> > 
> > I would like to ask when will it possible writing such rules as
> > mentioned in $SUBJECT.
> > 
> > For example:
> > 
> > ipset new foo hash:ip
> > ipset add foo 192.168.1.1 -t filter -A FORWARD -j LOG ... -t nat -A
> > POSTROUTING -j SNAT ... -t mangle -A PREROUTING -j MARK ...
> >  
> At this point haven't you re-implemented almost the whole of netfilter 
> inside ipset? (Or is that the point?).

No, not at all. The user part of ipset should be linked with libxtables 
and use the parser, structures from there. And the kernel part would call 
the corresponding netfilter target modules directly.

ipset is great for mass-matching. The functionality would just add the 
support of individual actions for the elements.

Best regards,
Jozsef
-
E-mail  : kadlec@blackhole.kfki.hu, kadlecsik.jozsef@wigner.mta.hu
PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt
Address : Wigner Research Centre for Physics, Hungarian Academy of Sciences
          H-1525 Budapest 114, POB. 49, Hungary

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

end of thread, other threads:[~2012-11-12 15:18 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-26 13:58 Status of iptables target support in ipset Csordás Csaba Ifj.
2012-10-27  7:26 ` Jozsef Kadlecsik
2012-11-07 10:03 ` Eliezer Croitoru
2012-11-07 20:51   ` Jozsef Kadlecsik
2012-11-07 21:07     ` Eliezer Croitoru
2012-11-07 21:42       ` Jozsef Kadlecsik
2012-11-08  0:47         ` Sven-Haegar Koch
2012-11-12 12:27 ` Ed W
2012-11-12 15:18   ` Jozsef Kadlecsik

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.