Skip to contentSkip to conversation

u32 filter question

LARTC Allan Gee 3 participants 3 messages Sep 20, 2002

lore
Share & tools
lore

Allan Gee

author
#0 lore raw

SGkgZ3V5cyBJIGhhdmUgYSBjb25maWcgYXMgZm9sbG93cyBmb3Igb25lIG9mIG15IG5ldHdvcmtz LiBJIHdhbnQgdG8gZ2l2ZSB0aGUgeHh4Lnh4eC54eHgueHh4L3h4IG5ldHdvcmsgNjRrYml0IGZv ciBldmVyeXRoaW5nIGZyb20gdGhlIGludGVybmV0IGJ1dCA4MDAwa2JpdCBmcm9tIG91ciBpbnRl cm5hbCBzZXJ2ZXJzIG9uIHl5eS55eXkueXl5Lnl5eS95eSBuZXR3b3JrLiBJdCBkb2VzIG5vdCB3 b3JrLiBJIG9ubHkgd2FudCB0byB1c2UgdTMyIGZpbHRlcnMuIEkgdGhpbmsgd2hhdCdzIGhhcHBl bmluZyBpcyB0aGUgZmlyc3QgZmxvd2lkIG9mIDE6MjEgaXMgY2F0Y2hpbmcgdGhlbSBhbmQgbm90 IGdldHRpbmcgdG8gdGhlIDE6NDAgZmxvd2lkLiBJcyB0aGlzIHJpZ2h0PyBUaGUgYm94IGhhcyB0 byBiZSBiZXR3ZWVuIHRoZSB4IG5ldHdvcmsgYW5kIHRoZSB5IG5ldHdvcmsuDQoNCg0KdGMgcWRp c2MgZGVsIGRldiBldGgxIHJvb3QgaGFuZGxlIDE6IGh0YiBkZWZhdWx0IDk5OSANCnRjIHFkaXNj IGFkZCBkZXYgZXRoMSByb290IGhhbmRsZSAxOiBodGIgZGVmYXVsdCA5OTkgDQp0YyBjbGFzcyBh ZGQgZGV2IGV0aDEgcGFyZW50IDE6IGNsYXNzaWQgMToxIGh0YiByYXRlIDEwMDAwa2JpdCANCnRj IGNsYXNzIGFkZCBkZXYgZXRoMSBwYXJlbnQgMToxIGNsYXNzaWQgMTo5OTkgaHRiIHJhdGUgMTAw MGtiaXQgY2VpbCAxMDAwMGtiaXQgDQp0YyBxZGlzYyBhZGQgZGV2IGV0aDEgcGFyZW50IDE6OTk5 IGhhbmRsZSAxOTk5OiBzZnEgcGVydHVyYiAxMCANCnRjIGNsYXNzIGFkZCBkZXYgZXRoMSBwYXJl bnQgMToxIGNsYXNzaWQgMToyIGh0YiByYXRlIDEwMDAwa2JpdCBxdWFudHVtIDE1MTQgDQp0YyBj bGFzcyBhZGQgZGV2IGV0aDEgcGFyZW50IDE6MiBjbGFzc2lkIDE6MjEgaHRiIHJhdGUgNjRrYml0 IGNlaWwgNjRrYml0IHF1YW50dW0gMTUxNCANCnRjIGNsYXNzIGFkZCBkZXYgZXRoMSBwYXJlbnQg MToyIGNsYXNzaWQgMTo0MCBodGIgcmF0ZSA4MDAwa2JpdCBjZWlsIDgwMDBrYml0IHF1YW50dW0g NzU3MDAwIA0KdGMgcWRpc2MgYWRkIGRldiBldGgxIHBhcmVudCAxOjIxIGhhbmRsZSAyMTAwOiBz ZnEgcGVydHVyYiAxMCANCnRjIHFkaXNjIGFkZCBkZXYgZXRoMSBwYXJlbnQgMTo0MCBoYW5kbGUg NDAwMDogc2ZxIHBlcnR1cmIgMTAgDQp0YyBmaWx0ZXIgYWRkIGRldiBldGgxIHByb3RvY29sIGlw IHBhcmVudCAxOjAgcHJpbyAxIHUzMiBtYXRjaCBpcCBkc3QgeHh4Lnh4eC54eHgueHh4Lnh4IGZs b3dpZCAxOjIxIA0KdGMgZmlsdGVyIGFkZCBkZXYgZXRoMSBwcm90b2NvbCBpcCBwYXJlbnQgMTow IHByaW8gMSB1MzIgbWF0Y2ggaXAgc3JjIHl5eS55eXkueXl5Lnl5eS95eSBtYXRjaCBpcCBkc3Qg eHh4Lnh4eC54eHgueHh4L3h4IGZsb3dpZCAxOjQwIA0KDQoNClJlZ2FyZHMgQWxsYW4gR2VlDQpF cXVhdGlvbg0KMDIxIDQxODE3NzcNCnd3dy5lcXVhdGlvbi5jby56YQ0K

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

