Community discussions

just joined
Topic Author
Posts: 2
Joined: Tue Nov 27, 2018 10:19 am

Limit user/IP by volume

Tue Nov 27, 2018 10:51 am

I want to limit queue IP when he reaching 1Gb
DHCP Pool Range

Using Router OS 6
Get Syntax error when running script try to add $ variable then syntax error goes away but limit does not apply to target.

:local traffic
/queue simple
:for i from=1 to=254 do={
:set traffic [get [find target-addresses="192.168.8.$i/32"] total-bytes]
:if ($traffic > 1000000000) do={
set [find target-addresses="192.168.8.$i/32"] max-limit=128000/128000
User avatar
Forum Guru
Forum Guru
Posts: 1110
Joined: Tue Jul 21, 2015 10:09 pm
Location: UK

Re: Limit user/IP by volume

Tue Dec 04, 2018 6:02 pm

Where is "total-bytes" coming from? The router does not register or hold this information unless using hotspot.
Steve "Steveocee" Carter
PC Gamer, Airsofter, MikroTik Nerd
My Website - My MikroTik Tutorials
User avatar
Forum Guru
Forum Guru
Posts: 1302
Joined: Sat Dec 24, 2016 11:17 am
Location: jo.overland at

Re: Limit user/IP by volume

Tue Dec 04, 2018 7:00 pm

Not 100% true, you do get traffic data by IP using snapshot, bit as far as I know, it can not be used to bandwidth limeting.
I may be possible to write a script that take snapshot every minute, then add all bytes for an IP.
Can be bypassed by changing IP, and how to administrate this etc....
This is just an idea. :)
How to use Splunk to monitor your MikroTik Router


Who is online

Users browsing this forum: No registered users and 12 guests