sous linux oui
sous windows surement
tiens, mon script pour linux
DEV=eth0
UPLINK=900000
USERLINK=192
IPS=" 192.168.0.12 \
192.168.0.20 \
192.168.0.55 \
192.168.0.59 \
192.168.0.64 \
192.168.0.66 \
192.168.0.69 \
192.168.0.110 \
192.168.0.253"
#########################################################
if [ "$1" = "status" ]
then
tc -s qdisc ls dev $DEV
tc -s class ls dev $DEV
exit
fi
# clean existing down- and uplink qdiscs, hide errors
tc qdisc del dev $DEV root 2> /dev/null > /dev/null
#tc qdisc del dev $DEV ingress 2> /dev/null > /dev/null
if [ "$1" = "stop" ]
then
exit
fi
tc qdisc add dev $DEV root handle 10: cbq bandwidth 10mbit avpkt 1000
tc class add dev $DEV parent 10: classid 10:1 cbq bandwidth 10mbit rate 10mbit allot 1514 maxburst 20 avpkt 1000 bounded prio 3
tc class add dev $DEV parent 10:1 classid 10:10 cbq rate ${UPLINK}kbit bandwidth 10mbit allot 1514 maxburst 20 avpkt 1000 prio 3 bounded
tc filter add dev $DEV parent 10: protocol ip prio 100 u32 match ip src 192.168.0.254 flowid 10:10
i=11
for ip in $IPS
do
tc class add dev $DEV parent 10:1 classid 10:$i cbq rate ${USERLINK}kbit bandwidth 10mbit allot 1514 maxburst 20 avpkt 1000 prio 3 bounded
tc filter add dev $DEV parent 10: protocol ip prio 100 u32 match ip dst $ip flowid 10:$i
i=`expr $i + 1`
done
Je précise que ma connexion est sur eth1 et donc pour limiter en download sur eth1 il faut limiter l'upload sur eth0 ...
Message édité par XDMJ le 23-01-2003 à 15:13:24