depois de alguns dias eu faço
eu uso-o para o openvpn sobre o freeradius
tc qdisc del dev br0 root
tc qdisc add dev br0 root handle 1: htb
tc class add dev br0 parent 1: classid 1:1 htb rate "LineBandwidth"kbit
tc class add dev br0 parent 1:1 classid 1:10 htb rate "MinUserBand"kbit ceil "MaxUserBand"kbit prio 2 #----- bandwidth and classid
tc filter add dev br0 parent 1:0 prio 2 protocol ip handle 10 fw flowid 1:10 #----- MarkID1 and classId
iptables -t mangle -A POSTROUTING -d "RealUserIP" -j MARK --set-mark 10 #----- RealIP and markID1
tc qdisc add dev br0 ingress
tc filter add dev br0 parent ffff: protocol ip handle 50 fw police rate "MinUserBand"kbit mtu 12k burst 10k drop #----- BandWidth and MarkID2
iptables -t mangle -A PREROUTING -s "RealUserIP" -j MARK --set-mark 50 #----- RealIP and MarkID2