Jump to content
  • 0

MAC of wlan0 change every boot , opiz .


Netanel
 Share

Question

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

15 answers to this question

Recommended Posts

  • 0

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

Armbian is a community driven open source project. Do you like to contribute your code?

  • 0

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

  • 0

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

  • 0
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

  • 0

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

  • 0

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

  • 0

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

  • 0

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

  • 0
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

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
Answer this question...

×   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...
 Share

×
×
  • Create New...