Code: Select all
/system script add source={/interface monitor-traffic [/interface find type=pptp-in ] once do={:if ($received-bits-per-second > 10485760) do {/
queue simple add max-limit=262144/262144 interface=[/interface find }
Thanks
Karo
/system script add source={/interface monitor-traffic [/interface find type=pptp-in ] once do={:if ($received-bits-per-second > 10485760) do {/
queue simple add max-limit=262144/262144 interface=[/interface find }
I need to limit my PPTP users, but I want to do that using scripts. When a user's download rate is > 1M, I want to limit that speed by scripting. Look at my example. Here I need to give the interface name or IP address who has almost 1M tx-rate. How can I solve these problems?
Code: Select all/system script add source={/interface monitor-traffic [/interface find type=pptp-in ] once do={:if ($received-bits-per-second > 10485760) do {/ queue simple add max-limit=262144/262144 interface=[/interface find }
Thanks
Karo
:foreach i in=[/interface find] do={
/interface monitor-traffic $i once do={
:if ($"received-bits-per-second" > 512000 ) do={
:local tmpIP [/ip address get [/ip address find interface=$i] address] ;
:log warning $tmpIP ;
:for j from=( [:len $tmpIP] - 1) to=0 do={
:if ( [:pick $tmpIP $j] = "/") do={
/queue simple add name=$i max-limit=256000/256000 dst-address=[:pick $tmpIP 0 $j] ;
}
}
}
}
}