What's new

RT-N66U with merlin - can i limit bandwidth for a range of IPs on my lan?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

mark555055

New Around Here
i have an RT-N66U on the way and in the meantime i'm trying to decide if i'm going to try out merlin or stick with tomato.

i have a metered connection, so what i do now is use tomato bandwidth limiter to throttle my entire lan down to share a fraction of the available bandwidth.

Is this possible with merlin or can i only throttle by individual clients by IP?

Thanks
 
Your best bet would be to use John's fork. QOS seems to work the best with that on a N66.

Sent from my P01M using Tapatalk
 
i have an RT-N66U on the way and in the meantime i'm trying to decide if i'm going to try out merlin or stick with tomato.

i have a metered connection, so what i do now is use tomato bandwidth limiter to throttle my entire lan down to share a fraction of the available bandwidth.

Is this possible with merlin or can i only throttle by individual clients by IP?

Thanks

I while back I experimented with bringing the QOS settings from Tomato over to Merlin. I had limited success.

For what it's worth, these scripts might help you figure it out. The problem with all of them is the handles. You have to setup the IPs in the GUI to allocate the handles, then customize the scripts accordingly. I couldn't find a way to manage the handles from the shell. Also, the tc command is obnoxiously cryptic.

This will show you the current settings on either FW:
Code:
#!/bin/sh

echo; echo ### tc qdisc show
tc qdisc show

echo; echo ### tc qdisc show dev br0
tc qdisc show dev br0
echo; echo ### tc filter show dev br0
tc filter show dev br0
echo; echo ### tc class show dev br0
tc class show dev br0

echo; echo ### tc qdisc show dev vlan2
tc qdisc show dev vlan2
echo; echo ### tc filter show dev vlan2
tc filter show dev vlan2
echo; echo ### tc class show dev vlan2
tc class show dev vlan2

This enables BL on Tomato:
Code:
#!/bin/sh

PATH='./:/jffs:/jffs/scripts:/opt/usr/sbin:/opt/sbin:/opt/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin'
cd /jffs

TQAD="tc qdisc add dev br0"
TCAD="tc class add dev br0"
TFAD="tc filter add dev br0"

TQAU="tc qdisc add dev vlan2"
TCAU="tc class add dev vlan2"
TFAU="tc filter add dev vlan2"

SFQ="sfq perturb 10"

tc qdisc del dev br0 root 2>/dev/null
tc qdisc del dev vlan2 root 2>/dev/null
   
$TQAD root handle 1: htb
$TCAD parent 1: classid 1:1 htb rate 90000kbit
$TQAU root handle 2: htb
$TCAU parent 2: classid 2:1 htb rate 9000kbit

# 10.0.1.76: DL Ceil = 3MBps, UL Ceil = .5MBps
$TCAD parent 1:1 classid 1:10 htb rate 100kbit ceil 24000kbit prio 2
$TQAD parent 1:10 handle 10: $SFQ
$TFAD parent 1:0 prio 2 u32 match ip dst 10.0.1.76 flowid 1:10

$TCAU parent 2:1 classid 2:10 htb rate 100kbit ceil 4000kbit prio 2
$TQAU parent 2:10 handle 10: $SFQ
$TFAU parent 2:0 prio 2 u32 match ip dst 10.0.1.76 flowid 2:10

This script will enable or disable BL on Merlin. Note that it works by IP and/or MAC:
Code:
#!/bin/sh
WAN=eth0

case "$1" in
start)
    tc qdisc del dev $WAN root 2>/dev/null
    tc qdisc del dev $WAN ingress 2>/dev/null
    tc qdisc del dev br0 root 2>/dev/null
    tc qdisc del dev br0 ingress 2>/dev/null

    TQAU="tc qdisc add dev $WAN"
    TCAU="tc class add dev $WAN"
    TFAU="tc filter add dev $WAN"
    SFQ="sfq perturb 10"
    TQA="tc qdisc add dev br0"
    TCA="tc class add dev br0"
    TFA="tc filter add dev br0"

    $TQA root handle 1: htb
    $TCA parent 1: classid 1:1 htb rate 10240000kbit

    $TQAU root handle 2: htb
    $TCAU parent 2: classid 2:1 htb rate 10240000kbit

    $TCA parent 1:1 classid 1:9 htb rate 10240000kbit ceil 10240000kbit prio 1
    $TQA parent 1:9 handle 9: $SFQ
    $TFA parent 1: prio 1 protocol ip handle 9 fw flowid 1:9

    $TCAU parent 2:1 classid 2:9 htb rate 10240000kbit ceil 10240000kbit prio 1
    $TQAU parent 2:9 handle 9: $SFQ
    $TFAU parent 2: prio 1 protocol ip handle 9 fw flowid 2:9

    $TCA parent 1:1 classid 1:10 htb rate 10240kbit ceil 10240kbit prio 0
    $TQA parent 1:10 handle 10: $SFQ
    $TFA parent 1: protocol ip prio 0 u32 match u16 0x0800 0xFFFF at -2 match u32 0x6BAF71AF 0xFFFFFFFF at -12 match u16 0xA03E 0xFFFF at -14 flowid 1:10
    $TCAU parent 2:1 classid 2:10 htb rate 1024kbit ceil 1024kbit prio 0
    $TQAU parent 2:10 handle 10: $SFQ
    $TFAU parent 2: prio 0 protocol ip handle 10 fw flowid 2:10

    $TCA parent 1:1 classid 1:11 htb rate 10240kbit ceil 10240kbit prio 1
    $TQA parent 1:11 handle 11: $SFQ
    $TFA parent 1: prio 1 protocol ip handle 11 fw flowid 1:11

    $TCAU parent 2:1 classid 2:11 htb rate 1024kbit ceil 1024kbit prio 1
    $TQAU parent 2:11 handle 11: $SFQ
    $TFAU parent 2: prio 1 protocol ip handle 11 fw flowid 2:11
;;
stop)
    tc qdisc del dev $WAN root 2>/dev/null
    tc qdisc del dev $WAN ingress 2>/dev/null
    tc qdisc del dev br0 root 2>/dev/null
    tc qdisc del dev br0 ingress 2>/dev/null
;;
*)
    tc -s -d class ls dev $WAN
    tc -s -d class ls dev br0
esac
 

Similar threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top