#1 lore raw

Hi,

try to give the more specific filter a higher prio. if i understood "tc filter" right, the filters with higher prio are checked first.

in you're setup giving the last filter line "prio 0" should do the job.

Quoted 9 lines

Hi guys I have a config as follows for one of my networks. I want to give the xxx.xxx.xxx.xxx/xx network 64kbit for everything from the internet but 8000kbit from our internal servers on yyy.yyy.yyy.yyy/yy network. It does not work. I only want to use u32 filters. I think what's happening is the first flowid of 1:21 is catching them and not getting to the 1:40 flowid. Is this right? The box has to be between the x network and the y network.

Quoted 5 lines

tc qdisc del dev eth1 root handle 1: htb default 999
tc qdisc add dev eth1 root handle 1: htb default 999
tc class add dev eth1 parent 1: classid 1:1 htb rate 10000kbit tc class add dev eth1 parent 1:1 classid 1:999 htb rate 1000kbit ceil 10000kbit

tc qdisc add dev eth1 parent 1:999 handle 1999: sfq perturb

Quoted 3 lines

10
tc class add dev eth1 parent 1:1 classid 1:2 htb rate 10000kbit quantum 1514

tc class add dev eth1 parent 1:2 classid 1:21 htb rate 64kbit

Quoted 1 line

ceil 64kbit quantum 1514

tc class add dev eth1 parent 1:2 classid 1:40

Quoted 1 line

htb rate 8000kbit ceil 8000kbit quantum 757000

tc qdisc add dev eth1

Quoted 4 lines

parent 1:21 handle 2100: sfq perturb 10
tc qdisc add dev eth1 parent 1:40 handle 4000: sfq perturb 10 tc filter add dev eth1 protocol ip parent 1:0 prio 1 u32 match ip dst xxx.xxx.xxx.xxx.xx flowid 1:21

tc filter add dev eth1 protocol ip

Quoted 9 lines

parent 1:0 prio 1 u32 match ip src yyy.yyy.yyy.yyy/yy match ip dst xxx.xxx.xxx.xxx/xx flowid 1:40

Regards Allan Gee
Equation
021 4181777
www.equation.co.za
,S 隊X§ƒéb²ß¿ø°L)šŠYš�Û=jya¶Úşf¢–f§vÏZ�_æj)fjåŠËb�ú?•ªísáÎY3¾†ÛiÿùZ®×(®

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

#2 lore raw
In reply to Allan Gee
Quoted 4 lines · Tobias Geiger

Hi,

try to give the more specific filter a higher prio. if i understood "tc filter" right, the filters with higher prio are checked first.

But that's only for filters with the same parent. So it will work in this case. Or you enter the filters in the order they have to be checked :

tc filter add dev eth1 protocol ip parent 1:0 prio 1 u32 match ip src yyy.yyy.yyy.yyy/yy match ip dst xxx.xxx.xxx.xxx/xx flowid 1:40

tc filter add dev eth1 protocol ip parent 1:0 prio 1 u32 match ip dst xxx.xxx.xxx.xxx.xx flowid 1:21

Stef

Signature · 8 lines
[email protected]
 "Using Linux as bandwidth manager"
     http://www.docum.org/
     #lartc @ irc.oftc.net

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/