12

When I run this cmd:

tc qdisc add dev eth0 root red limit 51200000 min 128000 max 512000 avpkt 1024 burst 200 ecn probability 0.5

i get

RTNETLINK answers: No such file or directory

I have configured the kernel for netfilters, and all the networking options in menuconfig.

I don't understand why this error occurs. I'm using iproute2-2.6.23 and Fedora 8.

This was working fine on my laptop, but not on my Desktop PC?

Diosney
  • 10,520
  • 15
  • 66
  • 111
vishal
  • 121
  • 1
  • 1
  • 3
  • Check `dmesg` output? There may be error messages there. Also check SELinux logs, I could imagine a shell may not have privileges for Netlink. – sarnold Jan 26 '11 at 09:45
  • kjournald starting. Commit interval 5 seconds EXT3 FS on sda1, internal journal EXT3-fs: mounted filesystem with ordered data mode. Adding 1835000k swap on /dev/mapper/VolGroup00-LogVol01. Priority:-1 extents:1 across:1835000k NET: Registered protocol family 10 lo: Disabled Privacy Extensions Clocksource tsc unstable (delta = -117591543 ns) eth0: no IPv6 routers present this is what i got as Demesd output , I have got one more doubt, is it because of the SELINUX status??? – vishal Jan 26 '11 at 10:28
  • with fedora 19 with selinux actived this work "tc qdisc add dev p4p1 root red limit 51200000 min 128000 max 512000 avpkt 1024 burst 200 ecn probability 0.5" – c4f4t0r Jan 01 '14 at 20:56
  • Possible duplicate of [RTNETLINK answers :No such file or directory error](https://stackoverflow.com/questions/9513981/rtnetlink-answers-no-such-file-or-directory-error) – hiddensunset4 Jul 01 '17 at 16:49

3 Answers3

2

The error could be due to a lack of support for traffic control in Linux kernel.

Here is an excerpt from documentation that lists kernel compilation options needed for proper operation of traffic control functionality in Linux:

Source: Traffic Control HOWTO - Kernel requirements

#
# QoS and/or fair queueing
#
CONFIG_NET_SCHED=y
CONFIG_NET_SCH_CBQ=m
CONFIG_NET_SCH_HTB=m
CONFIG_NET_SCH_CSZ=m
CONFIG_NET_SCH_PRIO=m
CONFIG_NET_SCH_RED=m
CONFIG_NET_SCH_SFQ=m
CONFIG_NET_SCH_TEQL=m
CONFIG_NET_SCH_TBF=m
CONFIG_NET_SCH_GRED=m
CONFIG_NET_SCH_DSMARK=m
CONFIG_NET_SCH_INGRESS=m
CONFIG_NET_QOS=y
CONFIG_NET_ESTIMATOR=y
CONFIG_NET_CLS=y
CONFIG_NET_CLS_TCINDEX=m
CONFIG_NET_CLS_ROUTE4=m
CONFIG_NET_CLS_ROUTE=y
CONFIG_NET_CLS_FW=m
CONFIG_NET_CLS_U32=m
CONFIG_NET_CLS_RSVP=m
CONFIG_NET_CLS_RSVP6=m
CONFIG_NET_CLS_POLICE=y

A kernel compiled with the above set of options will provide modular support for almost everything discussed in this documentation. The user may need to modprobe module before using a given feature.

VL-80
  • 517
  • 13
  • 29
0

On my system your command autoloads the sch_red module. The question is rather old so on a modern system the autoloading should work fine if you have the required module. Check if you miss the kernel module by running:

modprobe sch_red

If it prints nothing, then retry running tc command and see if it helps.

If not, ensure you have CONFIG_NET_SCH_RED (Random Early Detection) compiled in your kernel. More info at kernel documentation.

Zouppen
  • 1,214
  • 11
  • 17
0

I got this one after compiling the (in-tree) ralink wifi drivers on a system that did not include the usual array of pre-built modules. The modules loaded and the interface was there, but could not be set up:

ip link set wlanB up
RTNETLINK answers: No such file or directory

(Yes, wlanB is correct.) Eventually figured out the system was also missing the usual array of firmware in /lib/firmware. This was fixed with apt install firmware-ralink.

CodeClown42
  • 11,194
  • 1
  • 32
  • 67