Community discussions

MikroTik App
 
khaloudy
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 92
Joined: Mon Jun 29, 2009 6:12 am

divide bandwidth between active users Help

Thu Feb 27, 2014 6:14 pm

slam..
i have 1 m speed line = 1024/256 KB
i want divide bandwidth between active users only
i her about this script use in schedule
:global host
:global uspeed 256
:global dspeed 1024
:global maxu
:global maxd
/ip hotspot host ;\
:foreach nm in=[find]\
do={\
:global byte1 [get $nm bytes-out]
}
:delay 1m
/ip hotspot host ;\
:foreach nm in=[find]\
do={\
:global byte2 [get $nm bytes-out]
:global bytenew ($byte2 - $byte1)
:if ($bytenew > 15000000)\
do={\
:global nm 0
:set host ($nm + 1)
:set maxd (($uspeed / $host)*1000)
:set maxu (($dspeed / $host)*1000)
:global ip [get $nm address]
/queue simple ;\
remove [find name=$ip] ;\
add burst-limit=0/0 burst-threshold=0/0 burst-time=0s/0s comment=newmind direction=both disabled=no \
    interface=all limit-at="$maxu/$maxd" max-limit="$maxu/$maxd" name=$ip packet-marks="" parent=none priority=4 \
    queue=default-small/default-small target-addresses=$ip total-queue=default-small;\
remove [find name!=$ip] ;\
}}}
but i can't use it
please help me how i use it
or >>>>>>>>>>>>>>>>>
the true way to divide bandwidth between active users only
best regards
 
khaloudy
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 92
Joined: Mon Jun 29, 2009 6:12 am

Re: divide bandwidth between active users Help

Thu Feb 27, 2014 7:37 pm

help ....
up....
 
bingo220
Member Candidate
Member Candidate
Posts: 124
Joined: Sun Sep 22, 2013 9:30 pm
Location: Ukraine

Re: divide bandwidth between active users Help

Fri Feb 28, 2014 11:31 am

 
khaloudy
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 92
Joined: Mon Jun 29, 2009 6:12 am

Re: divide bandwidth between active users Help

Wed Mar 12, 2014 10:49 pm

THIS YOUTUBE TALK ABOUT THIS ROWL
/ip firewall mangle add chain=forward src-address=192.168.1.0/24 action=mark-connection new-connection-mark=NET1-CM
/ip firewall mangle add connection-mark=NET1-CM action=mark-packet new-packet-mark=NET1-PM chain=forward
/queue type add name=pcq_downsteam kind=pcq pcq-classifier=dst-address
/queue type add name=pcq_upstream kind=pcq pcq-classifier=src-address
/queue tree add parent=lan queue=pcq_downsteam packet-mark=NET1-PM
/queue tree add parent=public queue=pcq_upstream packet-mark=NET1-PM
i know this code b4
but this code like hotspot code
...
i want something else
just example

we are 6 users use 1024 / 128 kb = 1 -mb
1- when 1 user active i want hem get all the line 1024 kb
2- when become 2 users active online .. every one get 512 kb
2- when become 4 users active online .. every one get 256 kb
and
if one shut down and they become 3 users active ...
1024 / 3 = 341.3 kb
is that possible ?

best regards..

Who is online

Users browsing this forum: Kanzler, neki, tothand and 66 guests