Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow manually setting MAC/BSSID on each wireless interface (client, AP, etc) [Enhancement] #5845

Closed
sirfail opened this issue Jun 21, 2022 · 0 comments

Comments

@sirfail
Copy link

sirfail commented Jun 21, 2022

I'm not sure why this isn't implemented in OpenWrt yet since there is demand for it and it has been available for years in Linux Desktops. A quick search shows OpenWrt users are struggling while trying to change the MAC/BSSID address on wireless interfaces, for example in https://www.reddit.com/r/openwrt/comments/9q0ezo/mac_address_spoofing_with_openwrt/ you see the recommendation to set "option macaddr" in file /etc/config/wireless, but the documentation in https://openwrt.org/docs/guide-user/network/wifi/basic says this is not used to change the device mac but to identify the underlying interface.

There is also a script to set a random MAC in https://github.com/krabelize/openwrt-random-mac-changer that uses ifconfig but it does not work. Seems interest to set and change MAC/BSSID addresses is there, but there is no easy and reliable way to do it.

In Issue #2613 "A wireless device cannot have it's mac address set from luci (option macaddr)" the comment from 7. March 2019 says:

"OpenWrt eventually introduced "config device" sections to set things like macaddr, queue lengths etc. per netdev. LuCI currently does not support adding or modifying "config device" sections at all. Support for this needs to be implemented first."

The Issue 2613 is closed but as far as I can see this was never implemented.

Issue #5517 "Button to generate MAC" is still open and would be similar to this one, likely the first step is to allow entering a MAC/BSSID manually and then generating a random one would be the next step. And an option to change automatically to a random MAC/BSSID every day or n hours would be great too.

But to get started it would be already great if the MAC/BSSID could be set manually on every wireless interface (client, AP mode etc) same you can set a static IP address.

PS. The only "reliable" way to change the MAC/BSSID so far is using "uci -q set wireless.@wifi-iface[-1].macaddr=$mac_addr" as explained in https://forum.archive.openwrt.org/viewtopic.php?id=65751 comment 20 Jun 2016, 23:30. It's not persistent, I have to figure out if I can run it from rc.local or a cron job. Changing it with ifconfig or in /etc/config/wireless didn't work.

@jow- jow- closed this as completed in f039069 Jun 21, 2022
jow- added a commit that referenced this issue Jun 21, 2022
Fixes: #5845
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit f039069)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant