Let’s say that we have router with two Ethernet cards. One is internal and one external. And want to use it for bandwidth limiting and src-nat. If we use the example from the manual, shown below, and add src-nat rule to external card, every user will upload using same upload PCQ sub queue since source address is now masqueraded hence it is same source IP for all users and PCQ classifier is not working well.
Code: Select all
/ip firewall mangle add chain=forward src-address=192.168.0.0/24 \
action=mark-connection new-connection-mark=users-con
/ip firewall mangle add connection-mark=users-con action=mark-packet \
new-packet-mark=users chain=forward
/queue type add name=pcq-download kind=pcq pcq-classifier=dst-address
/queue type add name=pcq-upload kind=pcq pcq-classifier=src-address
/queue tree add name=Download parent=Local max-limit=10240000
/queue tree add parent=Download queue=pcq-download packet-mark=users
/queue tree add name=Upload parent=Public max-limit=2048000
/queue tree add parent=Upload queue=pcq-upload packet-mark=users
Note that download is working well because PCQ classifier is working.
I tried to use simple queues (PCQ type) and it is working well!!! But I would like to know how this can be done with queue tree. Can anyone help?
Thank you for your effort.