All of lore.kernel.org
 help / color / mirror / Atom feed
* [LARTC] Addresses in u32 filter
@ 2001-02-05 12:24 Adrian
  2001-02-10 12:50 ` Adrian
  0 siblings, 1 reply; 2+ messages in thread
From: Adrian @ 2001-02-05 12:24 UTC (permalink / raw)
  To: lartc

<PRE>Hi,

I've a simple question. I've created queues and classes, and when going to
add the filters I need to indicate that packets comming from some 
addresses (10.0.1.0/24) must be inserted in a queue, and packets NOT
comming from that addresses (!10.0.1.0/24) must be inserted in other one.
The problem is that I don't know how to indicate the last one filter. I've
probed:

  tc filter add dev eth2 parent 8000:0 protocol ip pref 25 \
     u32 match ip src 10.0.1.0/24 flowid 8000:12

this is ok (for the first queue), but next:

  tc filter add dev eth2 parent 8000:0 protocol ip pref 100 \
     u32 match ip src !10.0.1.0/24 flowid 8000:11

shows me an error (program doesn't understand the &quot;!10.0.1.0/24&quot; format).
How can I indicate it?

I've thought in some alternative solutions. Por example, if I use this:

  tc filter add dev eth2 parent 8000:0 protocol ip pref 101 \
     u32 match ip src 10.0.1.0/24 flowid 8000:12

  tc filter add dev eth2 parent 8000:0 protocol ip pref 100 \
     u32 match ip src 0.0.0.0/0 flowid 8000:11

will packets be checked with the first filter (priority=101) and, if they
don't match (because they come from other than 10.0.1.0/24), then will be
admitted by the second filter?

Thanks in advance


								Adrián




</PRE>

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

* [LARTC] Addresses in u32 filter
  2001-02-05 12:24 [LARTC] Addresses in u32 filter Adrian
@ 2001-02-10 12:50 ` Adrian
  0 siblings, 0 replies; 2+ messages in thread
From: Adrian @ 2001-02-10 12:50 UTC (permalink / raw)
  To: lartc

<PRE>On Mon, 5 Feb 2001, Adrian wrote:

&gt;<i>   tc filter add dev eth2 parent 8000:0 protocol ip pref 25 \
</I>&gt;<i>      u32 match ip src 10.0.1.0/24 flowid 8000:12
</I>&gt;<i> 
</I>&gt;<i> this is ok (for the first queue), but next:
</I>&gt;<i> 
</I>&gt;<i>   tc filter add dev eth2 parent 8000:0 protocol ip pref 100 \
</I>&gt;<i>      u32 match ip src !10.0.1.0/24 flowid 8000:11
</I>&gt;<i> 
</I>&gt;<i> shows me an error (program doesn't understand the &quot;!10.0.1.0/24&quot; format).
</I>&gt;<i> How can I indicate it?
</I>&gt;<i> 
</I>
I've solved it! The solution is to use filter priorities. This is the
filter config that finally runs ok:

  tc filter add dev eth0 parent 8000:0 protocol ip pref 25 \
     u32 match ip src 10.0.1.1 flowid 8000:12

  tc filter add dev eth0 parent 8000:0 protocol ip pref 100 \
     u32 match ip src 0.0.0.0/0 flowid 8000:11

In short: first filter (with priority 25) is checked first and, if ip
packet doesn't match, the second filter (priority 100) will be checked. In
this way, packets from 10.0.1.1 will go to 8000:12 queue, and THE REST
(packets that ARE NOT FROM 10.0.1.1) will go to 8000:11.

Yes, it was very simple... But I remember that somewhere in the HowTo it's
said that &quot;lower number = lower priority&quot; (?), probably needs a fix.

Tnx

								Adrián



</PRE>

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

end of thread, other threads:[~2001-02-10 12:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-02-05 12:24 [LARTC] Addresses in u32 filter Adrian
2001-02-10 12:50 ` Adrian

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.