Wklej przykladowy kompletny skrypt dzielacy pasmo dla jednego usera..
o to Ci chodzi ?:
#!/bin/sh IPT=/usr/sbin/iptables TC=/sbin/tc LAN=eth0 LAN2=eth2 WAN=eth1 IMQ=imq0
# ---- Tu ustawiamy przepustowosc lacza WAN ---------
DOWNLOAD=2000kbit UPLOAD=512bit
# ----------------------------------------------------------------
BURST="burst 30k"
stop () { $IPT -t mangle -D FORWARD -i $WAN -j LIMITS >/dev/null 2>&1 $IPT -t mangle -D FORWARD -o $WAN -j LIMITS >/dev/null 2>&1 $IPT -t mangle -F LIMITS >/dev/null 2>&1 $IPT -t mangle -X LIMITS >/dev/null 2>&1
$IPT -t mangle -F OUTPUT #$IPT -t filter -F FORWARD
#$IPT -t mangle -D INPUT -p tcp --dport 8080 -j LIMITS >/dev/null 2>&1 #$IPT -t mangle -D OUTPUT -p tcp --sport 8080 -j LIMITS >/dev/null 2>&1
$TC qdisc del dev $LAN root 2> /dev/null $TC qdisc del dev $WAN root 2> /dev/null
}
start () { stop $IPT -t mangle -N LIMITS $IPT -t mangle -I FORWARD -i $WAN -j LIMITS $IPT -t mangle -I FORWARD -o $WAN -j LIMITS
$IPT -t mangle -I INPUT -p tcp --dport 8080 -j LIMITS >/dev/null 2>&1 $IPT -t mangle -I OUTPUT -p tcp --sport 8080 -j LIMITS >/dev/null 2>&1
# incomming traffic $TC qdisc add dev $LAN root handle 1:0 htb default 3 r2q 1 $TC class add dev $LAN parent 1:0 classid 1:1 htb rate 99000kbit ceil 99000kbit quantum 1500 $TC class add dev $LAN parent 1:1 classid 1:2 htb rate $DOWNLOAD ceil $DOWNLOAD
# outgoing traffic $TC qdisc add dev $WAN root handle 2:0 htb default 11 r2q 1 $TC class add dev $WAN parent 2:0 classid 2:1 htb rate $UPLOAD ceil $UPLOAD \n
_______________________________________________ lms mailing list lms@lists.lms.org.pl http://lists.lms.org.pl/mailman/listinfo/lms