5

I've been searching for few days now but couldn't find the solution to my problem.

I have a VPS running Debian 7, and I have root access.

I am trying to add some traffic shaping (using HTB), so the first line I tried to type was this one :

tc qdisc add dev tun0 root handle 1: htb default 10

But it appears to be wrong somehow, because I get the following error :

RTNETLINK answers: No such file or directory

My ifconfig shows an interface tun0, so it exists. I also tried on venet0 anyway and it fails with the same error.

When I do tc qdisc list I have only the following rule :

qdisc pfifo_fast 0: dev tun0 root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1

I really can't find what's wrong.

NB : I upgraded the package iproute (according to Debian's doc, it's where tc is), but it didn't do any better.

Raphael Laurent
  • 219
  • 1
  • 6
  • 17

1 Answers1

8

RTNETLINK answers: No such file or directory is tc's way of saying that it can't find something - in this case: most probably the htb scheduler. To test and make sure try

modprobe sch_htb

You will probably get an error.

And this probably means that your VPS provider is not using the default kernels from debian upstream. They usually provide you with a list of kernels to chose from, but I'd expect all of them to be crippled like the one running. You will not be able to change the kernel they are using, but there is chance (though not a big one) they haven't disabled module loading in the kernel. In that case you can try to build and install the htb module. You can try using ModuleAssistant for that.

If all else fails, contact the customer support.

skarap
  • 733
  • 5
  • 7
  • I already installed ModuleAssistant, but couldn't find the HTB module. The command is : `m-a a-i htb`, right? (also tried sch_htb and a whole bunch of other stuff, no more success) – Raphael Laurent Jul 31 '14 at 19:27
  • I see. You'll have to try and do it manually then. Take a look at http://www.cyberciti.biz/tips/build-linux-kernel-module-against-installed-kernel-source-tree.html – skarap Jul 31 '14 at 19:39
  • I tried following some of these steps, but I can't even find the kernel-headers. I'll try to send a request to the support of the VPS. – Raphael Laurent Jul 31 '14 at 21:14
  • What's the full kernel version? – skarap Jul 31 '14 at 21:42
  • 2.6.32-042stab092.2 – Raphael Laurent Jul 31 '14 at 22:20
  • Take a look here http://openvz.org/Download/kernel/rhel6/042stab092.2 . Though - it's an openvz kernel (so your VPS is an openvz container without it's own kernel if I'm not mistaken) which probably means adding a new module is pretty close to impossible.. – skarap Jul 31 '14 at 22:25
  • Thank you very much, I consider the problem solved (I'll see with the support of my VPS provider what can be done, or change provider for this special task). I now have a better understanding on what's going on. – Raphael Laurent Aug 01 '14 at 07:01
  • (I cannot grant the bounty before another 9 hours, but will do) – Raphael Laurent Aug 01 '14 at 07:11
  • I can run 'modprobe sch_netem` command, it doesn't give any errors. Also `lsmod | grep -i sch_netem` returns `sch_netem 17306 0`. But still `qdisk change` command gives me error: `RTNETLINK answers :No such file or directory` – Syed Aqeel Ashiq Aug 10 '15 at 12:16
  • I don't get any error with ` modprobe sch_htb` but what does it exactly do ? I get the error as in the question however. – Mona Jalal Dec 18 '15 at 20:32
  • `modprobe` loads the specified kernel module into the kernel. In original author's case that module was missing from their system. If is not failing in your case (double-check with `lsmod | grep sch_htb`), then it is another problem. You could check to make sure the interface name is correct. – skarap Dec 25 '15 at 13:54