код:
/queue simple
add disabled=yes max-limit=90M/90M name=Main queue=pcq-upload-default/pcq-download-default
add limit-at=64k/64k max-limit=85M/85M name=torrent packet-marks=torrent parent=Main queue=pcq-upload-default/pcq-download-default target=192.168.66.0/24
add limit-at=85M/85M max-limit=90M/90M name=no_torrent packet-marks=no-mark parent=Main priority=1/1 queue=pcq-upload-default/pcq-download-default target=192.168.66.0/24
/queue tree
add limit-at=90M max-limit=90M name=Wan_to_Lan parent=global queue=pcq-download-default
add limit-at=90M max-limit=90M name=wl packet-mark=wl parent=Wan_to_Lan priority=1 queue=pcq-download-default
add limit-at=99M max-limit=99M name=Lan_to_Wan parent=global queue=pcq-upload-default
add max-limit=99M name=lw_torrent packet-mark=lw_torrent parent=Lan_to_Wan queue=pcq-upload-default
add limit-at=99M max-limit=99M name=lw packet-mark=lw parent=Lan_to_Wan priority=1 queue=pcq-upload-default
add max-limit=90M name=wl_torrent packet-mark=wl_torrent parent=Wan_to_Lan queue=pcq-download-default
/ip firewall mangle
add action=mark-connection chain=postrouting dst-address=!192.168.66.0/24 dst-port=1025-65535 new-connection-mark=torrent passthrough=yes protocol=tcp src-address=192.168.66.0/24 src-port=40001
add action=mark-connection chain=postrouting dst-address=!192.168.66.0/24 dst-port=1025-65535 new-connection-mark=torrent passthrough=yes protocol=udp src-address=192.168.66.0/24 src-port=40001
add action=mark-connection chain=postrouting dst-address=192.168.66.0/24 dst-port=40001 new-connection-mark=torrent passthrough=yes protocol=tcp src-address=!192.168.66.0/24
add action=mark-connection chain=postrouting dst-address=192.168.66.0/24 dst-port=40001 new-connection-mark=torrent passthrough=yes protocol=udp src-address=!192.168.66.0/24
add action=mark-packet chain=postrouting connection-mark=torrent dst-address=!192.168.66.0/24 new-packet-mark=lw_torrent passthrough=no src-address=192.168.66.0/24
add action=mark-packet chain=postrouting connection-mark=torrent dst-address=192.168.66.0/24 new-packet-mark=wl_torrent passthrough=no src-address=!192.168.66.0/24
add action=mark-connection chain=postrouting dst-address=!192.168.66.0/24 new-connection-mark=no_torrent passthrough=yes src-address=192.168.66.0/24
add action=mark-connection chain=postrouting dst-address=192.168.66.0/24 new-connection-mark=no_torrent passthrough=yes src-address=!192.168.66.0/24
add action=mark-packet chain=postrouting connection-mark=no_torrent dst-address=!192.168.66.0/24 new-packet-mark=lw passthrough=no src-address=192.168.66.0/24
add action=mark-packet chain=postrouting connection-mark=no_torrent dst-address=192.168.66.0/24 new-packet-mark=wl passthrough=no src-address=!192.168.66.0/24
add action=mark-connection chain=postrouting dst-address=192.168.66.0/24 new-connection-mark=ll passthrough=yes src-address=192.168.66.0/24
add action=mark-packet chain=postrouting connection-mark=ll new-packet-mark=ll passthrough=no
add action=accept chain=postrouting