100200300400500600
  
 
 

QoS

Quality of service may be not as critical part of home network as connectivity and security, however could really help of you're using some realtime services like VoIP

The same approach is used here for QoS setup, script below simply applies predifened set of tc rules:

files/etc/init.d/qos
#!/bin/sh /etc/rc.common
# Copyright (C) 2008-2010 OpenWrt.org
# Copyright (C) 2011 ruslan.n.marchenko

START=95

CONF=/etc/config/qos
TC=/usr/sbin/tc
start() {
        test -f $CONF && $TC -batch $CONF
}

stop() {
        if [ -f $CONF ]; then
            for i in `grep ' dev ' $CONF|\
                        sed 's/.* dev \([^ ]\+\).*/\1/'|\
                        sort -u`;
            do
                $TC qdisc del dev $i root
            done
        fi
}

restart() {
        stop
        start
}

reload() {
        restart
}

Now change attributes and create rc link to enable the script in startup sequence:

$ chmod +x files/etc/init.d/qos
$ cd files/etc/rc.d
$ ln -s ../init.d/qos S95qos

and fill config file with whatever rules you think are feasible for you, f.i.

$ echo "qd ad dev br-lan root prio" > files/etc/config/qos
$ echo "qd ad dev br-wan root prio" >> files/etc/config/qos

Note that this is batch file for tc - it lacks tc command itself, othervise normal tc statement. Benefit - quick load, drawback - if some of the batch command fails - the rest of the file is not loaded. Think twice about command order so that failed command won't screw up the rest of your QoS setup.

Sun Feb 21 18:51:22 2010 Upd.: Sat Feb 9 14:51:35 2013
 
 
© ruff 2011