I have this startup script running on a linux router, designed to shape traffic that is being downloaded to my LAN from hosts on a 172.16.16.0 subnet. Traffic coming into the LAN is done so through a network adapter called "internal"
Code:
tc qdisc add dev internal root handle 1: htb default 1
tc class add dev internal parent 1: classid 1:1 htb rate 51.03mbit ceil 51.03mbit prio 0
tc class add dev internal parent 1: classid 1:2 htb rate 32.5mbit ceil 32.5mbit prio 1
iptables -t mangle -A POSTROUTING -o internal -d 172.16.16.15 -j CLASSIFY --set-class 1:2
My intention is to first limit all bandwidth to ~50mbps, but then have a single host be limited to ~30mbps total. This works fine.
I now want to set up a prioritization whereby, if traffic is being downloaded to any host OTHER than 172.16.16.15, they will be slowed down less and .15 will take the hit. This is the part that doesn't work. The way i'm testing is to start a download from a random host, and then start one on 172.16.16.15. I would expect that the random host should have little slowdown happen, and .15 would be slowed considerably until traffic has stopped flowing to the random host. But this doesn't seem to happen. Traffic balances out fairly equally, and I can tell no difference between using prio as I am here and not using it at all.
As far as I understand, prio band 0 takes precedence over band 1, and band 1 over band 2, etc. So i would think that, if band 0 has traffic flowing and band 1 starts a transfer, band 0 would maintain its full bandwidth and band 1 would be slowed accordingly.
Or am i missing something?