Just a few clarifications from my previous post.
I think I never need a professional edition of dd-wrt. It seems that professional edition is needed only by routers that requires it. Base on dd-wrt supported router’s list, my router D-Link Dir-600 ver A1 is supported and never needs activation.
More dd-wrt functions are accessible through the use of Commands under the Administration Tab menu. It needs coding of course.
I am beginning to get a grasp of this dd-wrt thingy. After few days of googling and reading. I managed to set a specific download limit for each user. There is more – each user are assigned with a guaranteed minimum speed. No user will be deprived of bandwidth even during peak hours. No one is allowed to use torrents. I set the Layer-7 torrent to have a limit (download and upload) of 1kbps. I bet no one is patient enough to use that speed.
First, I turned off the Qos function completely. Then I made my code using the Robson’s WRT54 Script Generator (look for it on google). I replaced all the “modprobe” words with “insmod”. Pasted all the code in Commands under the Administration Tab and saved it as Firewall. Rebooted the router and boila!
Here is the code I used.
#-------------------------------------------- #WRT54 Script Generator v1.02 #(C) 2006-2007 Robert "Robson" Mytkowski #-------------------------------------------- insmod ipt_layer7 TCA="tc class add dev br0" TFA="tc filter add dev br0" TQA="tc qdisc add dev br0" SFQ="sfq perturb 10" tc qdisc del dev br0 root tc qdisc add dev br0 root handle 1: htb tc class add dev br0 parent 1: classid 1:1 htb rate 3000kbit $TCA parent 1:1 classid 1:10 htb rate 700kbit ceil 2000kbit prio 1 $TCA parent 1:1 classid 1:11 htb rate 700kbit ceil 2000kbit prio 1 $TCA parent 1:1 classid 1:12 htb rate 300kbit ceil 1000kbit prio 2 $TCA parent 1:1 classid 1:13 htb rate 200kbit ceil 1000kbit prio 3 $TCA parent 1:1 classid 1:14 htb rate 200kbit ceil 1000kbit prio 3 $TCA parent 1:1 classid 1:15 htb rate 300kbit ceil 1000kbit prio 2 $TCA parent 1:1 classid 1:16 htb rate 300kbit ceil 1000kbit prio 2 $TCA parent 1:1 classid 1:17 htb rate 1kbit ceil 1kbit prio 4 $TQA parent 1:10 handle 10: $SFQ $TQA parent 1:11 handle 11: $SFQ $TQA parent 1:12 handle 12: $SFQ $TQA parent 1:13 handle 13: $SFQ $TQA parent 1:14 handle 14: $SFQ $TQA parent 1:15 handle 15: $SFQ $TQA parent 1:16 handle 16: $SFQ $TQA parent 1:17 handle 17: $SFQ $TFA parent 1:0 prio 1 protocol ip handle 10 fw flowid 1:10 $TFA parent 1:0 prio 1 protocol ip handle 11 fw flowid 1:11 $TFA parent 1:0 prio 2 protocol ip handle 12 fw flowid 1:12 $TFA parent 1:0 prio 3 protocol ip handle 13 fw flowid 1:13 $TFA parent 1:0 prio 3 protocol ip handle 14 fw flowid 1:14 $TFA parent 1:0 prio 2 protocol ip handle 15 fw flowid 1:15 $TFA parent 1:0 prio 2 protocol ip handle 16 fw flowid 1:16 $TFA parent 1:0 prio 4 protocol ip handle 17 fw flowid 1:17 iptables -t mangle -A POSTROUTING -d 192.168.1.101 -j MARK --set-mark 10 iptables -t mangle -A POSTROUTING -d 192.168.1.102 -j MARK --set-mark 11 iptables -t mangle -A POSTROUTING -d 192.168.1.103 -j MARK --set-mark 12 iptables -t mangle -A POSTROUTING -d 192.168.1.104 -j MARK --set-mark 13 iptables -t mangle -A POSTROUTING -d 192.168.1.105 -j MARK --set-mark 14 iptables -t mangle -A POSTROUTING -d 192.168.1.106 -j MARK --set-mark 15 iptables -t mangle -A POSTROUTING -d 192.168.1.107 -j MARK --set-mark 16 iptables -t mangle -A POSTROUTING -m layer7 --l7proto bittorrent -j MARK --set-mark 17 TCAU="tc class add dev imq0" TFAU="tc filter add dev imq0" TQAU="tc qdisc add dev imq0" insmod imq insmod ipt_IMQ ip link set imq0 up tc qdisc del dev imq0 root tc qdisc add dev imq0 root handle 1: htb tc class add dev imq0 parent 1: classid 1:1 htb rate 700kbit $TCAU parent 1:1 classid 1:10 htb rate 70kbit ceil 650kbit prio 1 $TCAU parent 1:1 classid 1:11 htb rate 70kbit ceil 650kbit prio 1 $TCAU parent 1:1 classid 1:12 htb rate 70kbit ceil 300kbit prio 2 $TCAU parent 1:1 classid 1:13 htb rate 70kbit ceil 300kbit prio 3 $TCAU parent 1:1 classid 1:14 htb rate 70kbit ceil 300kbit prio 3 $TCAU parent 1:1 classid 1:15 htb rate 70kbit ceil 300kbit prio 2 $TCAU parent 1:1 classid 1:16 htb rate 70kbit ceil 300kbit prio 2 $TCAU parent 1:1 classid 1:17 htb rate 1kbit ceil 1kbit prio 4 $TQAU parent 1:10 handle 10: $SFQ $TQAU parent 1:11 handle 11: $SFQ $TQAU parent 1:12 handle 12: $SFQ $TQAU parent 1:13 handle 13: $SFQ $TQAU parent 1:14 handle 14: $SFQ $TQAU parent 1:15 handle 15: $SFQ $TQAU parent 1:16 handle 16: $SFQ $TQAU parent 1:17 handle 17: $SFQ $TFAU parent 1:0 prio 1 protocol ip handle 10 fw flowid 1:10 $TFAU parent 1:0 prio 1 protocol ip handle 11 fw flowid 1:11 $TFAU parent 1:0 prio 2 protocol ip handle 12 fw flowid 1:12 $TFAU parent 1:0 prio 3 protocol ip handle 13 fw flowid 1:13 $TFAU parent 1:0 prio 3 protocol ip handle 14 fw flowid 1:14 $TFAU parent 1:0 prio 2 protocol ip handle 15 fw flowid 1:15 $TFAU parent 1:0 prio 2 protocol ip handle 16 fw flowid 1:16 $TFAU parent 1:0 prio 4 protocol ip handle 17 fw flowid 1:17 iptables -t mangle -A PREROUTING -s 192.168.1.101 -j MARK --set-mark 10 iptables -t mangle -A PREROUTING -s 192.168.1.102 -j MARK --set-mark 11 iptables -t mangle -A PREROUTING -s 192.168.1.103 -j MARK --set-mark 12 iptables -t mangle -A PREROUTING -s 192.168.1.104 -j MARK --set-mark 13 iptables -t mangle -A PREROUTING -s 192.168.1.105 -j MARK --set-mark 14 iptables -t mangle -A PREROUTING -s 192.168.1.106 -j MARK --set-mark 15 iptables -t mangle -A PREROUTING -s 192.168.1.107 -j MARK --set-mark 16 iptables -t mangle -A PREROUTING -m layer7 --l7proto bittorrent -j MARK --set-mark 17 iptables -t mangle -A PREROUTING -j IMQ --todev 0
Note that I used IP addresses instead of MAC. I set each user to have a static IPs uder the Services menu. Download limiting and torrent catching are working properly but the upload shaping function is not. I never know yet the reason for this. Maybe it is a bug. I hope I can find solution for this soon.


