currently im using this script to restrict limits
its working fine on downloading speed, but i cant work on uploading speed, plz can any one tell how can i limit uploads to?#!/bin/bash
IFACE="eth1"
CRATE="40Kbit"
if [ "$1" = "status" ]
then
tc -s qdisc ls dev $IFACE
tc -s class ls dev $IFACE
exit
fi
echo "Cleaning qdiscs if exists any"
# clean existing down- and uplink qdiscs, hide errors
tc qdisc del dev $IFACE root 2> /dev/null > /dev/null
if [ "$1" = "stop" ]
then
exit
fi
echo "Now Setting $CRATE per user at Interface $IFACE"
ipdstprefix="192.168.0."
classid="2"
classidnos="254"
classidnos2=$classidnos
ipdst="2"
tc qdisc add dev $IFACE root handle 10: cbq bandwidth 10Mbit avpkt 1000
tc class add dev $IFACE parent 10:0 classid 10:1 cbq bandwidth 10Mbit rate 10Mbit allot 1514 weight 1Mbit prio 8 maxburst 20 avpkt 1000
while [ $classid -lt $classidnos ]
do
tc class add dev $IFACE parent 10:1 classid 10:$classid cbq bandwidth 10Mbit rate $CRATE allot 1514 weight 1Kbit prio 5 maxburst 20 avpkt 1000 bounded
classid=$[$classid+1]
done
while [ $ipdst -lt $classidnos2 ]
do
tc filter add dev $IFACE parent 10:0 protocol ip prio 100 u32 match ip dst $ipdstprefix$ipdst flowid 10:$ipdst
ipdst=$[$ipdst+1]
done