What's new

Manage WLAN-MAC-Filter list via command line (ssh) in a file?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

HOgi

Occasional Visitor
It there a way to manage the WLAN-MAC-Filter list (for 2,4 and 5GHz) in a file (for example with a list of all allowed mac-adresses) that I can edit with vi via command line (ssh)?

Something like dnsmasq.leases for static dhcp...

Should be must faster than add all mac-adresses one by one via the web interface.

Thanks,
HOgi
 
Last edited:
The maclists are stored in nvram. You could export the contents of the relevant nvram variable to a file, edit it, and then write it back to nvram. The same principle as is used for the dhcp_staticlist variable.

Enter the following command to see the current variables.
Code:
nvram show | grep maclist | sort

What model of router do you have?
 
The maclists are stored in nvram. You could export the contents of the relevant nvram variable to a file, edit it, and then write it back to nvram. The same principle as is used for the dhcp_staticlist variable.

Enter the following command to see the current variables.
Code:
nvram show | grep maclist | sort

What model of router do you have?
I have a RT-AX88U.

For static dhcp I have a file /var/lib/misc/dnsmasq.leases
I don't have to export or import something. I just need to edit the file, that's all. I've done this, because I don't had enough free memory for all my devices.

Would be nice if something like this would also be possible for the WLAN-MAC-Filter list. But there should be two different files. One for 2,4 GHz and one for 5GHz, or not? And there should be informations like if it is a black- or white-list.

Sorry if my questions are stupid...
 
For static dhcp I have a file /var/lib/misc/dnsmasq.leases
I don't have to export or import something. I just need to edit the file, that's all. I've done this, because I don't had enough free memory for all my devices.
There is no equivalent file for the MAC lists. The nvram variables are read, parsed and sent directly to the Wi-Fi chip when the wireless service is started. There is a limit on how many MAC addresses are in each list.

Would be nice if something like this would also be possible for the WLAN-MAC-Filter list. But there should be two different files. One for 2,4 GHz and one for 5GHz, or not?
Yes, look at the output of the command I showed you. You can see there are variables for 2.4GHz (wl0_maclist_x) and 5GHz (wl1_maclist_x). There are also other similarly named variables for the guest Wi-Fi networks (e.g. wl0.1_maclist). The allow/deny state is stored in wl0_macmode and wl1_macmode.

As you have an RT-AX88U you can also see the maclist nvram variables exposed in the /jffs/nvram directory. Directly editing these files, while possible, is dangerous because it bypasses the router's API and cache. So if you were to do this you must always issue a nvram commit command immediately before updating one of these files. If you don't do this you stand a good chance of corrupting other nvram variables. Once you've made the changes you'd have to restart the wireless service for it to take effect (which would momentarily disconnect all Wi-Fi users).

I guess you could ignore the nvram variables entirely and just create your own maclists and write them directly to each Wi-Fi chip. You'd need to create your own custom script to do that though and the exact commands may differ depending on the model of router.
 
Last edited:

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top