Jump to content

MAC of wlan0 change every boot , opiz .


Netanel

Recommended Posts

Armbianmonitor:

Hi everyone,
Since i update to kernel 5.15.25-sunxi ,
every reboot the mac of wlan0 changed the mac address and router giv him another ip. 
i will be very happy to solve this issue , 
Thanks!

 

Note:
I tried to re-download the ARMBIAN from the official website, and burned a new SD. This experience did not help.

Quote

Armbian 22.02 Bullseye
Kernel 5.15.y, Size: 327Mb, Updated: Feb 27, 2022

 

First boot:
image.png.d12b7af27c5cb615fd0561ed0b86ed17.png

 

Second boot:

image.thumb.png.dc5f88c55a682455e2df4cd0f2d22af8.png

 

Link to comment
Share on other sites

Confirmed on multiple devices.

Upgrading Kernel from 5.10.60 to 5.15.x will cause the issue described by OP.

 

Any recommendations found on this forum to switch to a static MAC will not help.

Link to comment
Share on other sites

Confirmed on multiple devices here too.

I can confirm that reverting to kernel 5.10.60 temporarily solves the issue; kernels above 5.15.25 have the same issue too.

 

Changing or force the MAC address of the interface (i.e. with macchanger) doesn't solve the issue and breaks wifi functionality completely.

There should be some bug in the kernel driver, but the statement above suggests that it may be more serious than the bare read of MAC address (from device firmware?).

 

For applications where a static MAC address is preferred to assign a specific IP address by DHCP, I opted for statically assign that IP on the board network config.

 

 

Link to comment
Share on other sites

Well, I digged a little around this issue.

It looks like a patch to the kernel driver of the xradio module is somewhat incomplete.


So I patched the kernel and now the Wi-Fi works like a charm... well, not really (because of the XR819 module) but at least it gets the stored MAC address, as before.

For anyone interested, here is attached the required patch; unfortunately a rebuild of the kernel is needed.

22-05.0-orangepizero-xradio_skupsy_20220520.patch

Link to comment
Share on other sites

4 hours ago, Skupsy said:

Well, I digged a little around this issue.

It looks like a patch to the kernel driver of the xradio module is somewhat incomplete.


So I patched the kernel and now the Wi-Fi works like a charm... well, not really (because of the XR819 module) but at least it gets the stored MAC address, as before.

For anyone interested, here is attached the required patch; unfortunately a rebuild of the kernel is needed.

22-05.0-orangepizero-xradio_skupsy_20220520.patch 1.47 kB · 1 download

 

Thanks for providing the patch, Skupsy!

I wonder, what's the best way to report a bug for this patch to become available for everyone. I cannot push the patch or a recompiled kernel to 50 people.

Link to comment
Share on other sites

All right. Here's my experience.

 

Followed the https://docs.armbian.com/Process_Contribute/ link suggested

then https://github.com/armbian/build

then https://github.com/armbian/build/issues

made sure no similar issue is open

then https://github.com/armbian/build/issues/new/choose

then https://www.armbian.com/bugs/

reached the "Run armbianmonitor -u and copy the generated URL" part

output from console was :

$ armbianmonitor -u
System diagnosis information will now be uploaded to curl: (52) Empty reply from server
Please post the URL in the forum where you've been asked for.

