Página 2 de 10 PrimeiroPrimeiro 1234567 ... ÚltimoÚltimo
+ Responder ao Tópico



  1. #21

    Padrão Re: PPoE - QoS Dinâmico e Individual

    Vou testar assim que possível.

  2. #22

    Padrão Re: PPoE - QoS Dinâmico e Individual

    Citação Postado originalmente por sostenes Ver Post
    então... ,verifica ai só é adicionado o burst na primeira regra, nas demais nao tem.
    Se notar, ele dá burst no geral.
    No mais, ele tbm dá burst para arquivos pequenos tbm, que em sua grande maioria, é navegação.

  3. #23

    Padrão Re: PPoE - QoS Dinâmico e Individual

    Citação Postado originalmente por AndrioPJ Ver Post
    Prezados,

    De uns tempo pra cá, vira e mexe recebemos ligações de clientes reclamando que não conseguem acessar nada ou que está extremamente lento, e quando vamos ver a conexão, o consumo de banda do cliente está em 100%.
    Em 90% dos casos é com destino a IP da Microsoft, o que nos leva a crer ser atualização.

    Sendo que desde o lançamento do Windows 10, a quantidade de ligações desse tipo aumentou.

    Diante de tal problema, resolvi ir atrás de alguma solução de QoS individual e automático.
    Consegui achar alguns exemplos de scripts na internet, fiz algumas modificações para poder gerar QoS automático para clientes com ou sem Burst.

    O que ele faz?
    A cada nova conexão, ele analisa os dados da Simple Queue desse cliente, e cria algumas regras no Queue Tree, com 5 tipos de priorização, conforme o tamanho do pacote (independente de site, protocolo ou serviço).

    A principio tem funcionado bem.

    Segue abaixo o script:

    Código :
    /ip firewall mangle
    add action=mark-connection chain=forward comment=QoS-Andriopj_Client_PPPoE new-connection-mark=QoS_conn_Down out-interface=all-ppp passthrough=yes
    add action=mark-packet chain=forward connection-bytes=0-524288 connection-mark=QoS_conn_Down new-packet-mark=QoS-Andriopj_512K passthrough=yes
    add action=mark-packet chain=forward connection-bytes=524289-5242880 connection-mark=QoS_conn_Down new-packet-mark=QoS-Andriopj_5M passthrough=yes
    add action=mark-packet chain=forward connection-bytes=5242881-20971520 connection-mark=QoS_conn_Down new-packet-mark=QoS-Andriopj_20M passthrough=yes
    add action=mark-packet chain=forward connection-bytes=20971521-52428800 connection-mark=QoS_conn_Down new-packet-mark=QoS-Andriopj_50M passthrough=yes
    add action=mark-packet chain=forward connection-bytes=52428801-0 connection-mark=QoS_conn_Down new-packet-mark=QoS-Andriopj_Infinity passthrough=yes

    Esse você adiciona em PPP > Profile
    Abra cada um dos Profiles > aba Scripts > On Up
    Código :
    :foreach i in=[/queue simple find where name="<pppoe-$user>"] do={
        :local qName [/queue simple get $i name];
        :local rLimit [/queue simple get $i max-limit];
        :local burstl [/queue simple get $i burst-limit];
        :local indexExplod [:find $burstl "/"];
        :local lenth [:len $burstl];
        :local bl [:pick $burstl ($indexExplod + 1) ($lenth - 1)];
        :local burstt [/queue simple get $i burst-time];
        :local burstth [/queue simple get $i burst-threshold];
        :local indexExplod [:find $burstt "/"];
        :local lenth [:len $burstt];
        :local bt [:pick $burstt ($indexExplod + 1) ($lenth - 1)];
        :local btUnity [:pick $burstt ($lenth - 1) $lenth];
        :local indexExplod [:find $burstth "/"];
        :local lenth [:len $burstth];
        :local bth [:pick $burstth ($indexExplod + 1) ($lenth - 1)];
        :local indexExplod [:find $rLimit "/"];
        :local lenth [:len $rLimit];
        :local rl [:pick $rLimit ($indexExplod + 1) ($lenth - 1)];
        :local rlUnity [:pick $rLimit ($lenth - 1) $lenth];
        :local c512k [($rl * 55 / 100)];
        :local c5M [($rl * 25 / 100)];
        :local c20M [($rl * 20 / 100)];
        :local c50M [($rl * 15 / 100)];
        :local cInf [($rl * 10 / 100)];
        :if ([:len $bl] != 0) do={
            /queue tree add name="QoS_$qName" parent="$interface" queue="default" max-limit="$($rl)$rlUnity" burst-limit="$($bl)$rlUnity" burst-time="$($bt)$btUnity" burst-threshold="$($bth)$rlUnity" bucket-size=0.20;
            /queue tree add name="2-512k_$qName" parent="QoS_$qName" packet-mark="QoS-Andriopj_512K" queue="default" priority="4" limit-at="$($c512k)$rlUnity" max-limit="$($rl)$rlUnity" burst-limit="$($bl)$rlUnity" burst-time="$($bt)$btUnity" burst-threshold="$($bth)$rlUnity";
            /queue tree add name="4-5M_$qName" parent="QoS_$qName" packet-mark="QoS-Andriopj_5M" queue="default" priority="5" limit-at="$($c5M)$rlUnity" max-limit="$($rl)$rlUnity";
            /queue tree add name="6-20M_$qName" parent="QoS_$qName" packet-mark="QoS-Andriopj_20M" queue="default" priority="6" limit-at="$($c20M)$rlUnity" max-limit="$($rl)$rlUnity";
            /queue tree add name="7-50M_$qName" parent="QoS_$qName" packet-mark="QoS-Andriopj_50M" queue="default" priority="7" limit-at="$($c50M)$rlUnity" max-limit="$($rl)$rlUnity";
            /queue tree add name="8-Inf_$qName" parent="QoS_$qName" packet-mark="QoS-Andriopj_Infinity" queue="default" priority="8" limit-at="$($cInf)$rlUnity" max-limit="$($rl)$rlUnity";
            :log warning "QUEUE add === $qName";
            } \
        else={
            /queue tree add name="QoS_$qName" parent="$interface" queue="default" max-limit="$($rl)$rlUnity" bucket-size=0.20;
            /queue tree add name="2-512k_$qName" parent="QoS_$qName" packet-mark="QoS-Andriopj_512K" queue="default" priority="2" limit-at="$($c512k)$rlUnity" max-limit="$($rl)$rlUnity";
            /queue tree add name="4-5M_$qName" parent="QoS_$qName" packet-mark="QoS-Andriopj_5M" queue="default" priority="4" limit-at="$($c5M)$rlUnity" max-limit="$($rl)$rlUnity";
            /queue tree add name="6-20M_$qName" parent="QoS_$qName" packet-mark="QoS-Andriopj_20M" queue="default" priority="6" limit-at="$($c20M)$rlUnity" max-limit="$($rl)$rlUnity";
            /queue tree add name="7-50M_$qName" parent="QoS_$qName" packet-mark="QoS-Andriopj_50M" queue="default" priority="7" limit-at="$($c50M)$rlUnity" max-limit="$($rl)$rlUnity";
            /queue tree add name="8-Inf_$qName" parent="QoS_$qName" packet-mark="QoS-Andriopj_Infinity" queue="default" priority="8" limit-at="$($cInf)$rlUnity" max-limit="$($rl)$rlUnity";
            :log warning "QUEUE add === $qName"; }
    }


    Esse você adiciona em PPP > Profile
    Abra cada um dos Profiles > aba Scripts > On Down
    Código :
    /queue tree remove [find where parent="QoS_<pppoe-$user>"]
    /queue tree remove [find where name="QoS_<pppoe-$user>"]
    :foreach a in=[/queue tree find where invalid] do={ /queue tree remove $a };


    Pronto, agora seu concentrador já deve estar criando o QoS automaticamente para cada cliente que se conectar/reconectar.
    Anexo 66869


    Fontes:
    https://wiki.mikrotik.com/wiki/Manual:Scripting
    https://wiki.mikrotik.com/wiki/Manua...pting-examples
    https://forum.mikrotik.com/viewtopic.php?t=61974
    https://forum.mikrotik.com/viewtopic.php?t=4887
    http://mk-auth.com.br/forum/topics/qos-din-mico-pppoe
    https://forum.mikrotik.com/viewtopic.php?t=11534
    Muito boa sua contribuição amigo, Parabéns.
    Mas aqui não funcionou, o script não adiciona as regras de queue tree!

  4. #24

    Padrão Re: PPoE - QoS Dinâmico e Individual

    e script funciona sim ,revise onde colocou as regras,qual a versão do seu mikrotik?

  5. #25

    Padrão Re: PPoE - QoS Dinâmico e Individual

    Deve funcionar sim mas aqui não rolou.
    Peguei outro que achei no fórum da MK-Auth onde adicionei direto em system>Scripts e funcionou
    Versão 6.33.3
    Coloquei exatamente no local onde o autor do tópico falou, ppp>profiles Script

  6. #26

    Padrão Re: PPoE - QoS Dinâmico e Individual

    Citação Postado originalmente por PabloDelfino Ver Post
    Deve funcionar sim mas aqui não rolou.
    Peguei outro que achei no fórum da MK-Auth onde adicionei direto em system>Scripts e funcionou
    Versão 6.33.3
    Coloquei exatamente no local onde o autor do tópico falou, ppp>profiles Script
    Mestre
    esse script que passei não é para ser adicionado em System Scripts.
    Mas sim na Aba script do PROFILE PPP.

  7. #27

    Padrão Re: PPoE - QoS Dinâmico e Individual

    Citação Postado originalmente por AndrioPJ Ver Post
    Mestre
    esse script que passei não é para ser adicionado em System Scripts.
    Mas sim na Aba script do PROFILE PPP.
    sim amigo eu compreendi, foi isso mesmo que fiz!
    oque me referi a cima foi outro que achei no fórum da MK-Auth onde e adicionado direto no Script do MK, que funcionou.
    o seu script direto no profile do ppp aqui não rolou, não sei pq.
    Abraço.

  8. #28

    Padrão Re: PPoE - QoS Dinâmico e Individual

    prezados,

    Localizei um erro no script com relação ao tempo (burst-time) quando maior que 59 segundos. Não chega a ser um erro no script, mas sim uma diferença na forma como o mikrotik armazena o tempo.
    Veja na imagem... note que no simple queue está com o Time em 80, mas qdo exportamos a regra ele passa o time em 1m20
    Clique na imagem para uma versão maior

