Posted: Wed Feb 07, 2007 18:08 Post subject: Limit bandwidth per MAC-address or IP-address?
Hi! I have a WRT54GL with dd-wrt v23 SP2 mini. Is it possible to limit bandwidth per MAC-address or IP-address? I tried QoS, but I didn't get it to work. One of the users on the network uses all the upload. Does anyone know how to deal with this problem?
Posted: Thu Feb 08, 2007 0:03 Post subject: Re: Limit bandwidth per MAC-address or IP-address?
limerep wrote:
Hi! I have a WRT54GL with dd-wrt v23 SP2 mini. Is it possible to limit bandwidth per MAC-address or IP-address? I tried QoS, but I didn't get it to work. One of the users on the network uses all the upload. Does anyone know how to deal with this problem?
You can also purchase dd-wrt's special editions which include a per mac/user bandwidth limitation. This might be beneficial to you and is worth the time and effort.
Joined: 16 Oct 2006 Posts: 112 Location: Blagoevgrad, Bulgaria
Posted: Thu Feb 08, 2007 1:21 Post subject:
You may try the script generator in my signature. _________________ The morning after the night before.
Little application that generates scripts for traffic shaping
WRT54SG
Linksys WRT54GL v1.1: Tomato 1.11
Buffalo WHR-HP-G54: DD-WRT v23 SP2
I've tried this script, but it seems it doesnt work that good on a fonera in client mode.
if i run it without the script, i get approx 1,5MB/s to my PC, when using the generator at 4000kbit down and 800kb up I receive sometimes 250kB/s and sometimes 70kB/s down. even though where i download from its without the script reaces 1,5MB as I said.
so the shaping seems not to work, cause 4000kbit should be 500kB/s?
Aint there an easy way to limit the overall allowed maximum of bw-usage on the router? Without beeing mac/ip/protocol dependent. Just a maxumum limit on the wan-interface overall.
I´ve tried seting up tc rules in firewall (as pasted below), but the speed becomes verry jumpy as joksi describes.
Code:
TCA="tc class add dev br0"
TFA="tc filter add dev br0"
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 256kbit
$TCA parent 1:1 classid 1:10 htb rate 256kbit ceil 256kbit prio 2
$TFA parent 1:0 prio 2 protocol ip handle 10 fw flowid 1:10
iptables -t mangle -A POSTROUTING -d 192.168.182.2 -j MARK --set-mark 10
iptables -t mangle -A POSTROUTING -d 192.168.182.3 -j MARK --set-mark 10
iptables -t mangle -A POSTROUTING -d 192.168.182.4 -j MARK --set-mark 10
iptables -t mangle -A POSTROUTING -d 192.168.182.5 -j MARK --set-mark 10
iptables -t mangle -A POSTROUTING -d 192.168.182.6 -j MARK --set-mark 10
iptables -t mangle -A POSTROUTING -d 192.168.182.7 -j MARK --set-mark 10
iptables -t mangle -A POSTROUTING -d 192.168.182.8 -j MARK --set-mark 10
iptables -t mangle -A POSTROUTING -d 192.168.182.9 -j MARK --set-mark 10
iptables -t mangle -A POSTROUTING -d 192.168.182.10 -j MARK --set-mark 10
tc qdisc add dev br0 ingress
$TFA parent ffff: protocol ip handle 50 fw police rate 256kbit mtu 12k burst 10k drop
iptables -t mangle -A PREROUTING -s 192.168.182.2 -j MARK --set-mark 50
iptables -t mangle -A PREROUTING -s 192.168.182.3 -j MARK --set-mark 50
iptables -t mangle -A PREROUTING -s 192.168.182.4 -j MARK --set-mark 50
iptables -t mangle -A PREROUTING -s 192.168.182.5 -j MARK --set-mark 50
iptables -t mangle -A PREROUTING -s 192.168.182.6 -j MARK --set-mark 50
iptables -t mangle -A PREROUTING -s 192.168.182.7 -j MARK --set-mark 50
iptables -t mangle -A PREROUTING -s 192.168.182.8 -j MARK --set-mark 50
iptables -t mangle -A PREROUTING -s 192.168.182.9 -j MARK --set-mark 50
iptables -t mangle -A PREROUTING -s 192.168.182.10 -j MARK --set-mark 50
How does one apply the script when in client bridge mode? I'm using it (albeit on a Tomato) with a device in client bridge that could be hosting pc's and a couple of phones. I'd like to set a guaranteed amount of throughput to the phones but applying the script on the AP or the Client Bridge doesn't seem to improve anything.