Posted: Mon Mar 28, 2011 5:08 Post subject: A way to do QoS working for Upload and Download
If QoS option in GUI is OFF the imq module will always be unload by the dd-wrt, and if is ON it will delete your QoS settings in the firewall script.
So i did this
# Startup Script
# write /tmp/loop.sh and /tmp/qos.sh
cat <<EOF > /tmp/loop.sh
# Verifing if imq1 is up each 15 secs, if not run qos.sh to setup QoS
while [ 1 ]; do
ifconfig imq1 > /dev/null
if [ \$? -eq "1" ]
#QoS Script using imq1 to Upload and Download
cat <<EOF > /tmp/qos.sh
iptables -t mangle -F
iptables -t mangle -Z
iptables -t mangle -X
ip link set imq1 up
tc qdisc del dev imq1 root
tc qdisc add dev imq1 root handle 1: htb
tc class add dev imq1 parent 1: classid 1:1 htb rate 14500kbit ceil 14500kbit prio 1
# Estacao 192.168.10.2
tc class add dev imq1 parent 1:1 classid 1:10 htb rate 7000kbit ceil 14500kbit prio 1
tc filter add dev imq1 parent 1: protocol ip prio 1 u32 match ip dst 192.168.10.2/32 flowid 1:10
# Estacao 192.168.10.3
tc class add dev imq1 parent 1:1 classid 1:11 htb rate 5000kbit ceil 14500kbit prio 1
tc filter add dev imq1 parent 1: protocol ip prio 1 u32 match ip dst 192.168.10.3/32 flowid 1:21
# Outras estacoes
tc class add dev imq1 parent 1:1 classid 1:19 htb rate 2500kbit ceil 14500kbit prio 1
I've used my own custom QoS scripts for ~2 years and never had any problem with the IMQ modules staying loaded. _________________ Read the forum announcements thoroughly! Be cautious if you're inexperienced.
Available for paid consulting. (Don't PM about complicated setups otherwise)
Looking for bricks and spare routers to expand my collection. (not interested in G spec models)
I've used my own custom QoS scripts for ~2 years and never had any problem with the IMQ modules staying loaded.
My router is a Ralink RT3052F (Aceex NR22/Y) and ther eis a lot of users reporting QoS for upload is not working, i my issue is if "QoS > Start QoS" option is not checked the imq module is auto unloading after Firewall Script.
One user solved his problem enabling dd-wrt QoS option, it prevents imq to unload, and other said that imq was unloading.
The u32 can be used to match any bit in the ip header. Before the ip header, there is a frame header. In that frame header you can find the src and dst mac address. You can trick the u32 filter in using the frame header if you use negative offsets.