Re: [LARTC] Addresses in u32 filter

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 5 Feb 2001, Adrian wrote:

>   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 "!10.0.1.0/24" format).
> How can I indicate it?
> 

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 "lower number = lower priority" (?), probably needs a fix.

Tnx

								Adrián




[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux