Login Script:
# Set Default Rate Limit k/s #Set User
:global DDR "20000"
:global DUR "16000"
:local UName $user
# Remove Default Queue
/queue simple remove [/queue simple find name~"$UName"]
# Count Login Device
:local DeviceCount [/ip hotspot active print count-only where user=$UName]
:if ($DeviceCount =0) do={
# Set Queue Per Device
:local DQPerDevice ($DDR / $DeviceCount)
:local UQPerDevice ($DUR / $DeviceCount)
# Add Queue to New Login Device
/queue simple add name=$address target=$address max-limit=($UQPerDevice."k/".$DQPerDevice."k") comment=$UName place-before=0;
# Reset Queue to Logined Device
:foreach QReset in=[/queue simple find comment =$UName] do={/queue simple set $QReset max-limit=($UQPerDevice."k/".$DQPerDevice."k")}
}\
else={
# Set Queue Per Device
:local DQPerDevice ($DDR / $DeviceCount)
:local UQPerDevice ($DUR / $DeviceCount)
# Add Queue to New Login Device
/queue simple add name=$address target=$address max-limit=($UQPerDevice."k/".$DQPerDevice."k") comment=$UName place-before=0;
# Reset Queue to Logined Device
:foreach QReset in=[/queue simple find comment =$UName] do={/queue simple set $QReset max-limit=($UQPerDevice."k/".$DQPerDevice."k")}
}
#PhallaCCMT.blogspot.com
Logout Script:
:local UName $user;
# Remove Queue From Logout Device
/queue simple remove [/queue simple find name =$address]
# Count Device Login
:local DeviceCount [/ip hotspot active print count-only where user=$UName]
#---if all Device Logout
:if ($DeviceCount =0) do={
:log info "All are Devices Logout ??"
}\
else={
# Set Queue Per Device
:local DQPerDevice ($DDR / $DeviceCount)
:local UQPerDevice ($DUR / $DeviceCount)
# Reset Queue to Logined Device
:foreach QReset in=[/queue simple find comment =$UName] do={/queue simple set $QReset max-limit=($UQPerDevice."k/".$DQPerDevice."k")}
}
#PhallaCCMT.blogspot.com
# Remove Queue From Logout Device
/queue simple remove [/queue simple find name =$address]
# Count Device Login
:local DeviceCount [/ip hotspot active print count-only where user=$UName]
#---if all Device Logout
:if ($DeviceCount =0) do={
:log info "All are Devices Logout ??"
}\
else={
# Set Queue Per Device
:local DQPerDevice ($DDR / $DeviceCount)
:local UQPerDevice ($DUR / $DeviceCount)
# Reset Queue to Logined Device
:foreach QReset in=[/queue simple find comment =$UName] do={/queue simple set $QReset max-limit=($UQPerDevice."k/".$DQPerDevice."k")}
}
#PhallaCCMT.blogspot.com
3 comments
Write commentssaludos, no me funciona estoy usando autenticacion por mac y mi rb esta con la ultima version 6.43.8, cual podria ser el problema
ReplyHow to improve maximum user device limit source?
Replyhow to add the expiration of the user? E.g It will only be valid for days?
ReplyEmoticonEmoticon