Hi all. Novice here. I'm having the same issue. I would really appreciate if someone could lead me in the right direction. The script I'm using is allowing me to limit download, but not upload speeds.
For reference, I'm running DD-WRT v24-sp2 (08/07/10) mini (SVN revision 14896) on an Asus RT-N16 router.
In the DD-WRT control panel > Administration > Commands > Command Shell: I save the following code as "Firewall"
Code:
#--------------------------------------------
#WRT54 Script Generator v1.02
#(C) 2006-2007 Robert "Robson" Mytkowski
#--------------------------------------------
# Limit Download to rateMb/s guaranteed, ceilMb/s max
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 35000kbit
$TCA parent 1:1 classid 1:10 htb rate 448kbit ceil 448kbit prio 2
$TQA parent 1:10 handle 10: $SFQ
$TFA parent 1:0 prio 4 protocol ip handle 10 fw flowid 1:10
iptables -t mangle -A POSTROUTING -d 192.168.1.143 -j MARK --set-mark 10
# Limit Upload to rateMb/s guaranteed, ceilMb/s max
TCAU="tc class add dev imq0"
TFAU="tc filter add dev imq0"
TQAU="tc qdisc add dev imq0"
insmod ipt_IMQ
insmod imq
insmod ipt_mac
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 10000kbit
$TCAU parent 1:1 classid 1:10 htb rate 224kbit ceil 224kbit prio 2
$TQAU parent 1:10 handle 10: $SFQ
$TFAU parent 1:0 prio 4 protocol ip handle 10 fw flowid 1:10
iptables -t mangle -A PREROUTING -s 192.168.1.143 -j MARK --set-mark 10
iptables -t mangle -A PREROUTING -j IMQ --todev 0
Then go to Management, apply settings, save, reboot router. (QoS is disabled)
When I test the connection, download is limited, but upload is still the full amount. Same problem many people are having.
I've updated "modprobe" to "insmod" in the code like people recommend in this thread:
http://www.dd-wrt.com/phpBB2/viewtopic.php?t=76364
I've also tried enabling and disabling the QoS like some have suggested.
I've tried tweaking different parameters. I've tried using a MAC address rather than an IP. I've tried saving the script as startup rather than firewall as it apparently worked for someone else. I've tried several enable/disable/rebooting methods with QoS. Nothing seems to work. Can anyone help? Much thanks.
Last edited by thermal on Sat Aug 23, 2014 2:00; edited 1 time in total
@thermal
Is there any particular reason for using 4 years old build?
Unless, there is something I don't know about, that is the latest version available for my router. Right? Or am I reading that wrong?
Snapshot of my router on the DD-WRT.com router database page:
@Mile-Lile Thank you for showing me that there are newer versions of the firmware. Silly me for assuming the database would be up to date. I've been since reading through a bunch of threads to familiarize myself with how to update the firmware, including the Peacock thread and Asus RT-N16 threads.
According to User madman999, "In order to get a 3.x kernel build onto the Asus RT-N16, you need to go from a 2.6 kernel build to 3.x 21530 then to the latest." 3.x also seems to have some other issues with users, so I think I'll hold off on this version for now.
Joined: 24 Feb 2013 Posts: 1634 Location: Belgrade
Posted: Tue Aug 19, 2014 10:46 Post subject:
I cant help you because I never had broadcom router. I just know that QoS and limiting works great on atheros...
Ask on ddwrt/broadcom chipset... I think you can easily upgrade to k2.6 mini... just see firmware size cause your rtn16 has 4MB flash...
I've upgraded the firmware of my Asus RT-N16 to the latest DD-WRT v24-sp2 (06/07/14) kingkong - build 22000M. And I'm still having the same issue as before with the old firmware.
The download bandwidth limit works, but upload bandwidth limit does not. I'm using the same firewall script code that's in the second post in this thread. Anyone have any ideas what I can try next?
@Mile-Lile
Thanks for the info. New features that were not in the previous build. However, it's still not working.
I'm trying to limit the bandwidth of my xbox one to 224kbits up and 448kbits down. I've got it on a wired connection to my router. I've set it to a static IP. I've set the xbox MAC address in QoS like so...
*pic deleted*
Could you please double check my settings? Any advice would be helpful. I'm not sure if I should be using LAN and/or WAN. I don't know if I should be checking any of the TCP options. I don't know why the MAC priority lists both WAN up/down but only LAN max; what's the difference?
My internet provider says that my download/upload speeds should be 100/10 MBps. However, the download varies from 30-120 MBps when I test it on my xbox one. Upload is pretty consistent at 10-11 MBps.
I've power cycled my xbox, router and modem after any changes.
BTW, is pressing the "reboot router" button in the DD-WRT gui the same as unplugging the power cord out and back in?
Last edited by thermal on Sat Aug 23, 2014 1:52; edited 1 time in total
Joined: 24 Feb 2013 Posts: 1634 Location: Belgrade
Posted: Fri Aug 22, 2014 5:43 Post subject:
If internet is hosted on you router(i.e pppoe) you should use WAN shaping, or if you use your router as WDS Station or Client Bridge (Routed) you should use LAN&WLAN shaping. In that case traffic is going just trough router switch not CPU so ddwrt must use ebtables to shape traffic on L2 level (MAC level)...
I found my error. I accidentally switched priority of the MAC address from manual to exempt. Everything else was correct.
Upload and download bandwidth limiting works now!