Cable Forum

Cable Forum (https://www.cableforum.uk/board/index.php)
-   Networking (https://www.cableforum.uk/board/forumdisplay.php?f=87)
-   -   Limit bandwidth for secondary (guest) SSID? (https://www.cableforum.uk/board/showthread.php?t=33684796)

garmcqui 19-01-2012 19:48

Limit bandwidth for secondary (guest) SSID?
 
hi all,

I have set up a secondary SSID on my D-Link DIR-615 (DD-WRT build 14896) so that guests can log on easily when they're round.

That side of it's working fine, both SSID's are working. However, I want to limit the bandwidth on the guest SSID (br1) to 2mbps down/1mbps up (cable bandwidth is 20mbps/5mbps).

I've used the following code (found online) in the firewall command box:

Quote:

iptables -I FORWARD -i br1 -d `nvram get lan_ipaddr`/`nvram get lan_netmask` -m state --state NEW -j DROP
iptables -t nat -I POSTROUTING -o br0 -j SNAT --to `nvram get lan_ipaddr`
iptables -I INPUT -i br1 -m state --state NEW -j DROP
iptables -I INPUT -i br1 -p udp --dport 67 -j ACCEPT
iptables -I INPUT -i br1 -p udp --dport 53 -j ACCEPT
iptables -I INPUT -i br1 -p tcp --dport 53 -j ACCEPT
TCA="tc class add dev br1"
TFA="tc filter add dev br1"
TQA="tc qdisc add dev br1"
SFQ="sfq perturb 10"
tc qdisc del dev br1 root
tc qdisc add dev br1 root handle 1: htb
tc class add dev br1 parent 1: classid 1:1 htb rate 2048kbit
$TQA parent 1:1 handle 10: $SFQ
$TFA parent 1:0 prio 2 protocol ip handle 10 fw flowid 1:1
iptables -t mangle -A POSTROUTING -d 192.168.2.0/24 -j MARK --set-mark 10
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 1024kbit
$TQAU parent 1:1 handle 10: $SFQ
$TFAU parent 1:0 prio 2 protocol ip handle 10 fw flowid 1:1
iptables -t mangle -A PREROUTING -s 192.168.2.0/24 -j MARK --set-mark 10
iptables -t mangle -A PREROUTING -j IMQ --todev 0
And I'm achieving these results on Speedtest.net:

Private SSID:

https://www.cableforum.co.uk/images/...2012/01/40.png

Guest SSID:

https://www.cableforum.co.uk/images/...2012/01/41.png

Ok, now as you can see it is limiting the incoming bandwidth as requested, but not the outgoing, as the guest network is still achieving full upload speeds:

Any ideas what's wrong?

Thanks

qasdfdsaq 20-01-2012 19:27

Re: Limit bandwidth for secondary (guest) SSID?
 
What's imq0 and why do you have it?

garmcqui 20-01-2012 19:39

Re: Limit bandwidth for secondary (guest) SSID?
 
no idea. Like I said, I just got this code off the net. But it seemed to work for the download, just not the upload...

qasdfdsaq 20-01-2012 22:35

Re: Limit bandwidth for secondary (guest) SSID?
 
Well then. I'd suggest just using the buttons on the QoS page if you don't know what you're doing with the script :)

Ironically the QoS on dd-wrt has a reputation of being flakey and not behaving like you expect it to, yet configuring it via the web interface is one of the only ways of actually getting it to behave consistently.

garmcqui 21-01-2012 08:47

Re: Limit bandwidth for secondary (guest) SSID?
 
ok, am giving QOS another try, will let you know how I get on...

Thanks...


All times are GMT +1. The time now is 08:33.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
All Posts and Content are © Cable Forum