Linux Netfilter discussions
 help / color / mirror / Atom feed
* Re: Ranges and Single IPs
       [not found] <d95317090804091138t3f12f5feo51d16968715ede7b@mail.gmail.com>
@ 2008-04-09 18:40 ` Gilad Benjamini
  2008-04-09 19:15   ` Jan Engelhardt
  0 siblings, 1 reply; 7+ messages in thread
From: Gilad Benjamini @ 2008-04-09 18:40 UTC (permalink / raw)
  To: netfilter

I'd like to write a rule for a group. A group can include both single
IP addresses and ranges of addresses.
ipset can do the job with single addresses.
ipragne can do the job with ranges

How can I combine the two ?

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

* Re: Ranges and Single IPs
  2008-04-09 18:40 ` Ranges and Single IPs Gilad Benjamini
@ 2008-04-09 19:15   ` Jan Engelhardt
  2008-04-09 19:17     ` Gilad Benjamini
  0 siblings, 1 reply; 7+ messages in thread
From: Jan Engelhardt @ 2008-04-09 19:15 UTC (permalink / raw)
  To: Gilad Benjamini; +Cc: netfilter


On Wednesday 2008-04-09 20:40, Gilad Benjamini wrote:

>I'd like to write a rule for a group. A group can include both single
>IP addresses and ranges of addresses.
>ipset can do the job with single addresses.
>ipragne can do the job with ranges
>
>How can I combine the two ?

A range can be modeled upon collections of single addresses.
In short, you still use ipset; it will convert a range
to a number of single addresses and everything is fine. No?

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

* Re: Ranges and Single IPs
  2008-04-09 19:15   ` Jan Engelhardt
@ 2008-04-09 19:17     ` Gilad Benjamini
  2008-04-09 19:23       ` Jan Engelhardt
  2008-04-09 20:27       ` Jan Engelhardt
  0 siblings, 2 replies; 7+ messages in thread
From: Gilad Benjamini @ 2008-04-09 19:17 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: netfilter

True, but I am looking for a more optimized solution

2008/4/9, Jan Engelhardt <jengelh@computergmbh.de>:
>
>  On Wednesday 2008-04-09 20:40, Gilad Benjamini wrote:
>
>  >I'd like to write a rule for a group. A group can include both single
>  >IP addresses and ranges of addresses.
>  >ipset can do the job with single addresses.
>  >iprange can do the job with ranges
>  >
>  >How can I combine the two ?
>
>
> A range can be modeled upon collections of single addresses.
>  In short, you still use ipset; it will convert a range
>  to a number of single addresses and everything is fine. No?
>

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

* Re: Ranges and Single IPs
  2008-04-09 19:17     ` Gilad Benjamini
@ 2008-04-09 19:23       ` Jan Engelhardt
  2008-04-09 20:27       ` Jan Engelhardt
  1 sibling, 0 replies; 7+ messages in thread
From: Jan Engelhardt @ 2008-04-09 19:23 UTC (permalink / raw)
  To: Gilad Benjamini; +Cc: netfilter


On Wednesday 2008-04-09 21:17, Gilad Benjamini wrote:

>True, but I am looking for a more optimized solution

ipset is likely to optimize it when the iptree (dunno
what it was called) methods is used.

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

* Re: Ranges and Single IPs
  2008-04-09 19:17     ` Gilad Benjamini
  2008-04-09 19:23       ` Jan Engelhardt
@ 2008-04-09 20:27       ` Jan Engelhardt
  2008-04-10  7:21         ` Jozsef Kadlecsik
  1 sibling, 1 reply; 7+ messages in thread
From: Jan Engelhardt @ 2008-04-09 20:27 UTC (permalink / raw)
  To: Gilad Benjamini; +Cc: netfilter


On Wednesday 2008-04-09 21:17, Gilad Benjamini wrote:

>True, but I am looking for a more optimized solution


I assume ipset's iptree is smart enough to do short-circuiting
if you have /24, /16 or /8 networks.

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

* Re: Ranges and Single IPs
  2008-04-09 20:27       ` Jan Engelhardt
@ 2008-04-10  7:21         ` Jozsef Kadlecsik
  2008-04-10  8:26           ` Покотиленко Костик
  0 siblings, 1 reply; 7+ messages in thread
From: Jozsef Kadlecsik @ 2008-04-10  7:21 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: Gilad Benjamini, netfilter

On Wed, 9 Apr 2008, Jan Engelhardt wrote:

> On Wednesday 2008-04-09 21:17, Gilad Benjamini wrote:
> 
> >True, but I am looking for a more optimized solution
> 
> I assume ipset's iptree is smart enough to do short-circuiting
> if you have /24, /16 or /8 networks.

If you have got whole networks (/n), then ipset is smart enough to handle 
it (nethash type). If you have got ranges, then iptreemap type is the best 
choice.

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] 7+ messages in thread

* Re: Ranges and Single IPs
  2008-04-10  7:21         ` Jozsef Kadlecsik
@ 2008-04-10  8:26           ` Покотиленко Костик
  0 siblings, 0 replies; 7+ messages in thread
From: Покотиленко Костик @ 2008-04-10  8:26 UTC (permalink / raw)
  To: Jozsef Kadlecsik; +Cc: Jan Engelhardt, Gilad Benjamini, netfilter

В Чтв, 10/04/2008 в 09:21 +0200, Jozsef Kadlecsik пишет:
> On Wed, 9 Apr 2008, Jan Engelhardt wrote:
> 
> > On Wednesday 2008-04-09 21:17, Gilad Benjamini wrote:
> > 
> > >True, but I am looking for a more optimized solution
> > 
> > I assume ipset's iptree is smart enough to do short-circuiting
> > if you have /24, /16 or /8 networks.
> 
> If you have got whole networks (/n), then ipset is smart enough to handle 
> it (nethash type). If you have got ranges, then iptreemap type is the best 
> choice.

But, regarding this question, is there any way one can use IP-networks
and single IP-addresses in the same set? Personally I was unable to do
that since ipset doesn't accepts netmask of 32 or 31.

Say, I have the following set of ips and nets, could I and how could I
keep that in one set?:

192.168.0.0/24
192.168.1.128/30
192.168.2.1/32

-- 
Покотиленко Костик <casper@meteor.dp.ua>


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

end of thread, other threads:[~2008-04-10  8:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <d95317090804091138t3f12f5feo51d16968715ede7b@mail.gmail.com>
2008-04-09 18:40 ` Ranges and Single IPs Gilad Benjamini
2008-04-09 19:15   ` Jan Engelhardt
2008-04-09 19:17     ` Gilad Benjamini
2008-04-09 19:23       ` Jan Engelhardt
2008-04-09 20:27       ` Jan Engelhardt
2008-04-10  7:21         ` Jozsef Kadlecsik
2008-04-10  8:26           ` Покотиленко Костик

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox