Yes, that is what it looks like. However, in this case it is not what I need. The reply by pukkita made me think it would be like I need.
I’m having trouble decoding what it is you want to do.
It sounds like you want to do a rate-limit queue which applies to some customer regardless of which WAN interface the traffic arrived on, but not rate-limit traffic which arrives from other LAN interfaces, and you only want this to apply to “download” traffic. Uploads should be caught by individual WAN-interface queues…
No, it is actually quite simple: normally, you can shape the traffic in each direction by configuring 2 queue trees, one on the WAN interface (for the upload) and one on the LAN interface (for the download).
I don’t really want to rate-limit any user, however I want to shape the traffic so that traffic priorities can be respected (DSCP) and the WAN link never gets fully saturated (to avoid long delays due to uncontrollable buffer bloat).
This works fine in your normal router with 1 WAN and 1 LAN. However, this router has 2 WANs and 3 LANs. (all inside the same company, but we separate office, guest and “building control” networks). So I mainly want to shape the traffic towards the LANs so that it does not overwhelm the WAN links. Also I want to send higher priority traffic first.
For this, I use the simple marking by priority shown before:
/ip firewall mangle
add action=set-priority chain=postrouting comment="From dscp high 3 bits" \
new-priority=from-dscp-high-3-bits passthrough=yes
add action=mark-packet chain=postrouting comment="Priority 0" \
new-packet-mark=prio0 passthrough=no priority=0
add action=mark-packet chain=postrouting comment="Priority 1" \
new-packet-mark=prio1 passthrough=no priority=1
add action=mark-packet chain=postrouting comment="Priority 2" \
new-packet-mark=prio2 passthrough=no priority=2
add action=mark-packet chain=postrouting comment="Priority 3" \
new-packet-mark=prio3 passthrough=no priority=3
add action=mark-packet chain=postrouting comment="Priority 4" \
new-packet-mark=prio4 passthrough=no priority=4
add action=mark-packet chain=postrouting comment="Priority 5" \
new-packet-mark=prio5 passthrough=no priority=5
add action=mark-packet chain=postrouting comment="Priority 6" \
new-packet-mark=prio6 passthrough=no priority=6
add action=mark-packet chain=postrouting comment="Priority 7" \
new-packet-mark=prio7 passthrough=no priority=7
(and similar for IPv6 but it requires 64 rules there due to missing “from dscp high 3 bits”)
Then I have those 2 queue trees, a queue for each interface with 8 children matching the prio0..prio7 marks and sorting the priorities.
But now it becomes more complicated:
+------------+
| |
LAN1 ---| |
| |--- WAN1 ---> internet
| |
LAN2 ---| CCR1009 |
| |
| |--- WAN2 ---> internet
LAN3 ---| |
| |
+------------+
For the upload it is still the right thing to have a separate queue tree on each WAN because you want to shape the WANs separately.
For the download, ideally there should be a single queue tree that shapes the 3 LANs together. I.e. not really on the interfaces, but on the “general flow of data towards the LAN”.
I hoped that having a global tree and 2 specific trees for the upload would do that, but unfortunately the global tree also includes the traffic towards the WAN interfaces.
Unfortunately a packet can have only a single mark, and a queue tree can match only on “or” between packet marks.
The setup would be quite easy to do when I could add a packet mark for “towards LAN” and still have the prio0..prio7 marks derived from DSCP,
and also a mark “from_WAN1” and “from_WAN2” to have separate shaping for each of them.
But this is not possible because RouterOS implements only a single mark per packet and a single match per queue item. Something else has to be found…