Answer the question
In order to leave comments, you need to log in
Shaping p2p traffic on linux + tc + ndpi?
I'm using a router with OpenWRT. The task is to make incoming P2P/eDonkey traffic have a lower priority than the rest, and occupy only the free part of the channel.
I do the following:
tc qdisc add dev br-lan root handle 1: htb default 20
tc class add dev br-lan parent 1: classid 1:1 htb rate 100Mbps
# класс под P2P трафик
tc class add dev br-lan parent 1:1 classid 1:10 htb rate 1kbps ceil 100Mbps prio 10
# класс под остальной трафик
tc class add dev br-lan parent 1:1 classid 1:20 htb rate 1kbps ceil 100Mbps prio 0
iptables -t mangle -A POSTROUTING -m ndpi --bittorrent -j CLASSIFY --set-class 1:10
iptables -t mangle -A POSTROUTING -m ndpi --edonkey -j CLASSIFY --set-class 1:10
Answer the question
In order to leave comments, you need to log in
You are shaping outgoing traffic, not incoming traffic. You can’t shape incoming traffic “just like that”, you need to somehow make it outgoing. For example, via IMQ or IFB
So much time has already passed, but it turns out that they sent me an answer on another forum ..
I'll write it here, I hope it will come in handy for someone:
the error is that your ceiling is specified as 100Mb / s (100Mbs), but it should be 100Mbit, or rather, less than this value by 5-10%. Therefore, the queue is empty and prioritization does not work at all.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question