Nome:	         mk2.png
Visualizações:	543
Tamanho: 	16,5 KB
ID:      	66888

    o que era para estar 60s, ele recebe como 1m
    ou que era para estar 80s, ele recebe como 1m20

    Ai dá erro na hora de adicionar a regra para clientes com tempo maior que 59s.

    Estou buscando uma forma de converter para segundos.
    Se alguém tiver uma sugestão, avisa ai.

  9. #29

    Padrão Re: PPoE - QoS Dinâmico e Individual

    aqui em meus testes nao houve esse problema, utilizo sempre 32s e adicionou so 32s o problema e que quando "cai" abaixo do burst threshold nem sempre libera um novo burst limit.

  10. #30

    Padrão

    Citação Postado originalmente por AndrioPJ Ver Post
    prezados,

    Localizei um erro no script com relação ao tempo (burst-time) quando maior que 59 segundos. Não chega a ser um erro no script, mas sim uma diferença na forma como o mikrotik armazena o tempo.
    Veja na imagem... note que no simple queue está com o Time em 80, mas qdo exportamos a regra ele passa o time em 1m20
    Clique na imagem para uma versão maior

Nome:	         mk2.png
Visualizações:	543
Tamanho: 	16,5 KB
ID:      	66888

    o que era para estar 60s, ele recebe como 1m
    ou que era para estar 80s, ele recebe como 1m20

    Ai dá erro na hora de adicionar a regra para clientes com tempo maior que 59s.

    Estou buscando uma forma de converter para segundos.
    Se alguém tiver uma sugestão, avisa ai.
    Prezados,

    Resolvido!!!
    Mais tarde devo atualizar o script.

    O que eu fiz?

    Quando o script vai buscar o valor do Burst-time, o valor vem assim "upload/download", exemplo:
    30s/30s

    ou

    1m20/1m20

    Então, primeiramente eu isolei o download:
    Código :
        :local burstt [/queue simple get $i burst-time];
        :local indexExplod [:find $burstt "/"];
        :local lenth [:len $burstt];
        :local bt [:pick $burstt ($indexExplod + 1) ($lenth - 1)];

    Pronto, com o código acima eu tenho apenas o valor do download.
    O problema é quando o tempo é maior que 59s, ai o mikrotik altera de segundos para minutos.
    ou seja, 80s vira 1m20

    Se tentarmos adicionar uma regra com o valor 1m20, dá erro, e a regra não é adicionada.
    Então temos que converter esse 1m20 para 80 segundos.

    Consegui fazer isso com o script abaixo:
    Código :
        :local indexExplod [:find $bt "m"];
        :local lenth [:len $bt];
        :local bt0 {:pick $bt 0 ];
        :local bt1 [:pick $bt ($indexExplod + 1) ($lenth - 1)];
        :local bt2 [:pick $bt ($indexExplod + 1) $lenth ];
        :local cBt [(($bt0 * 60) + $bt1)];

    Resumindo:
    Primeiro isolei o valor e depois transformei ele em segundos.
    Última edição por AndrioPJ; 16-05-2017 às 18:46.

  11. #31

    Padrão Re: PPoE - QoS Dinâmico e Individual

    Muito bom!
    Assim que corrigir o script posta ele, que eu quero testar de novo.

  12. #32

    Padrão Re: PPoE - QoS Dinâmico e Individual

    Script atualizado.

  13. #33

    Padrão Re: PPoE - QoS Dinâmico e Individual

    Realmente continua a não funcionar aqui!
    Na madrugada vou atualizar a RB desse pop para ver se resolve.

  14. #34

    Padrão

    Citação Postado originalmente por PabloDelfino Ver Post
    Realmente continua a não funcionar aqui!
    Na madrugada vou atualizar a RB desse pop para ver se resolve.
    só para tentar entender...
    Os planos dos seus clientes possuem Burst ou não?

    Vai no Profile, Aba Script > On UP
    E adiciona o seguinte script:
    Código :
    :foreach i in=[/queue simple find where name="<pppoe-$user>"] do={
        :local qName [/queue simple get $i name];
        :local rLimit [/queue simple get $i max-limit];
        :local indexExplod [:find $rLimit "/"];
        :local lenth [:len $rLimit];
        :local rl [:pick $rLimit ($indexExplod + 1) ($lenth - 1)];
        :local rlUnity [:pick $rLimit ($lenth - 1) $lenth];
        :local burstl [/queue simple get $i burst-limit];
        :local indexExplod [:find $burstl "/"];
        :local lenth [:len $burstl];
        :local bl [:pick $burstl ($indexExplod + 1) ($lenth - 1)];
        :local blUnity [:pick $burstl ($lenth - 1) $lenth];
        :local burstt [/queue simple get $i burst-time];
        :local indexExplod [:find $burstt "/"];
        :local lenth [:len $burstt];
        :local bt [:pick $burstt ($indexExplod + 1) ($lenth - 1)];
        :local indexExplod [:find $bt "m"];
        :local lenth [:len $bt];
        :local bt0 [:pick $bt 0];
        :local bt1 [:pick $bt ($indexExplod + 1) $lenth];
        :local burstth [/queue simple get $i burst-threshold];
        :local indexExplod [:find $burstth "/"];
        :local lenth [:len $burstth];
        :local bth [:pick $burstth ($indexExplod + 1) ($lenth - 1)];
        :local bthUnity [:pick $burstth ($lenth - 1) $lenth];
        :local c512k [($rl * 55 / 100)];
        :local c5M [($rl * 25 / 100)];
        :local c20M [($rl * 20 / 100)];
        :local c50M [($rl * 15 / 100)];
        :local cInf [($rl * 10 / 100)];
        :local cBt [(($bt0 * 60) + $bt1)];
            :log warning "=== Inicio Script ===";
        :if ([:len $bl] != 0) do={
            :log warning "QoS === $qName";
            :log warning "Com Burst";
            :log warning "Max Limit === $rl $rlUnity";
            :log warning "Burst Limit === $bl $blUnity";
            :log warning "Burst Thr === $bth $bthUnity";
            :log warning "Burst Time=== $cBt";
            :log warning "=== Fim Script ===";
            } \
        else={
            :log warning "QoS === $qName";
            :log warning "Sem Burst";
            :log warning "Max Limit === $rl $rlUnity";
            :log warning "=== Fim Script ===";
     }
    }

    Esse script não vai criar nenhuma queue, apenas irá relatar no log os valores que estão recebendo.

  15. #35

    Padrão Re: PPoE - QoS Dinâmico e Individual

    Meus clientes estão em sfq sera por isso?

    edit.
    Realmente fiz o teste com o Script a cima, esta sem burst!

  16. #36

    Padrão Re: PPoE - QoS Dinâmico e Individual

    Citação Postado originalmente por PabloDelfino Ver Post
    Meus clientes estão em sfq sera por isso?

    edit.
    Realmente fiz o teste com o Script a cima, esta sem burst!
    o SFQ não tem relação.
    Com esse ultimo script que passei, apareceu no LOG o nome da queue do cliente e a velocidade???

  17. #37

    Padrão Re: PPoE - QoS Dinâmico e Individual

    Citação Postado originalmente por AndrioPJ Ver Post
    o SFQ não tem relação.
    Com esse ultimo script que passei, apareceu no LOG o nome da queue do cliente e a velocidade???
    Ai esta o log
    Clique na imagem para uma versão maior

