You are on page 1of 2

/ip firewall mangle

add action=mark-packet chain=prerouting comment=infinity limit dst-address=\


!192.168.0.1 new-packet-mark=infinity limit
/ip hotspot user profile
set [ find default=yes ] on-login="/system script run infinity limits" on-logout
="/system script run infinity limits"
------------------ +
v6
{
:local i;
:local j 6144000;
:set i [ :len [/ip hotspot active find] ];
:local p;
:set p [ :len [/ip hotspot ip-binding find] ];
:if ($i=0) do={:set i 1;}
:if ($p=0) do={:set p 1;}
:local t ($i+$p);
:local x ($j/$t);
:local y ($x/4);
:foreach i in=[/queue simple find] do={/queue simple remove $i;}
:local addr;
:local uname;
:local macby;
:local addrby;
:foreach i in=[/ip hotspot active find] do={
:set addr [/ip hotspot active get $i address];
:set uname [/ip hotspot active get $i user];
:foreach m in=[/ip hotspot ip-binding find] do={
:set addrby [/ip hotspot ip-binding get $m to-address];
:set macby [/ip hotspot ip-binding get $m mac-address];
/queue simple add name=$uname target=$addr packet-marks=infinity limit max-limit
="$y/$x" queue=ethernet-default/ethernet-default;
/queue simple add name=$macby target=$addrby packet-marks=infinity limit max-lim
it="$y/$x" queue=ethernet-default/ethernet-default;
}
}
}
/queue simple set [ find name=admin ] max-limit=64k/64k

---------
v5
{:local i;
:local j 6144000;
:set i [ :len [/ip hotspot active find] ];
:if ($i=0) do={:set i 1;}
:local x ($j/$i);
:local y ($x/4);

:foreach i in=[/queue simple find] do={/queue simple remove $i;}


:local addr;
:local uname;
:foreach i in=[/ip hotspot active find] do={
:set addr [/ip hotspot active get $i address];
:set uname [/ip hotspot active get $i user];
/queue simple add name=$uname target-addresses=$addr packet-marks=infinity limit
max-limit="$y/$x";
}
}
-------------

You might also like