obmedzovac rychlosti
pod windows ani pod linux som nikdy nepouzival obmedzovac rychlosti. kedze vsak som v nedavnej minulosti zabral kapacitu celej bytovky, tak s tym treba nieco robit... download este ako tak ok, ale ten upload...
takze otazka znie: existuje nejaky program, ktory by dokazal regulovat download a upload? teda by sa dalo nastavit napriklad maximalny upload 20kb/s a download 50 kb/s?
dopredu samozrejme dakujem...
nutna spolupraca s programami typu frostwire (alebo nejake podobne P2P), internetovy prehliadac (najlepsie opera), a s programom ktorrent...
Pre pridávanie komentárov sa musíte prihlásiť.
je tam nejaky prikaz? nieco ako
$ set_maximum_download=50 set_maximum_upload=20
asi chcem moc :(
http://www.linuximq.net/
#!/bin/bash
SHAPE_IPS="10.107.14.3"
MAX_UP_SPEED=96
MAX_DOWN_SPEED=256
IMQ_DEVICE=imq1
WLAN_DEVICE=wlan1
free_qdisc () {
/usr/local/sbin/tc qdisc del dev $WLAN_DEVICE root &> /dev/null
/usr/local/sbin/tc qdisc del dev $IMQ_DEVICE root &> /dev/null
}
install_qdisc () {
/usr/local/sbin/tc qdisc add dev $WLAN_DEVICE root handle 1: htb default 0
/usr/local/sbin/tc qdisc add dev $IMQ_DEVICE root handle 1: htb default 0
}
install_class () {
/usr/local/sbin/tc class add dev $WLAN_DEVICE parent 1: classid 1:1 htb rate ${MAX_DOWN_SPEED}kbit burst $((MAX_DOWN_SPEED / 50))kbit
/usr/local/sbin/tc class add dev $IMQ_DEVICE parent 1: classid 1:1 htb rate ${MAX_UP_SPEED}kbit burst $((MAX_UP_SPEED / 50))kbit
}
install_filters () {
for IP in $SHAPE_IPS; do
tc filter add dev $WLAN_DEVICE parent 1: protocol ip prio 10 u32 \
match ip dst $IP/32 \
flowid 1:1
tc filter add dev $IMQ_DEVICE parent 1: protocol ip prio 10 u32 \
match ip src $IP/32 \
flowid 1:1
done
}
install_imq () {
iptables -t mangle -I PREROUTING -i $WLAN_DEVICE -j IMQ --todev ${IMQ_DEVICE#imq*}
ip link set $IMQ_DEVICE up
}
free_imq () {
iptables -t mangle -D PREROUTING -i $WLAN_DEVICE -j IMQ --todev ${IMQ_DEVICE#imq*} &> /dev/null
ip link set $IMQ_DEVICE down &> /dev/null
}
case "$1" in
start)
free_qdisc
free_imq
install_qdisc
install_class
install_imq
install_filters
exit 0
;;
stop)
free_qdisc
free_imq
;;
*)
echo "Syntax: shape_users.sh start|stop"
;;
esac
Spravne nastavit a vyladit shaper nie je len taka jednoducha zalezitost ako sa niekomu zda. Pozri si ten priklad je to len ukazka nemusi byt vobec funkcny ja som ho neskusal :)).