fila simples Mikrotik, limitando o intervalo de IPs

4

Estou usando um Mikrtotik RB201UiAS para gerenciar minha rede. Para evitar a criação de filas simples para cada IP, criei filas para intervalos de IPs.

  • Meta: 172.16.2.0/25
  • Dst: ether1
  • Upload de destino: 5 milhões
  • Download de segmentação: 5 milhões

A questão é: usar esta configuração

  • cada IP (de 1 a 127) terá um limite de 5M Tx / Rx

ou

  • todos os IPs (de 1 a 127) terão um limite de 5M Tx / Rx

Configuração atual:

# oct/21/2015 15:25:55 by RouterOS 6.23
# software id = U3SW-9LU3
#
/queue simple
    add dst=ether1 max-limit=5M/10M name=Klasat target=172.16.2.0/25
    add dst=ether1 max-limit=5M/10M name=Administrata target=172.16.2.128/26
    add dst=ether1 max-limit=1M/1M name=DVR target=172.16.2.192/27
    add dst=ether1 name=Sallat target=172.16.2.224/28 add dst=ether1 name=Unlimited target=172.16.2.240/28
    
por Denis Omeri 21.10.2015 / 15:01

2 respostas

4

A menos que você esteja usando o tipo de fila PCQ , os limites serão aplicados a todos os IPs definidos intervalo.

Com o PCQ (Per Connection Queue) , você pode aplicar os limites desejados em cada IP com base na critérios que você define no PCQ (endereço dst / src, porta dst / src ou qualquer combinação desses).

Da documentação oficial do MikroTik :

PCQ was introduced to optimize massive QoS systems, where most of the queues are exactly the same for different sub-streams. For example a sub-stream can be download or upload for one particular client (IP) or connection to server.

PCQ algorithm is very simple - at first it uses selected classifiers to distinguish one sub-stream from another, then applies individual FIFO queue size and limitation on every sub-stream, then groups all sub-streams together and applies global queue size and limitation.

PCQ parameters:

pcq-classifier (dst-address | dst-port | src-address | src-port; default: "")  : selection of sub-stream identifiers
pcq-rate (number) : maximal available data rate of each sub-steam
pcq-limit (number) : queue size of single sub-stream (in KB)
pcq-total-limit (number) : maximum amount of queued data in all sub-streams (in KB)

So instead of having 100 queues with 1000kbps limitation for download we can have one PCQ queue with 100 sub-streams

Existe também um exemplo disponível em MikroTik Wiki

Trecho da Wiki:

There are two ways how to make this: using mangle and queue trees, or, using simple queues.

  1. Mark all packets with packet-marks upload/download: (lets constider that ether1-LAN is public interface to the Internet and ether2-LAN is local interface where clients are connected

    /ip firewall mangle add chain=prerouting action=mark-packet in-interface=ether1-LAN new-packet-mark=client_upload
    /ip firewall mangle add chain=prerouting action=mark-packet in-interface=ether2-WAN new-packet-mark=client_download
    
  2. Setup two PCQ queue types - one for download and one for upload. dst-address is classifier for user's download traffic, src-address for upload traffic:

    /queue type add name="PCQ_download" kind=pcq pcq-rate=64000 pcq-classifier=dst-address  
    /queue type add name="PCQ_upload" kind=pcq pcq-rate=32000 pcq-classifier=src-address
    
  3. Finally, two queue rules are required, one for download and one for upload:

    /queue tree add parent=global-in queue=PCQ_download packet-mark=client_download
    /queue tree add parent=global-out queue=PCQ_upload packet-mark=client_upload
    

If you don't like using mangle and queue trees, you can skip step 1, do step 2, and step 3 would be to create one simple queue as shown here:

/queue simple add target-addresses=192.168.0.0/24 queue=PCQ_upload/PCQ_download
    
por 21.10.2015 / 16:29
0

Graças à resposta do Cha0s , consegui criar a limitação justa sem criar centenas de filas simples.

A note for other viewers trying to do the same thing.

Cuidado ao adicionar os tipos de fila para configurar o limite de download / upload em taxa de tipo de fila e remover (tornar ilimitado) o upload de destino & Download de destino de Fila simples

Meu exemplo:

 /queue type
      add kind=pcq name=pcq-download-Klasat pcq-classifier=dst-address pcq-rate=2M
      add kind=pcq name=pcq-upload-Klasat pcq-classifier=src-address pcq-rate=2M

 /queue simple
      add dst=ether1 name=Klasat queue=pcq-upload-Klasat/pcq-download-Klasat 
      target=172.16.2.0/25 total-queue=pcq-download-Klasa
    
por 22.10.2015 / 16:05