Situation:
#Multiple queues for different clients
#All queues need to have a cap on the bandwidth for the entire vlan, not per device
#A couple queues need to have access to any extra available bandwidth that is not currently being used
#Some specific devices on a single vlan may need to be targeted for minimum bandwidth as well. I assume creating an additional address list for them should work like the others.
Here is a simplified version of the config I am working on. I've only tested on a single device but the cap is working on the one device. In this example I would like for vlan 1 to be able to access any available bandwidth from the circuit and have a minimum of 5M. Vlan 1 needs to be limited dynamically as the other vlans utilize bandwidth All other vlans can hit their respective caps and fight over the scraps if the circuit is saturated as there aren't any other priority connections.
Interfaces
ether1 is LAN
ether2 is WAN
Code: Select all
/interface vlan
add name=int-vlan1 vlan-id=1 interface=ether1
add name=int-vlan2 vlan-id=2 interface=ether1
/ip firewall address-list
add address=10.10.10.0/24 list=list-vlan1
add address=10.10.20.0/24 list=list-vlan2
/queue tree
add max-limit=10M limit-at=5M name=tree-vlan1-down parent=int-vlan1
add max-limit=10M limit-at=5M name=tree-vlan1-up parent=ether2
add max-limit=10M name=tree-vlan2-down parent=int-vlan2
add max-limit=10M name=tree-vlan2-up parent=ether2
/queue type
add kind=pcq name=type-vlan1-down pcq-classifier=dst-address
add kind=pcq name=type-vlan1-up pcq-classifier=src-address
add kind=pcq name=type-vlan2-down pcq-classifier=dst-address
add kind=pcq name=type-vlan2-up pcq-classifier=src-address
/queue tree
add name=tree-limit-vlan1 packet-mark=packmark-vlan1 parent=tree-vlan1-down queue=type-vlan1-down
add name=tree-limit-vlan1 packet-mark=packmark-vlan1 parent=tree-vlan1-up queue=type-vlan1-up
add name=tree-limit-vlan2 packet-mark=packmark-vlan2 parent=tree-vlan2-down queue=type-vlan2-down
add name=tree-limit-vlan2 packet-mark=packmark-vlan2 parent=tree-vlan2-up queue=type-vlan2-up
/ip firewall mangle
add action=mark-connection chain=prerouting new-connection-mark=conmark-vlan1 passthrough=yes src-address-list=list-vlan1
add action=mark-packet chain=prerouting connection-mark=conmark-vlan1 new-packet-mark=packmark-vlan1 passthrough=no
add action=mark-connection chain=prerouting new-connection-mark=conmark-vlan2 passthrough=yes src-address-list=list-vlan2
add action=mark-packet chain=prerouting connection-mark=conmark-vlan2 new-packet-mark=packmark-vlan2 passthrough=no