🌐
📗 Bagian 1 (Fundamental & Dasar) • Modul 07
100% Standar Industri & Vokasi
Queue Tree & PCQ (Per Connection Queue)
Manajemen bandwidth skala besar: Mangle packet marking, arsitektur Queue Tree, dan pembagian bandwidth otomatis merata dengan PCQ.
1. Mengapa Menggunakan Queue Tree & PCQ?
Ketika jumlah klien mencapai ratusan orang, menggunakan Simple Queue satu per satu akan membebani CPU router dan tidak efisien. Queue Tree yang dikombinasikan dengan PCQ (Per Connection Queue) mampu membagi total bandwidth secara otomatis dan adil kepada seluruh user yang aktif secara dinamis tanpa perlu mendaftarkan IP klien satu demi satu.
2. Skrip Lengkap Mangle & Queue Tree PCQ
# 1. Tandai Koneksi & Paket Download / Upload di Firewall Mangle
/ip firewall mangle add chain=forward src-address=192.168.10.0/24 action=mark-connection new-connection-mark=cm-upload passthrough=yes comment="Mark Conn Upload"
/ip firewall mangle add chain=forward connection-mark=cm-upload action=mark-packet new-packet-mark=pm-upload passthrough=no comment="Mark Packet Upload"
/ip firewall mangle add chain=forward dst-address=192.168.10.0/24 action=mark-connection new-connection-mark=cm-download passthrough=yes comment="Mark Conn Download"
/ip firewall mangle add chain=forward connection-mark=cm-download action=mark-packet new-packet-mark=pm-download passthrough=no comment="Mark Packet Download"
# 2. Buat Queue Type PCQ (Upload berdasarkan Src-Address, Download berdasarkan Dst-Address)
/queue type add name="PCQ-Upload-Auto" kind=pcq pcq-classifier=src-address pcq-rate=0 pcq-limit=50KiB pcq-total-limit=2000KiB
/queue type add name="PCQ-Download-Auto" kind=pcq pcq-classifier=dst-address pcq-rate=0 pcq-limit=50KiB pcq-total-limit=2000KiB
# 3. Terapkan pada Queue Tree (Total Bandwidth ISP: 50 Mbps Down / 20 Mbps Up)
/queue tree add name="TOTAL-DOWNLOAD" parent=global max-limit=50M
/queue tree add name="KLIEN-DOWNLOAD" parent="TOTAL-DOWNLOAD" packet-mark=pm-download queue=PCQ-Download-Auto
/queue tree add name="TOTAL-UPLOAD" parent=global max-limit=20M
/queue tree add name="KLIEN-UPLOAD" parent="TOTAL-UPLOAD" packet-mark=pm-upload queue=PCQ-Upload-Auto