Fix bufferbloat on MikroTik routers
Yes. RouterOS 7 has a CAKE queue type, which is real Smart Queue.
Create a CAKE queue type, then a simple queue that limits your LAN to just under your line speed. CAKE needs RouterOS 7, so upgrade from RouterOS 6 first.
1. Test before you change anything
Run the Lag Check and note the "Lag under load" grade and your download and upload speeds. You'll compare against it afterwards.
2. Where the setting is
RouterOS 7 terminal
- Open a terminal in WinBox or WebFig (or log in over SSH).
- Add a CAKE queue type for each direction.
- Add a simple queue that targets your LAN subnet (192.168.88.0/24 by default) with max-limit set to your upload/download limits. For a LAN target, the first number is upload and the second is download.
- Turn off FastTrack, or the simple queue is skipped for most traffic.
Add CAKE queue types
/queue type add name=cake-up kind=cake cake-nat=yes /queue type add name=cake-down kind=cake cake-nat=yes
Shape the LAN (replace the speeds)
/queue simple add name=sqm target=192.168.88.0/24 max-limit=18M/90M queue=cake-up/cake-down
Turn off FastTrack
/ip firewall filter disable [find action=fasttrack-connection]
3. The numbers to enter
RouterOS takes values like 90M (Mbit/s), upload first then download for a LAN target. The example is for a 100/20 line at 90%; use your own figures from the Smart Queue assistant.
Work out my limitsThe assistant starts at 90% of your measured speed and tells you when to drop to 85% or 80%.
Gotchas
- FastTrack bypasses queues. With it on, the simple queue does nothing for most traffic.
- CAKE runs on the CPU. Small hEX and hAP models handle a few hundred Mbps; check the CPU load while a download runs.
- If you have several LAN subnets or VLANs, target each of them, or use a queue tree on the WAN instead.
Test after the change. A good setup brings lag under load down to A or B.
Test before and after