Nome:	         qos.JPG
Visualizações:	499
Tamanho: 	40,3 KB
ID:      	66892

  18. #38

    Padrão

    Citação Postado originalmente por PabloDelfino Ver Post
    Ai esta o log
    Clique na imagem para uma versão maior

Nome:	         qos.JPG
Visualizações:	499
Tamanho: 	40,3 KB
ID:      	66892
    Aparentemente, o script em si está coletando as informações necessárias.
    então ele deveria estar criando ai as regras no queue tree.

    Vamos dar mais um passo.
    Nesse ultimo script que te passei, exatamente esse que vc está usando, localize a parte em vermelha:
    Código :
    else={
    [COLOR="#FF0000"]        :log warning "QoS === $qName";
            :log warning "Sem Burst";
            :log warning "Max Limit === $rl $rlUnity";
            :log warning "=== Fim Script ===";[/COLOR]
     }
    }

    e adicione logo abaixo dessa linha em vermelha, o codigo abaixo:
    Código :
    /queue tree add name="QoS_$qName" parent="$interface" queue="default" max-limit="$($rl)$rlUnity" bucket-size=0.20;
            /queue tree add name="2-512k_$qName" parent="QoS_$qName" packet-mark="QoS-Andriopj_512K" queue="default" priority="2" limit-at="$($c512k)$rlUnity" max-limit="$($rl)$rlUnity";
            /queue tree add name="4-5M_$qName" parent="QoS_$qName" packet-mark="QoS-Andriopj_5M" queue="default" priority="4" limit-at="$($c5M)$rlUnity" max-limit="$($rl)$rlUnity";
            /queue tree add name="6-20M_$qName" parent="QoS_$qName" packet-mark="QoS-Andriopj_20M" queue="default" priority="6" limit-at="$($c20M)$rlUnity" max-limit="$($rl)$rlUnity";
            /queue tree add name="7-50M_$qName" parent="QoS_$qName" packet-mark="QoS-Andriopj_50M" queue="default" priority="7" limit-at="$($c50M)$rlUnity" max-limit="$($rl)$rlUnity";
            /queue tree add name="8-Inf_$qName" parent="QoS_$qName" packet-mark="QoS-Andriopj_Infinity" queue="default" priority="8" limit-at="$($cInf)$rlUnity" max-limit="$($rl)$rlUnity";

    Ficando da seguinte forma:

    Código :
       else={
            [COLOR="#FF0000"]:log warning "QoS === $qName";
            :log warning "Sem Burst";
            :log warning "Max Limit === $rl $rlUnity";
            :log warning "=== Fim Script ===";[/COLOR]
            /queue tree add name="QoS_$qName" parent="$interface" queue="default" max-limit="$($rl)$rlUnity" bucket-size=0.20;
            /queue tree add name="2-512k_$qName" parent="QoS_$qName" packet-mark="QoS-Andriopj_512K" queue="default" priority="2" limit-at="$($c512k)$rlUnity" max-limit="$($rl)$rlUnity";
            /queue tree add name="4-5M_$qName" parent="QoS_$qName" packet-mark="QoS-Andriopj_5M" queue="default" priority="4" limit-at="$($c5M)$rlUnity" max-limit="$($rl)$rlUnity";
            /queue tree add name="6-20M_$qName" parent="QoS_$qName" packet-mark="QoS-Andriopj_20M" queue="default" priority="6" limit-at="$($c20M)$rlUnity" max-limit="$($rl)$rlUnity";
            /queue tree add name="7-50M_$qName" parent="QoS_$qName" packet-mark="QoS-Andriopj_50M" queue="default" priority="7" limit-at="$($c50M)$rlUnity" max-limit="$($rl)$rlUnity";
            /queue tree add name="8-Inf_$qName" parent="QoS_$qName" packet-mark="QoS-Andriopj_Infinity" queue="default" priority="8" limit-at="$($cInf)$rlUnity" max-limit="$($rl)$rlUnity";
     }
    }

    Cuide para copiar toda a regra, inclusive o ;PontoVirgula; que está ao final

  19. #39

    Padrão Re: PPoE - QoS Dinâmico e Individual

    Citação Postado originalmente por AndrioPJ Ver Post
    Aparentemente, o script em si está coletando as informações necessárias.
    então ele deveria estar criando ai as regras no queue tree.

    Vamos dar mais um passo.
    Nesse ultimo script que te passei, exatamente esse que vc está usando, localize a parte em vermelha:
    Código :
    else={
    [COLOR="#FF0000"]        :log warning "QoS === $qName";
            :log warning "Sem Burst";
            :log warning "Max Limit === $rl $rlUnity";
            :log warning "=== Fim Script ===";[/COLOR]
     }
    }

    e adicione logo abaixo dessa linha em vermelha, o codigo abaixo:
    Código :
    /queue tree add name="QoS_$qName" parent="$interface" queue="default" max-limit="$($rl)$rlUnity" bucket-size=0.20;
            /queue tree add name="2-512k_$qName" parent="QoS_$qName" packet-mark="QoS-Andriopj_512K" queue="default" priority="2" limit-at="$($c512k)$rlUnity" max-limit="$($rl)$rlUnity";
            /queue tree add name="4-5M_$qName" parent="QoS_$qName" packet-mark="QoS-Andriopj_5M" queue="default" priority="4" limit-at="$($c5M)$rlUnity" max-limit="$($rl)$rlUnity";
            /queue tree add name="6-20M_$qName" parent="QoS_$qName" packet-mark="QoS-Andriopj_20M" queue="default" priority="6" limit-at="$($c20M)$rlUnity" max-limit="$($rl)$rlUnity";
            /queue tree add name="7-50M_$qName" parent="QoS_$qName" packet-mark="QoS-Andriopj_50M" queue="default" priority="7" limit-at="$($c50M)$rlUnity" max-limit="$($rl)$rlUnity";
            /queue tree add name="8-Inf_$qName" parent="QoS_$qName" packet-mark="QoS-Andriopj_Infinity" queue="default" priority="8" limit-at="$($cInf)$rlUnity" max-limit="$($rl)$rlUnity";

    Ficando da seguinte forma:

    Código :
       else={
            [COLOR="#FF0000"]:log warning "QoS === $qName";
            :log warning "Sem Burst";
            :log warning "Max Limit === $rl $rlUnity";
            :log warning "=== Fim Script ===";[/COLOR]
            /queue tree add name="QoS_$qName" parent="$interface" queue="default" max-limit="$($rl)$rlUnity" bucket-size=0.20;
            /queue tree add name="2-512k_$qName" parent="QoS_$qName" packet-mark="QoS-Andriopj_512K" queue="default" priority="2" limit-at="$($c512k)$rlUnity" max-limit="$($rl)$rlUnity";
            /queue tree add name="4-5M_$qName" parent="QoS_$qName" packet-mark="QoS-Andriopj_5M" queue="default" priority="4" limit-at="$($c5M)$rlUnity" max-limit="$($rl)$rlUnity";
            /queue tree add name="6-20M_$qName" parent="QoS_$qName" packet-mark="QoS-Andriopj_20M" queue="default" priority="6" limit-at="$($c20M)$rlUnity" max-limit="$($rl)$rlUnity";
            /queue tree add name="7-50M_$qName" parent="QoS_$qName" packet-mark="QoS-Andriopj_50M" queue="default" priority="7" limit-at="$($c50M)$rlUnity" max-limit="$($rl)$rlUnity";
            /queue tree add name="8-Inf_$qName" parent="QoS_$qName" packet-mark="QoS-Andriopj_Infinity" queue="default" priority="8" limit-at="$($cInf)$rlUnity" max-limit="$($rl)$rlUnity";
     }
    }

    Cuide para copiar toda a regra, inclusive o ;PontoVirgula; que está ao final

    O Codigo pronto ficou assim:

    Código :
    :foreach i in=[/queue simple find where name="<pppoe-$user>"] do={
        :local qName [/queue simple get $i name];
        :local rLimit [/queue simple get $i max-limit];
        :local indexExplod [:find $rLimit "/"];
        :local lenth [:len $rLimit];
        :local rl [:pick $rLimit ($indexExplod + 1) ($lenth - 1)];
        :local rlUnity [:pick $rLimit ($lenth - 1) $lenth];
        :local burstl [/queue simple get $i burst-limit];
        :local indexExplod [:find $burstl "/"];
        :local lenth [:len $burstl];
        :local bl [:pick $burstl ($indexExplod + 1) ($lenth - 1)];
        :local blUnity [:pick $burstl ($lenth - 1) $lenth];
        :local burstt [/queue simple get $i burst-time];
        :local indexExplod [:find $burstt "/"];
        :local lenth [:len $burstt];
        :local bt [:pick $burstt ($indexExplod + 1) ($lenth - 1)];
        :local indexExplod [:find $bt "m"];
        :local lenth [:len $bt];
        :local bt0 [:pick $bt 0];
        :local bt1 [:pick $bt ($indexExplod + 1) $lenth];
        :local burstth [/queue simple get $i burst-threshold];
        :local indexExplod [:find $burstth "/"];
        :local lenth [:len $burstth];
        :local bth [:pick $burstth ($indexExplod + 1) ($lenth - 1)];
        :local bthUnity [:pick $burstth ($lenth - 1) $lenth];
        :local c512k [($rl * 55 / 100)];
        :local c5M [($rl * 25 / 100)];
        :local c20M [($rl * 20 / 100)];
        :local c50M [($rl * 15 / 100)];
        :local cInf [($rl * 10 / 100)];
        :local cBt [(($bt0 * 60) + $bt1)];
            :log warning "=== Inicio Script ===";
        :if ([:len $bl] != 0) do={
            :log warning "QoS === $qName";
            :log warning "Com Burst";
            :log warning "Max Limit === $rl $rlUnity";
            :log warning "Burst Limit === $bl $blUnity";
            :log warning "Burst Thr === $bth $bthUnity";
            :log warning "Burst Time=== $cBt";
            :log warning "=== Fim Script ===";
            } \
       else={
            :log warning "QoS === $qName";
            :log warning "Sem Burst";
            :log warning "Max Limit === $rl $rlUnity";
            :log warning "=== Fim Script ===";
            /queue tree add name="QoS_$qName" parent="$interface" queue="default" max-limit="$($rl)$rlUnity" bucket-size=0.20;
            /queue tree add name="2-512k_$qName" parent="QoS_$qName" packet-mark="QoS-Andriopj_512K" queue="default" priority="2" limit-at="$($c512k)$rlUnity" max-limit="$($rl)$rlUnity";
            /queue tree add name="4-5M_$qName" parent="QoS_$qName" packet-mark="QoS-Andriopj_5M" queue="default" priority="4" limit-at="$($c5M)$rlUnity" max-limit="$($rl)$rlUnity";
            /queue tree add name="6-20M_$qName" parent="QoS_$qName" packet-mark="QoS-Andriopj_20M" queue="default" priority="6" limit-at="$($c20M)$rlUnity" max-limit="$($rl)$rlUnity";
            /queue tree add name="7-50M_$qName" parent="QoS_$qName" packet-mark="QoS-Andriopj_50M" queue="default" priority="7" limit-at="$($c50M)$rlUnity" max-limit="$($rl)$rlUnity";
            /queue tree add name="8-Inf_$qName" parent="QoS_$qName" packet-mark="QoS-Andriopj_Infinity" queue="default" priority="8" limit-at="$($cInf)$rlUnity" max-limit="$($rl)$rlUnity";
     }
    }


    Nada aconteceu!
    Apenas autenticou e não emitiu nenhum Log. e nao adicionou nenhuma Queue Tree

  20. #40

    Padrão Re: PPoE - QoS Dinâmico e Individual

    Como faço para que funcione nos dois sentidos upload e download pois o mesmo está tratando somente pacotes​ de download. e AndrioPJ mais uma vez muito obrigado pela contribuição.