Community discussions

MikroTik App
 
ecd12
just joined
Topic Author
Posts: 2
Joined: Sat Jan 20, 2024 9:09 pm

Queue only wifi 2,4GHZ

Sun Sep 08, 2024 1:22 pm

Good afternoon guys
I have a script so that when they connect to Wi-Fi, the MAC is added to a simple queue. ¿How could it be done to only add devices that connect to 2.4ghz Wi-Fi to the queue?

:local queueName "Client- $leaseActMAC";

:if ($leaseBound = "1") do={
/queue simple add name=$queueName target=($leaseActIP . "/32") limit-at=60M/60M max-limit=60M/60M comment=[/ip dhcp-server lease get [find where active-mac-address=$leaseActMAC && active-address=$leaseActIP] host-name];
} else={
/queue simple remove $queueName
}


thanks in advance
 
leestanton
just joined
Posts: 4
Joined: Wed Sep 04, 2024 6:22 pm

Re: Queue only wifi 2,4GHZ

Wed Sep 11, 2024 4:09 pm

To add only devices connected to the 2.4GHz Wi-Fi to the queue, you can use the interface property to check if the device is connected to the 2.4GHz interface. Assuming your 2.4GHz interface is named something like wlan1, you can modify your script as follows:

:local queueName "Client- $leaseActMAC";

:if ($leaseBound = "1" && [/interface wireless registration-table get [find where mac-address=$leaseActMAC && interface="wlan1"] interface] = "wlan1") do={
/queue simple add name=$queueName target=($leaseActIP . "/32") limit-at=60M/60M max-limit=60M/60M comment=[/ip dhcp-server lease get [find where active-mac-address=$leaseActMAC && active-address=$leaseActIP] host-name];
} else={
/queue simple remove $queueName
}

This script checks if the device is connected to the wlan1 interface (which represents the 2.4GHz network) before adding it to the queue. Adjust wlan1 to match your actual 2.4GHz interface name.
 
ecd12
just joined
Topic Author
Posts: 2
Joined: Sat Jan 20, 2024 9:09 pm

Re: Queue only wifi 2,4GHZ

Sun Sep 22, 2024 2:30 pm

Good afternoon,

I have tested it and it works correctly, the only thing that in ROS v7 you have to change "wireless" to "wifi".
Thank you very much for the help, greetings from the south of Spain.

Who is online

Users browsing this forum: No registered users and 6 guests