Community discussions

MikroTik App
 
AlohaSpark
newbie
Topic Author
Posts: 45
Joined: Wed Jun 16, 2021 10:39 pm

Add comment to DHCP rate limit queue

Sat Nov 13, 2021 3:22 am

Hello,

Is there a way to add a comment to a simple queue created by DHCP server? While testing my script, the command
/queue simple set dhcp-ds<XX:XX:XX:XX:XX:XX> comment="hello"
gave me the error
failure: cannot change dynamic

I just want to show the host name on the list of queues. A while ago I used a more complicated script to add/remove queues manually, but then I switched to static DHCP rate limiting since it's a lot simpler to manage.
 
jonah1810
Frequent Visitor
Frequent Visitor
Posts: 98
Joined: Tue Jul 30, 2019 10:19 pm

Re: Add comment to DHCP rate limit queue

Thu Nov 18, 2021 9:13 pm

Can you delete dynamic simple queues? I think you can but I'm not somewhere i can check right now but if you can delete them what you could do is create a script on lease bound to find the queue that was created by the server, copy it's information and delete the dynamic queue. then create a static queue based on the variables you got from finding the dynamic queue. then you could add the hostname as a comment.

on lease unbound you would want it to find that static queue and delete it probably.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Add comment to DHCP rate limit queue

Fri Nov 19, 2021 6:31 pm

DHCP Server Script
set the right "parent"
and set your wanted limits.
:local nameQueue "Queue $leaseActMAC"

/queue simple
remove [find where name=$nameQueue]
:if ($leaseBound = "1") do={
    add name=$nameQueue parent=MainQueue target="$leaseActIP/32" disabled=no \
    limit-at=100k/100k max-limit=500k/2M priority=5/5 \
    comment="$leaseServerName: >$"lease-hostname"<"
}

Who is online

Users browsing this forum: No registered users and 11 guests