Optimizing MikroTik BDIX Bandwidth & Queue Management
A practical case study on configuring simple queues, tree queues, and mangle rules to prioritize local ISP BDIX traffic.
On this page
Efficient bandwidth allocation requires proper packet marking and policy-based routing. In this technical walkthrough, we explore router configurations designed to maintain uninterrupted low-latency performance across multi-user environments.
The problem
In a Bangladeshi ISP network, BDIX (Bangladesh Internet Exchange) traffic — local content such as caching servers, local video and local services — shares the same links as international traffic. Without shaping, a few heavy international downloads can starve local traffic, and local content that should be fast feels slow. The goal is simple: local BDIX traffic gets priority and plenty of bandwidth, while international traffic is fairly shared and never chokes the link.
How it works, in three steps
First, mangle rules mark BDIX connections and packets so the queues can recognise them. Next, a queue tree gives marked BDIX packets a high-priority, high-bandwidth lane. Finally, simple queues cap each customer so one user cannot take the whole link.
Step 1 — Mark BDIX traffic with mangle
BDIX destinations are collected in an address list. The mangle rules below mark connections to those destinations, then mark their packets. Replace 203.0.113.0/24 with your real BDIX address list — always keep an up-to-date BDIX list on the router.
/ip firewall address-list
add list=BDIX address=203.0.113.0/24 comment="BDIX destinations (example)"
/ip firewall mangle
add chain=prerouting dst-address-list=BDIX action=mark-connection \
new-connection-mark=bdix-con passthrough=yes comment="Mark BDIX connections"
add chain=prerouting connection-mark=bdix-con action=mark-packet \
new-packet-mark=bdix-pkt passthrough=no comment="Mark BDIX packets"
Check the counters after a few minutes: if the packet count on the second rule is growing, marking works. If it stays at zero, the address list is wrong — fix the list before touching queues.
Step 2 — Prioritize BDIX with a queue tree
A queue tree on the WAN interface gives BDIX packets priority 1 and a guaranteed share of the link, while everything else shares what is left.
/queue tree
add name=bdix-queue parent=ether1-WAN packet-mark=bdix-pkt \
limit-at=20M max-limit=80M priority=1 comment="BDIX priority lane"
add name=other-queue parent=ether1-WAN packet-mark=no-mark \
limit-at=5M max-limit=80M priority=8 comment="Everything else"
limit-at is the guaranteed bandwidth; max-limit is the ceiling when the link is free. BDIX gets priority 1 (highest), other traffic gets priority 8 (lowest), so local content wins when the link is busy and nothing is wasted when it is idle.
Step 3 — Cap each customer with simple queues
Queue trees shape traffic classes, not users. Simple queues stop one customer from taking everything:
/queue simple
add name=customer-01 target=192.168.10.10/32 max-limit=20M/20M \
comment="Per-customer cap"
Repeat one simple queue per customer (or per subnet), and put the BDIX packet mark on the customer queue too if you want BDIX traffic inside the cap to stay unthrottled.
Check that it works
- Open Queues in WinBox and watch the BDIX queue: its rate should rise when local content is used, and its dropped-packet counter should stay near zero.
- Run a speed test to a BDIX host and to an international host at the same time — BDIX should stay fast while the international test is capped.
- Check Tools → Torch on the WAN interface filtered by the
bdix-pktpacket mark to confirm marking is live.
What to avoid
- Never shape on the LAN interface by mistake — queues belong on the WAN-facing interface (or
globalif you know what you are doing). - Never use an outdated BDIX address list; a stale list silently stops marking.
- Always export a backup before changing queues:
/export file=queue-backupand download it, so a bad change can be rolled back in seconds.
Result
With marking, a priority queue tree and per-customer caps, local BDIX content stays fast even at peak hours, international traffic is shared fairly, and no single user can congest the link. The same pattern scales from a small ISP setup to a larger multi-user network — only the limits change.
Read more
- Power BI the Practical Way: From Raw Data to a Dashboard People Actually Use
How to build a Power BI report that stays correct when the data changes — clean the data in Power Query, write the DAX once, and let refresh do the rest.
- SQL Query Optimization: Five Fixes That Make Slow Queries Fast
A practical guide to finding slow queries with EXPLAIN ANALYZE, adding the right indexes, and rewriting queries so PostgreSQL does less work.