Page 1 of 1

Queue only wifi 2,4GHZ

Posted: Sun Sep 08, 2024 1:22 pm
by ecd12
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

Re: Queue only wifi 2,4GHZ

Posted: Wed Sep 11, 2024 4:09 pm
by leestanton
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.

Re: Queue only wifi 2,4GHZ

Posted: Sun Sep 22, 2024 2:30 pm
by ecd12
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.