[code:1]
#! /bin/sh
# by doooom from [url]www.linuxsir.com[/url]
source /etc/sysconfig/rc
source $rc_functions
UPBW=10kbps
EDUPBW=4kbps
CEILBW=17kbps
# UPBW is the real upload bandwidth of the connection
# EDUPBW is the bandwidth assigned to edonky upload
# CEILBW is the maxium upload burst traffic
NETIF=ppp0
# outgoing net interface
case "$1" in
start)
echo "Turning on the Edonkey traffic control..."
tc qdisc add dev $NETIF root handle 1: htb default 11
tc class add dev $NETIF parent 1: classid 1:1 htb \
rate $CEILBW ceil $CEILBW
tc class add dev $NETIF parent 1:1 classid 1:10 htb \
rate $EDUPBW ceil $UPBW prio 1
tc filter add dev $NETIF protocol ip parent 1:0 prio 2 \
handle 1 fw flowid 1:10