######rate limit
tc qdisc del dev eth1 root
tc qdisc add dev eth1 root handle 200: cbq bandwidth 10Mbit avpkt 1000
tc class add dev eth1 parent 200:0 classid 200:1 cbq bandwidth 10Mbit rate 10Mbit allot 1514 weight 2Kbit prio 8 maxburst 8 avpkt 1000 bounded
tc class add dev eth1 parent 200:1 classid 200:2 cbq bandwidth 10Mbit rate 810Kbit allot 1513 weight 1Mbit prio 5 maxburst 8 avpkt 1000 bounded
tc qdisc add dev eth1 parent 200:2 sfq quantum 1514b perturb 15
#i=9
#while [ $i -lt 36 ]
#do
#tc filter add dev eth1 parent 200:0 protocol ip prio 25 u32 match ip dst 192.168.1.$i flowid 200:2
#i=`expr $i + 1`
#done
tc filter add dev eth1 parent 200:0 protocol ip prio 25 u32 match ip dst 192.168.1.0/24 flowid 200:2
复制代码
给你参考这个,一个分类的队列限制