# User bandwidth limit in ddwrt routers



## icebags (Nov 29, 2014)

found this while searching net. going to try it out, but probably those who understand networking scripts, can explain things better (and also on potential risks in generated scripts).

expert comments please.

How to Set Bandwidth limit to Each Users by WRT Script Generator ? – KcZon.com

 [MENTION=126812]whitestar_999[/MENTION] & company.


----------



## whitestar_999 (Nov 30, 2014)

I don't use WRT but it looks like a straight forward method.However in my experience such tools don't always work correctly because of various hardware/software combination inside routers.I generated a sample script & seems like it adds rules to iptables to redirect packets with specified speed limits to specified IPs thus effectively working as bandwidth limit option.


----------



## Vyom (Nov 30, 2014)

It works or not, this seems to be a good option to limit bandwidth to certain users of family members. And the prospect of "scripting" did get me excited initially. I was searching to write "scripts" in ddwrt for a long time. So a "tool" to do that raised my eyebrows. Sadly the tool only generates scripts "to limit bandwidth". And the script it generates doesn't have familiar "if-else" statements. So I am still stumbled. I still have to way to help me scripting how to keep internet alive possibly by pinging a site every minute or something.

Still thanks for the info icebags.


----------



## icebags (Nov 30, 2014)

well, i tried last night, the straight forward copying the scripts to router startup did not actually worked for me. then i searched net again and came up with this thread DD-WRT Forum :: View topic - wrt54g Script Generator and dd-wrt help this code seems to work only when i save it as "firewall script". also, there seems to be a minute of waiting time after saving the script and before the changes taking effect.

most disadvantageous is, the tool script can generate code for ip ranges, whereas the forum script is direct hardcoded ips. i tried replacing the direct hard codes with ip range codes from the tool script, but they did not work. i have limited shell & iptables knowledge, so any expert help again would be good. 



whitestar_999 said:


> I don't use WRT but it looks like a straight forward method.However in my experience such tools don't always work correctly because of various hardware/software combination inside routers.I generated a sample script & seems like it adds rules to iptables to redirect packets with specified speed limits to specified IPs thus effectively working as bandwidth limit option.



that seems the issue i am facing as well. 



Vyom said:


> It works or not, this seems to be a good option to limit bandwidth to certain users of family members. And the prospect of "scripting" did get me excited initially. I was searching to write "scripts" in ddwrt for a long time. So a "tool" to do that raised my eyebrows. Sadly the tool only generates scripts "to limit bandwidth". And the script it generates doesn't have familiar "if-else" statements. So I am still stumbled. I still have to way to help me scripting how to keep internet alive possibly by pinging a site every minute or something.
> 
> Still thanks for the info icebags.



study some shell scripting with iptables ?


----------

