mikrotik как разделить равномерно канал между клие...

Создано: 16 августа 2025 г.

Отвечено с использованием GPT-5 Thinking от Chat01

Вопрос

mikrotik как разделить равномерно канал между клиентами

Мысль

Explaining MikroTik bandwidth distribution

I see the question is about splitting bandwidth evenly between clients with MikroTik RouterOS. The user likely needs guidance with Queue Tree or Simple Queues using PCQ (Per-Connection Queue). I'll walk through configuration steps, covering both Winbox and CLI. I'll also mention the differences between RouterOS v6 and v7, and provide practical examples of setting up bandwidth and fairness per user. PCQ can be used for rate limiting and fairness.

Simplifying MikroTik PCQ setup

To evenly split bandwidth with PCQ, you can set the rate to the total bandwidth, and each client gets a minimum share equal to the total divided by the number of active hosts. PCQ creates per-IP or per-connection sub-queues. A simple setup uses Simple Queue with target subnet and PCQ types. I'll explain both Queue Tree and Simple Queue methods. In RouterOS v6, there are default PCQ types like 'pcq-upload-default' and 'pcq-download-default' for upload and download.

Setting up PCQ for fair bandwidth distribution

To evenly distribute bandwidth among clients, set up PCQ in MikroTik like this:

  1. For queues: define pcq-down and pcq-up with a classifier (dst-address for download, src-address for upload).
  2. Use a simple queue with a subnet target (e.g., 192.168.88.0/24).
  3. Set max-limit to your total WAN capacity, and ensure no fixed per-client cap for fairness.

For more control, adjust the 'pcq-rate' to limit each client’s share.

Configuring upload direction with PCQ

When setting up upload, the parent queue should reference the WAN (ISP). In RouterOS v6, FastTrack bypasses the queue, so it’s important to disable FastTrack or mark connections to exclude them. In a PCQ inside Queue Tree, you don’t need an IP classifier if you're using address-based classification. For simplicity, use Simple Queues unless VLAN setups are needed, and I'll provide commands for both v6 and v7, though v7 is more straightforward.

Thought for 52s

Ответ

Коротко: самый простой и «правильный» способ — PCQ (Per-Connection/Per-Client Queue). Он автоматически делит общий канал поровну между активными клиентами (по IP), без ручных лимитов на каждого.

Вариант 1. Simple Queue + PCQ (рекомендую)

Предположим, ваш LAN — 192.168.88.0/24, WAN — скорость 100 Мбит/с симметрично. В RouterOS v6/v7:

rsc
# 1) Создаём типы очередей PCQ (можно использовать и встроенные pcq-*-default) /queue type add name=pcq-down-fair kind=pcq pcq-classifier=dst-address pcq-rate=0 pcq-limit=50 pcq-total-limit=2000 add name=pcq-up-fair kind=pcq pcq-classifier=src-address pcq-rate=0 pcq-limit=50 pcq-total-limit=2000 # 2) Одна простая очередь на всю подсеть LAN /queue simple add name="LAN fair" target=192.168.88.0/24 max-limit=100M/100M queue=pcq-down-fair/pcq-up-fair

Что это даёт:

  • pcq-rate=0 — «честное» деление канала между активными IP. Если 5 клиентов качают — получат примерно по 20 Мбит/с каждый из ваших 100 Мбит/с.
  • Хотите «потолок» на клиента? Поставьте, например, pcq-rate=20M, и тогда один IP никогда не превысит 20 Мбит/с, но при простое других всё равно возьмёт до 20 Мбит/с.

Вариант 2. Queue Tree + PCQ (когда много VLAN/тонкая настройка)

Идея: вешаем PCQ-очередь на egress нужных интерфейсов (скачивание — на LAN-bridge, загрузка — на WAN).

rsc
# Отключаем FastTrack, иначе очереди не сработают /ip firewall filter disable [find where action=fasttrack-connection] /queue type add name=pcq-down-fair kind=pcq pcq-classifier=dst-address pcq-rate=0 add name=pcq-up-fair kind=pcq pcq-classifier=src-address pcq-rate=0 # Замените bridge-LAN и ether1-WAN на ваши имена интерфейсов /queue tree add name=DOWN parent=bridge-LAN queue=pcq-down-fair max-limit=100M add name=UP parent=ether1-WAN queue=pcq-up-fair max-limit=100M

Важные нюансы

  • FastTrack: по умолчанию включает обход очередей. Либо отключите, либо добавьте исключения так, чтобы трафик, который вы хотите шейпить, FastTrack не затрагивал.
  • Куда ставить очередь:
    — Simple Queue достаточно указать target = ваша LAN-подсеть.
    — Queue Tree работает на исходящем трафике интерфейса: download — parent = LAN (к клиентам), upload — parent = WAN (к провайдеру).
  • Проверка: смотрите Queues → Traffic/Rate или /queue simple/print stats — должно быть видно равномерное распределение при одновременной загрузке нескольких клиентов.
  • Тонкая настройка: если видите «задыхание» при пингах — чуть увеличьте pcq-limit и pcq-total-limit.

Если подскажете вашу точную скорость, имена интерфейсов и подсети — набросаю готовый конфиг именно под вашу схему.

Поделиться этим Q&A