Networking Forums

Networking Forums > Computer Networking > Linux Networking > tc filter question

Reply
Thread Tools Display Modes

tc filter question

 
 
nsa.usa@gmail.com
Guest
Posts: n/a

 
      03-30-2007, 09:59 AM
Hi,

If there are two filters that lead the same packet to different leafs
then where does it go?

I have set up two classes like this:
______________
| 1:0 |
-------------------------
__|__ __|__
| 1:1 | | 1:2 |
-------- ---------

tc qdisc del dev eth1 root
tc qdisc add dev eth1 root handle 1: htb
tc class add dev eth1 parent 1: classid 1:1 htb rate 54mbit ceil
54mbit burst 15k prio 0
tc class add dev eth1 parent 1: classid 1:2 htb rate 200kbit ceil
54mbit burst 6k prio 1

And then I filter like this:

tc filter add dev eth1 parent 1:0 protocol ip u32 match ip src
192.168.10.0/24 match
ip dst 192.168.10.0/24 classid 1:1
tc filter add dev eth1 parent 1:0 protocol ip u32 match ip src
192.168.10.0/24 match
ip dst 192.168.10.34 classid 1:2

As you can see a packet going to 192.168.10.34 will match both
filters! So wheer does it go?
Another example of the filtering could be like this:

tc filter add dev eth1 parent 1:0 protocol ip u32 match ip dst
192.168.10.0/24 classid 1:1
tc filter add dev eth1 parent 1:0 protocol ip u32 match ip src
192.168.10.1 classid 1:2

This would match f.ex. a packet from 192.168.10.1 to 192.168.10.10 to
both filters!! again, where does it go? The first one? the last one?
both???

I've read the lartc but couldn't see anything about this.

A secondary question:
I've set up the above because my server has a slow 200kbit *incoming*
link from the internet that it forwards to eth1 which has a lot of
clients attached. Now I shape this traffic further with more classes
under the one above (it gets split into like 128k for certain users
and 20k for othe users etc etc), but I have the 54mbit class 1:1
because I want to have traffic betweeen users on eth1 to be
unrestricted. Is this a good way of doing it? or is there a better
way?

Thanks!

Regards,
Tobias

My whole eth1 section is below (I have removed lots of filters in the
interrest of length, but you'll get the idea)
eth1 has multiple ip's as in: 192.168.10.1 and 10.1.0.1

#eth1
tc qdisc del dev eth1 root
tc qdisc add dev eth1 root handle 1: htb default 40
tc class add dev eth1 parent 1: classid 1:1 htb rate 54mbit ceil
54mbit burst 15k pri
o 0
tc class add dev eth1 parent 1: classid 1:2 htb rate 200kbit ceil
54mbit burst 6k pri
o 1

tc class add dev eth1 parent 1:2 classid 1:10 htb rate 126kbit ceil
54mbit burst 6kbi
t prio 0
tc class add dev eth1 parent 1:2 classid 1:20 htb rate 27kbit ceil
54mbit burst 3kbit
prio 1
tc class add dev eth1 parent 1:2 classid 1:30 htb rate 37kbit ceil
54mbit burst 3kbit
prio 2
tc class add dev eth1 parent 1:2 classid 1:40 htb rate 10kbit ceil
54mbit burst 1kbit
prio 3

tc qdisc add dev eth1 parent 1:1 handle 101: sfq perturb 10

tc qdisc add dev eth1 parent 1:10 handle 210: sfq perturb 10
tc qdisc add dev eth1 parent 1:20 handle 220: sfq perturb 10
tc qdisc add dev eth1 parent 1:30 handle 230: sfq perturb 10
tc qdisc add dev eth1 parent 1:40 handle 240: sfq perturb 10

# classid 1:1 (unlimited, from server to behind nat)
tc filter add dev eth1 parent 1:0 protocol ip u32 match ip src
192.168.10.0/24 match
ip dst 192.168.10.0/24 classid 1:1
tc filter add dev eth1 parent 1:0 protocol ip u32 match ip src
10.0.0.0/8 match ip ds
t 10.0.0.0/8 classid 1:1
tc filter add dev eth1 parent 1:0 protocol ip u32 match ip src
10.0.0.0/8 match ip ds
t 192.168.10.0/24 classid 1:1
tc filter add dev eth1 parent 1:0 protocol ip u32 match ip src
192.168.10.0/24 match
ip dst 10.0.0.0/8 classid 1:1

# classid 1:10
tc filter add dev eth1 parent 1:0 protocol ip u32 match ip dst
10.0.0.0/8 classid 1:10
tc filter add dev eth1 parent 1:0 protocol ip u32 match ip dst
192.168.31.0/24 classid 1:10
#etc
#etc
..
..
# classid 1:20
tc filter add dev eth1 parent 1:0 protocol ip u32 match ip dst
192.168.10.2 classid 1:20
tc filter add dev eth1 parent 1:0 protocol ip u32 match ip dst
192.168.10.20 classid 1:20
#etc
#etc
..
..
#classid 1:30
tc filter add dev eth1 parent 1:0 protocol ip u32 match ip dst
192.168.10.80 classid 1:30
tc filter add dev eth1 parent 1:0 protocol ip u32 match ip dst
192.168.10.81 classid 1:30
#etc
#etc
..
..

 
Reply With Quote
 
 
 
 
nsa.usa@gmail.com
Guest
Posts: n/a

 
      04-03-2007, 09:10 AM
Hi again,

Its been a while and still no responses? does *nobody* know the answer
to this one?
Anyway, does someone then know more sources for info on this apart
from lartc.org? Thanks

Regards,
Tobias

 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
IPSec Filter Question Chupacabra Windows Networking 2 07-24-2006 01:19 PM
Packet filter statistics question chukie_egg Linux Networking 0 04-13-2005 10:00 AM
Another filter question- no really a new one Nat Stott Broadband 2 01-23-2004 09:49 PM
Filter Question! Franklin P Patchey Broadband 3 01-23-2004 04:00 PM
Filter question Ian Gibbons Broadband 3 08-11-2003 02:51 PM



1 2 3 4 5 6 7 8 9 10 11