Перейти из форума на сайт.

НовостиФайловые архивы
ПоискАктивные темыТоп лист
ПравилаКто в on-line?
Вход Забыли пароль? Первый раз на этом сайте? Регистрация
Компьютерный форум Ru.Board » Компьютеры » Программы » µTorrent / uTorrent (часть 4)

Модерирует : gyra, Maz

Maz (10-12-2016 14:23): http://forum.ru-board.com/topic.cgi?forum=5&topic=48986  Версия для печати • ПодписатьсяДобавить в закладки
На первую страницук этому сообщениюк последнему сообщению

   

xxMDxx

Newbie
Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору

#!/bin/sh /etc/rc.common
# fshaper
# Fair shaper (download) for OpenWRT 10.03.1
# absent
# This is free software licensed under the terms of the GNU GPL v2.0
 
START=50
 
NAME=fshaper
DEV="br-lan"
ISP="/etc/ip.isp"
LOW="/etc/ip.low"
HIGH="/etc/ip.high"
PATH="/bin:/sbin:/usr/bin:/usr/sbin"
 
stop(){
    tc qdisc del dev $DEV root >/dev/null 2>&1
}
 
start(){
    stop
    local m="cls_u32 sch_esfq sch_sfq sch_htb sch_prio"
    for i in $m; do insmod $i >/dev/null 2>&1; done
 
    local tcq="tc qdisc add dev $DEV"
    local tcc="tc class add dev $DEV"
    local tcf="tc filter add dev $DEV"
    local q="quantum 10240"
    local b="burst 10240"
    local p="hash dst perturb 5 limit 1024 depth 1024 divisor 10"
    local rate
    config_load $NAME
    config_get rate settings rate 1024
    [ "$1" ] && rate="$1"
 
    $tcq root handle 1: htb default 13
    $tcc parent 1: classid 1:1 htb rate 1000mbit ceil 1000mbit $q burst 102400
 
    $tcc parent 1:1 classid 1:1000 htb rate 1mbit ceil 1000mbit $q burst 102400 prio 2
    $tcq parent 1:1000 handle 1000: esfq $p
 
    $tcc parent 1:1 classid 1:2 htb rate ${rate}kbit ceil ${rate}kbit $q $b prio 1
    for i in 0 3 7; do
        $tcc parent 1:2 classid 1:1$i htb rate $((rate/10+1))kbit ceil ${rate}kbit $q $b prio $i
        $tcq parent 1:1$i handle 1$i: esfq $p
    done
 
    # isp local ip list, full interface speed
    [ -r "$ISP" ] && while read i; do
        if echo $i | egrep -q "^\s*#|^\s*$"; then continue; fi
        $tcf protocol ip prio 7 u32 match ip src $i flowid 1:1000
    done < "$ISP"
 
    # low priority ip list
    [ -r "$LOW" ] && while read i; do
        if echo $i | egrep -q "^\s*#|^\s*$"; then continue; fi
        $tcf protocol ip prio 7 u32 match ip dst $i flowid 1:17
    done < "$LOW"
 
    # high priority ip list
    [ -r "$HIGH" ] && while read i; do
        if echo $i | egrep -q "^\s*#|^\s*$"; then continue; fi
        $tcf protocol ip prio 7 u32 match ip dst $i flowid 1:10
    done < "$HIGH"
}  

Всего записей: 6 | Зарегистр. 17-02-2007 | Отправлено: 21:33 13-01-2015
   

На первую страницук этому сообщениюк последнему сообщению

Компьютерный форум Ru.Board » Компьютеры » Программы » µTorrent / uTorrent (часть 4)
Maz (10-12-2016 14:23): http://forum.ru-board.com/topic.cgi?forum=5&topic=48986


Реклама на форуме Ru.Board.

Powered by Ikonboard "v2.1.7b" © 2000 Ikonboard.com
Modified by Ru.B0ard
© Ru.B0ard 2000-2024

BitCoin: 1NGG1chHtUvrtEqjeerQCKDMUi6S6CG4iC

Рейтинг.ru