I am new to Linux and my goal is to create simple traffic control for "eth0" or "lo" using the tc command (or other commands like ifconfig or iptables, but I don't think I need them).
My kernel is 2.6.18-238.el5 GNU / Linux, and I use redhat.
my script:
tc qdisc del dev $DEV root tc qdisc add dev $DEV root handle 1: htb default 10 tc class add dev $DEV parent 1: classid 1:10 htb rate $DNLD tc filter add dev $DEV parent 1: protocol ip u32 match ip dport $input_port 0xffff flowid 1:10
and $ DNLD is the bandwidth limit, $ DEV is eth0 or lo, and $ input_port is the port I want to limit.
I read many pages on the Internet and realized that it should be written that way, but these lines do not limit a specific port, but all ports.
I tried to use also βsportβ, but it also does not work. so I donβt understand what the problem is.
Another weird thing is that the bandwidth limit seems to work, and the reset line also works, and this is the first line: tc qdisc del dev $ DEV root)
but still, the output line after I write this: "RTNETLINK answers: there is no such file or directory" and I do not know why and if it does any damage.
Please let me know if you need any other information. I will be glad if someone can help me. thanks in advance.
source share