then noticed something on the form (you're welcome)

eventually reached the point on the form which sent me here https://forum.armbian.com/forum/1-bug-tracker-supported-boards-only/

"Old bug tracker - read only"

 

Any other ideas?

 

Link to comment
Share on other sites

First of all thank you very much for answering,
An update to Kernel was released today but unfortunately the issue has not yet been resolved.
I'm still not at the level of changing the code in Kernel.

So I wanted to ask, when approximately will the problem be solved if at all?

Link to comment
Share on other sites

35 minutes ago, Netanel said:

So I wanted to ask, when approximately will the problem be solved if at all?

No ETA since we do not have resources to dedicate to this particular problem.

You can fund problem solving however: https://docs.armbian.com/User-Guide_FAQ/#why-is-armbian-constantly-asking-for-money-free-software-should-be-free

Link to comment
Share on other sites

5 hours ago, Netanel said:

Got it, we'll consider our steps further Thanks!


All you need to do is to test if patch provided by @Skupsy is working and integrate it: https://docs.armbian.com/Process_Contribute/ If this is a solution say thanks to him and to us for keeping build framework system in good health and for the guidance. And check your support contract.

Link to comment
Share on other sites

I believe this patch is causing, for kernels >= 5.13 - section of setting up mac address is skipped:

 

https://github.com/armbian/build/blob/master/patch/misc/wireless-xradio-5.13.patch

 

I do not have the knowledge - what was stated behind of this patch...

 

For me the problem is that generally I have a policy to name network interface with mac. And currently on OPI Zero - this is making my wlan interface "random".

Link to comment
Share on other sites

Solution:

1. Create file in /etc/systemd/network with name eg. "01-xradio_wlan.link". Please refer to systemd documentation.

 

obraz.png.e4930a0e179b5f336ffc567782e54881.png

 

Content of file:

[Match]
OriginalName=*
Driver=xradio_wlan

[Link]
NamePolicy=
Name=wlx0042c49ede90
MACAddressPolicy=none
MACAddress=00:42:c4:9e:de:90

 

For reference, this is content for 2nd file "99-default.link" (which is applied as default policy):

[Match]
OriginalName=*

[Link]
NamePolicy=mac
MACAddressPolicy=none

 

2. Result:

obraz.png.f6cd233890289cd98de9bcb9b4b22cad.png

 

Link to comment
Share on other sites

On 7/28/2022 at 11:19 AM, piknew said:

Solution:

1. Create file in /etc/systemd/network with name eg. "01-xradio_wlan.link". Please refer to systemd documentation.

Content of file:

[Match]
OriginalName=*
Driver=xradio_wlan

[Link]
NamePolicy=
Name=wlx0042c49ede90
MACAddressPolicy=none
MACAddress=00:42:c4:9e:de:90

 

For reference, this is content for 2nd file "99-default.link" (which is applied as default policy):

[Match]
OriginalName=*

[Link]
NamePolicy=mac
MACAddressPolicy=none

 

 

 

 

Hi! Having the same problem, I tried several solutions like @piknew /etc/systemd/network/x.link, or another idea with the service file that changes MAC via ip tool or macchanger:

 

% cat /etc/systemd/system/wlan0-mac.service  
[Unit]
Description=wlan0 MAC
Wants=network-pre.target
Before=network-pre.target wpa_supplicant.service
BindsTo=sys-subsystem-net-devices-wlan0.device
After=sys-subsystem-net-devices-wlan0.device

[Service]
Type=oneshot
ExecStart=/usr/bin/logger "wlan0 MAC"
#ExecStart=/usr/bin/ip link set dev wlan0 address xx:xx
#ExecStart=/usr/bin/ip link set dev wlan0 up
ExecStart=/usr/bin/macchanger --mac=xx:xx wlan0
 

[Install]
WantedBy=multi-user.target

 

all of them work partially - MAC is changed, but after that NM doesn't connect to WiFi, says authentication problem:

 

Aug  4 13:10:39 o3dp wpa_supplicant[605]: wlx0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="o-nest" auth_failures=2 duration=20 reason=CONN_FAILED
Aug  4 13:10:39 o3dp NetworkManager[576]: <info>  [1659607839.4767] device (wlx0): supplicant interface state: authenticating -> disconnected
Aug  4 13:10:39 o3dp NetworkManager[576]: <info>  [1659607839.4769] device (p2p-dev-wlx0): supplicant management interface state: authenticating -> disconnected

 

I tried to switch to IWD instead, but NM crashes with SEGV/11.
 

The only working solution is to downgrade to 5.10 (I tried both 5.15.48 and 5.15.25). I need fixed MAC because I use my OPi Zero as OctoPrint server and thus need the same IP address. Alternatively you may set IP address via NMtui manually.

PS: wired connection has constant MAC.

 

Link to comment
Share on other sites

04.08.2022 в 13:34, SergeO сказал:

% cat /etc/systemd/system/wlan0-mac.service  
[Unit]
Description=wlan0 MAC
Wants=network-pre.target
Before=network-pre.target wpa_supplicant.service
BindsTo=sys-subsystem-net-devices-wlan0.device
After=sys-subsystem-net-devices-wlan0.device

[Service]
Type=oneshot
ExecStart=/usr/bin/logger "wlan0 MAC"
#ExecStart=/usr/bin/ip link set dev wlan0 address xx:xx
#ExecStart=/usr/bin/ip link set dev wlan0 up
ExecStart=/usr/bin/macchanger --mac=xx:xx wlan0

Hi. I have same error with connection on 

Armbian_21.08.1 Bullseye/5.10.60. NetworkManager cant connect to wifi and try to do it a lot of times. As you know at 5.10.60 mac is stable out from box.

 
On Armbian 22.08 Jammy/5.15 wifi works good but it has problem with random mac. However if i used same Service script, mac becomes stable and problem returning like on previous version that i tested.

 

IMHO random mac looks like a patch for some previous versions that breaking stable mac setting

Edited by Newuser123
Link to comment
Share on other sites

I have yet another workaround for this: do not use MAC for static lease of IP-address, use static IP itself instead. In some cases it might work (if you  have access to reconfigure your wi-fi AP/Router).

In my case, I have a SOHO-router, where I have an option, such as "Start IP" and "End IP" in DHCP configuration, I use 100 in "Start IP", and clients in my network by default gets addresses 100 and above, but in OrPi Zero I can use nmtui edit to set up wifi-connection (set SSID, password etc...), and in option "IPv4 Configuration" I can set IP-address below 100.

1183168193_.png.d8a17b60c0d75085073859dcf927f499.png

491169143_.png.7a5c545e150da0938c2b17a49b6c6b9c.png 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines