Script for cutting down the bandwidth momentarily

Hello.

I need a script that cut the bandwidth from 256kbs to 150kbs (maybe with simple queues) if one user with an “X” ip address (for example: 192.168.12.100) is using full dadicated download bandwidth 256kbs for an interval of time 2 min.

If is it possible after 10 min to bring again its initial bandwidth (256kb/s)

Thank You in advance.

I don’t think script would be a good solution in this case. Just use queue to limit at 150k and burst value to 256k. That will do exactly what you want.

OK.
Thank You!

Is this a right configuration ?

name=“106” target-addresses=192.168.12.106/32 dst-address=0.0.0.0/0 interface=local parent=none priority=8
queue=default/default limit-at=150000/150000 max-limit=150000/150000 burst-limit=250000/250000 burst-time=2m/2m
total-queue=default

Regards.

Your burst won’t gonna last 2 minutes.
Check out manual, what burst time value means:
http://www.mikrotik.com/testdocs/ros/2.9/root/queue.php?permalink=0.35888414174415684

Thank You
It was very useful.