Sat Aug 09, 2014 2:38 pm
Thank you kozmonov for replying, i have applied what is written in the link regarding marking packets for download, but when it comes to simple queues, this method dosent work on ver 6.x.
i will explain what i did exactly on version 6.17, knowing that i have edited some codes because they dont apply on this version:
Step1 (layer 7 defining file extension):
/ip firewall layer7-protocol
add comment=”” name=”Extension \” .exe \”” regexp=”^.*get.+\\.exe.*\$”
Step2 (Mangle rules):
/ip firewall mangle
add action=mark-connection chain=prerouting comment=”exe DOWNS” disabled=no layer7-protocol=”Extension \” .exe \”” new-connection-mark=”exe DOWNS” passthrough=yes protocol=tcp
add action=mark-packet chain=postrouting comment=”” connection-mark=”exe DOWNS” disabled=no new-packet-mark=exe passthrough=no protocol=tcp
Step3 "Adding simple queue for marked packets, but this will shape all traffic for all users, thats why i made it unlimited and created a child queue for specific IP":
/queue simple
add burst-limit=0/0 burst-threshold=0/0 burst-time=0s/0s comment=”” disabled=no limit-at=unlimited max-limit=unlimited name=”download max” packet-marks=exe parent=none priority=8 total-queue=default-small
Step4 (This is a script to generate all queues in one click, these queues should limit the download of the file extension .exe):
{
for i from=0 to=254 do={
queue simple add burst-limit=0/0 burst-threshold=0/0 burst-time=0s/0s comment=”” disabled=no limit-at=128k/128k max-limit=128k/128k name="172.16.22 network $i" parent=”download max” priority=”8” target=”172.16.22.$i” total-queue=”default-small”
}}
what is happening, is that all traffic is shaped and not only exe