PDA

View Full Version : wondershapper - tc traffic shapping



imsp
05-Nov-2013, 12:50
Hello.
That is my first post.

I'm trying to limit the traffic (inboud/outbound) on eth0, that is my internet interface

So, after fight (and loose) with tc, I found a script (Wonder Shaper) that it does for my.
However, when I run it, on the last line I see an error :

RTNETLINK answers: No such file or directory
We have an error talking to the kernel


:~/script/wondershaper-1.1a # bash -x /root/script/wondershaper-1.1a/wshaper
+ DOWNLINK=6000
+ UPLINK=6000
+ DEV=eth0
+ NOPRIOHOSTSRC=80
+ NOPRIOHOSTDST=
+ NOPRIOPORTSRC=
+ NOPRIOPORTDST=
+ '[' '' = status ']'
+ tc qdisc del dev eth0 root
+ tc qdisc del dev eth0 ingress
+ '[' '' = stop ']'
+ tc qdisc add dev eth0 root handle 1: cbq avpkt 1000 bandwidth 10mbit
+ tc class add dev eth0 parent 1: classid 1:1 cbq rate 6000kbit allot 1500 prio 5 bounded isolated
+ tc class add dev eth0 parent 1:1 classid 1:10 cbq rate 6000kbit allot 1600 prio 1 avpkt 1000
+ tc class add dev eth0 parent 1:1 classid 1:20 cbq rate 5400kbit allot 1600 prio 2 avpkt 1000
+ tc class add dev eth0 parent 1:1 classid 1:30 cbq rate 4800kbit allot 1600 prio 2 avpkt 1000
+ tc qdisc add dev eth0 parent 1:10 handle 10: sfq perturb 10
+ tc qdisc add dev eth0 parent 1:20 handle 20: sfq perturb 10
+ tc qdisc add dev eth0 parent 1:30 handle 30: sfq perturb 10
+ tc filter add dev eth0 parent 1:0 protocol ip prio 10 u32 match ip tos 0x10 0xff flowid 1:10
+ tc filter add dev eth0 parent 1:0 protocol ip prio 11 u32 match ip protocol 1 0xff flowid 1:10
+ tc filter add dev eth0 parent 1: protocol ip prio 12 u32 match ip protocol 6 0xff match u8 0x05 0x0f at 0 match u16 0x0000 0xffc0 at 2 flowid 1:10
+ for a in '$NOPRIOHOSTSRC'
+ tc filter add dev eth0 parent 1: protocol ip prio 16 u32 match ip src 80 flowid 1:30
+ tc filter add dev eth0 parent 1: protocol ip prio 18 u32 match ip dst 0.0.0.0/0 flowid 1:20
+ tc qdisc add dev eth0 handle ffff: ingress
+ tc filter add dev eth0 parent ffff: protocol ip prio 50 u32 match ip src 0.0.0.0/0 police rate 6000kbit burst 10k drop flowid :1
RTNETLINK answers: No such file or directory
We have an error talking to the kernel
My kernel is:

Linux XXXX 3.0.13-0.27-default #1 SMP Wed Feb 15 13:33:49 UTC 2012 (d73692b) x86_64 x86_64 x86_64 GNU/Linux

I test also with wshaper.htb on same .tar, and load the module sch_netem again

Modules are loaded , but I'm not secure that are all


2:~/script/wondershaper-1.1a # lsmod |egrep -i "ipt*|sch*|cls|cqb|htb" --color
sch_htb 22286 0
sch_netem 17743 0
sch_ingress 12866 1
cls_u32 17162 5
sch_sfq 17326 3
sch_cbq 26381 1
iproute version :


# rpm -qa|grep iproute
x86_64-iproute2-2.6.37-3.5
iproute2-2.6.29.1-6.22.48


# cat /etc/SuSE-release
SUSE Linux Enterprise Server 11 (x86_64)
VERSION = 11
PATCHLEVEL = 2

Please, can anyone help me?

The true is that I don't have experiencie with SuSE (hmm ok.. I use the 4.6 version I guess, a few years ago)

TIA

PD: posted originally on: http://forums.opensuse.org/english/get-technical-help-here/network-internet/491748-wondershapper-tc-traffic-shapping.html

jmozdzen
05-Nov-2013, 13:25
Hi imsp,

+ tc qdisc add dev eth0 handle ffff: ingress
+ tc filter add dev eth0 parent ffff: protocol ip prio 50 u32 match ip src 0.0.0.0/0 police rate 6000kbit burst 10k drop flowid :1
RTNETLINK answers: No such file or directory
We have an error talking to the kernel

while I have no experience with tc so far, the "tc" man page suggests that the statement "tc qdisc add dev eth0 handle ffff: ingress" is missing a reference to the parent/root:

add Add a qdisc, class or filter to a node. For all entities, a parent must be passed, either by passing its ID or by attaching directly to the root of a device.
So I'd expect either "parent something" or "root", as can be seen with other "qdisc add" statements in your trace output.

While (if my assumptions really apply) the first statement then fails without reporting an error, the second statement fails because the parent handle (ffff:) doesn't exist.

Regards,
Jens