Mikrotik Per Connection Queue (PCQ)

easy traffic shaping

Requirements

we’re assuming CLI and using the device as DNS forwarder already

ping router.lan
ssh router.lan -l admin

Simple queue

in case there’s very specific IPs you want to traffic shape to 10 Mbps

    /queue simple
    add name=test-somehost target=THAT-IP/32 queue=pcq-upload-default/pcq-download-default max-limit=10M/10M

PCQ setup

now this is a use-case scenario for a hotel, where any IP would get traffic shaped.

every user device gets a 10Mbit/s internet connection behind a 100Mbit/s line

/ip firewall mangle
add chain=prerouting action=mark-packet in-interface=ether1 new-packet-mark=client_download
add chain=prerouting action=mark-packet in-interface=bridge new-packet-mark=client_upload
#in-interface=!ether1

/queue type
add name="PCQ_download" kind=pcq pcq-rate=10M pcq-classifier=dst-address
add name="PCQ_upload" kind=pcq pcq-rate=10M pcq-classifier=src-address

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

Network Performance graphs

enable graphing

    /tool graphing interface
    add allow-address=192.168.100.0/24

    /tool graphing queue
    add allow-address=192.168.100.0/24

    /tool graphing resource
    add allow-address=192.168.100.0/24

those can then be reached at https://192.168.100.1/graphs/ without authentication from the internal network

Acceptance

network performance graphs

    /tool graphing interface
    add allow-address=192.168.1.0/24

    /tool graphing queue
    add allow-address=192.168.1.0/24

    /tool graphing resource
    add allow-address=192.168.1.0/24

Resources

Manual:Queues - PCQ https://wiki.mikrotik.com/wiki/Manual:Queues_-_PCQ

Manual:Queues - PCQ Examples https://wiki.mikrotik.com/wiki/Manual:Queues_-_PCQ_Examples

MikroTik RouterOS Workshop - QoS Best Practice https://mum.mikrotik.com/presentations/CZ09/QoS_Megis.pdf

traffic shaping

https://en.wikipedia.org/wiki/Traffic_shaping

https://wiki.mikrotik.com/wiki/Bandwidth_Managment_and_Queues

https://wiki.mikrotik.com/wiki/Manual:Queues_-_PCQ

https://wiki.mikrotik.com/wiki/Manual:Queues_-_PCQ_Examples

https://forum.mikrotik.com/viewtopic.php?t=146037

https://forum.mikrotik.com/viewtopic.php?t=99493

graphs

https://wiki.mikrotik.com/wiki/Manual:Tools/Graphing

https://help.mikrotik.com/docs/display/ROS/Graphing

alternatives

DSCP based QoS with HTB https://wiki.mikrotik.com/wiki/DSCP_based_QoS_with_HTB


HOME | GUIDES | LECTURES | LAB | SMTP HEALTH | NU | HTML5
Copyright © 2022 Pierre-Philipp Braun