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:
Guest SSID:
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