ADSL Bandwidth Management HOWTO, Dan Singletary [free ebook reader for ipad .txt] 📗
- Author: Dan Singletary
- Performer: -
Book online «ADSL Bandwidth Management HOWTO, Dan Singletary [free ebook reader for ipad .txt] 📗». Author Dan Singletary
iptables -t mangle -F MYSHAPER-OUT 2> /dev/null > /dev/null
iptables -t mangle -X MYSHAPER-OUT 2> /dev/null > /dev/null
iptables -t mangle -D PREROUTING -i $DEV -j MYSHAPER-IN 2> /dev/null > /dev/null
iptables -t mangle -F MYSHAPER-IN 2> /dev/null > /dev/null
iptables -t mangle -X MYSHAPER-IN 2> /dev/null > /dev/null
ip link set imq0 down 2> /dev/null > /dev/null
rmmod imq 2> /dev/null > /dev/null
if [ "$1" = "stop" ]
then
echo "Shaping removed on $DEV." exitfi
##################################################### Outbound Shaping (limits total bandwidth to RATEUP) set queue size to give latency of about 2 seconds on low-prio packetsip link set dev $DEV qlen 30
changes mtu on the outbound device. Lowering the mtu will result in lower latency but will also cause slightly lower throughput due to IP and TCP protocol overhead.ip link set dev $DEV mtu 1000
add HTB root qdisctc qdisc add dev $DEV root handle 1: htb default 26
add main rate limit classestc class add dev $DEV parent 1: classid 1:1 htb rate ${RATEUP}kbit
add leaf classes - We grant each class at LEAST it's "fair share" of bandwidth. this way no class will ever be starved by another class. Each class is also permitted to consume all of the available bandwidth if no other classes are in use.tc class add dev $DEV parent 1:1 classid 1:20 htb rate $[$RATEUP/7]kbit ceil ${RATEUP}kbit prio 0
tc class add dev $DEV parent 1:1 classid 1:21 htb rate $[$RATEUP/7]kbit ceil ${RATEUP}kbit prio 1
tc class add dev $DEV parent 1:1 classid 1:22 htb rate $[$RATEUP/7]kbit ceil ${RATEUP}kbit prio 2
tc class add dev $DEV parent 1:1 classid 1:23 htb rate $[$RATEUP/7]kbit ceil ${RATEUP}kbit prio 3
tc class add dev $DEV parent 1:1 classid 1:24 htb rate $[$RATEUP/7]kbit ceil ${RATEUP}kbit prio 4
Comments (0)