Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RTNETLINK answers :No such file or directory error

Tags:

linux

1. ETH=$1
2. LATENCY=$2
3. LOSS=$3
4. JITTER=$4
5. BW=$5
6. sudo /sbin/tc qdisc del dev eth0 root
7. sudo /sbin/tc qdisc add dev eth0 root handle 1: netem delay $LATENCY $JITTER 
8. sudo /sbin/tc qdisc add dev eth0 parent 1:1 handle 10: netem loss $LOSS
9. sudo /sbin/tc qdisc add dev eth0 parent 10:1 handle 20: htb default 1
10.sudo /sbin/tc class add dev eth0 parent 20: classid 0:1 htb rate $BW ceil $BW
11.sudo /sbin/tc qdisc show

The above code results in:

RTNETLINK answers :No such file or directory

error on line 8,9,10 upon execution.

like image 581
kalpan bhargav Avatar asked Mar 01 '12 09:03

kalpan bhargav


3 Answers

RTNETLINK answers :No such file or directory comes for 2 reason.

  • Executing tc qdisc with wrong options
  • Or Kernel module sch_netem is missing

So check first sch_netem is installed in your machine by using command lsmod -l. If it is missing install using command modprobe sch_netem.

Even after installing sch_netem, if you get this same error means you are executing with wrong option. For example you can add a impairment on a network interface using ip qdisc add dev .... Similarly for removing this you can do ip qdisc delete dev.... If you are trying to delete an impairment without any prior add means, then also you get this error. And also for wrong options also you get this error.

like image 109
rashok Avatar answered Nov 12 '22 05:11

rashok


The problem is with missing kernel modules and/or kernel support. Make sure you can run

modprobe sch_netem

I also had to rebuild the kernel after I enabled because there's something built-in that is enabled after you enable network emulation.

See also http://forums.fedoraforum.org/showthread.php?t=285408 and http://www.linuxfoundation.org/collaborate/workgroups/networking/netem

like image 37
David Dombrowsky Avatar answered Nov 12 '22 04:11

David Dombrowsky


Your handles and parent handles don't match. e.g change to:

7. sudo /sbin/tc qdisc add dev eth0 root handle 1:1 netem delay $LATENCY $JITTER 
8. sudo /sbin/tc qdisc add dev eth0 parent 1:1 handle 10:1 netem loss $LOSS
9. sudo /sbin/tc qdisc add dev eth0 parent 10:1 handle 20:1 htb default 1
10.sudo /sbin/tc class add dev eth0 parent 20:1 classid 0:1 htb rate $BW ceil $BW

and it should work.

like image 2
Kimvais Avatar answered Nov 12 '22 04:11

Kimvais