Open gitbls opened 3 months ago
FWIW on my P14B fully updated Lite, 64bit:
udevadm info /sys/class/net/eth0
does not have an entry for ID_NET_NAME_MAC for my ax88179_178a USB ethernet interface - whereas my r8152 has ID_NET_NAME_MAC=enx70886bXXXXXX
udevadm info /sys/class/net/eth0 --attribute-walk
gives ATTR{addr_assign_type}=="1" for ax88179_178a - whereas r8152 gives ATTR{addr_assign_type}=="0". kernel docs say that addr_assign_type equals 1 means that the MAC address is randomly generated (which in this case it isn't). addr_assign_type equals 0 means permanent address.
the MAC address is randomly generated (which in this case it isn't)
I see in @gitbls 's logs that he gets a different MAC address for his ASIX AX88179 USB 3.0 Gigabit Ethernet
each time - 5a:42:73:19:ee:e6
and c2:cb:e8:61:e8:94
?
the MAC address is randomly generated (which in this case it isn't)
I see in @gitbls 's logs that he gets a different MAC address for his
ASIX AX88179 USB 3.0 Gigabit Ethernet
each time -5a:42:73:19:ee:e6
andc2:cb:e8:61:e8:94
?
I hadn't noticed that. Why would that happen for the ASIX but not for the built-in ethernet? I have not modified /etc/NetworkManager/NetworkManager.conf which has [device]\n wifi.scan-rand-mac-address=no
And, does this weigh on why the predictable network name is not applied? If so, how?
That's interesting. Mine is not random. It has been the same for many years using previous versions of RaspiOS and it has alos been the same every boot in the last few days using the latest version.
Is it possible that some versions of this USB dongle have a ROM (and thus a fixed MAC address) but other versions don't have a ROM, and so expect to get a randomly-generated MAC address? Just a wild guess...
Is it possible that some versions of this USB dongle have a ROM (and thus a fixed MAC address) but other versions don't have a ROM, and so expect to get a randomly-generated MAC address? Just a wild guess...
Maybe. But the particular adapter I'm using (a Cable Matters USB 3.0 device) is several years old, and always gets the same MAC address on, for example, Windows. Its MAC address is included in my DHCP server and always gets the same IP address.
Huh, so the MAC address seen by your DHCP server is different to the MAC address that gets displayed in your kernel logs? @pelwell Should this issue be moved to the linux repo?
Huh, so the MAC address seen by your DHCP server is different to the MAC address that gets displayed in your kernel logs? @pelwell Should this issue be moved to the linux repo?
TBH I didn't connect the ASIX to the network when I did the above test. I can do further testing today, LMK what would be most helpful in sorting this.
Just to be clear, my ASIX interface gives the same MAC address to the DHCP server as it is displayed in the kernel logs.
If it helps, the reason that I noticed the issue was that my router failed after the upgrade to kernel 6.6.20 (from 6.1). My old and trusted udev rule that gave a predictable name failed for the first time:
SUBSYSTEM=="net", ACTION!="remove", ATTR{address}=="12:34:56:78:9A:BC:DE", NAME="myNET"
On investigating I found that the official predictable names system also failed.
Strange. With an RTL8153-based USB Gigabit Ethernet Adapter and predictable names enabled I get:
end0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
...
enx????????????: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
...
That's with the latest apt kernel:
Linux raspberrypi 6.6.20+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.6.20-1+rpt1 (2024-03-07) aarch64 GNU/Linux
But it is a full (non-Lite) image.
And do you have any idea why your udev rule failed, if your MAC address hasn't changed?
Strange. With an RTL8153-based USB Gigabit Ethernet Adapter and predictable names enabled I get:
end0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 ... enx????????????: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500 ...
That's with the latest apt kernel:
Linux raspberrypi 6.6.20+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.6.20-1+rpt1 (2024-03-07) aarch64 GNU/Linux
But it is a full (non-Lite) image.
I'll put up a "with desktop" version and try the ASIX with it.
I have an AX88179 here, and can confirm that I get eth0 rather than a predictable name. The genet interface is end0 as expected.
2: end0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
...
3: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
MAC address is consistent. x86 Ubuntu 20.04 on a 5.15 kernel is giving predictable names. I can't test a more recent kernel on x86 easily.
Ah, just tested a vanilla "with desktop". Same behaviour (eth0 rather than predictable name), but still seeing the MAC address change from 26:4d:96:45:c3:8c (before setting predictable names) to a0:ce:c8:03:80:a9 after setting predictable and rebooting.
BTW, neglected to mention previously, a0:ce:c8:03:80:a9 is the device's actual MAC address (it's taped onto the device 🤣), so weird that it changes in the non-predictable case.
My r8152 card also gives the expected predictable name enxXXXXXXXXXXX. My issue is only with my ax88179_178a USB ethernet adapters.
No, I don't have any idea why my udev rule fails. It never gets my name at boot or when the USB is hot-plugged in. However it does get my name if I run sudo udevadm -d trigger --action="add"
I have had a look with sudo udevadm monitor -p
when plugging in the ax88179_178a compared to the r8152. Apart from noting that eventually the r8152 comes up with a KERNEL move from old name /devices/../../net/eth1 to /devices/../../net/myNET and the ax88179_178a doesn't.
Looking at udevadm info /sys/class/net/eth0 --attribute-walk
(the ax88179_178a came up as eth0 this time), I see ATTR{addr_assign_type}=="1"
But with the r8152 I always get ATTR{addr_assign_type}=="0"
It would be sensible not to use the MAC to form the enx style name if the device states the address is random!
My ax88179_178a always comes up at boot with the same MAC address. I have never observed any different MAC address.
I'm testing previous kernel releases to try and pin it down. 6.3 and 6.4 give predictable names on a Pi4.
6.5.13 is also OK. 6.6.21 fails. For completeness, 6.8.1 also fails.
And the best bit is that there appear to be no direct changes to the AX88179 driver in 6.6, so it's looking to be a framework change with unintended consequences.
Cause found.
usbnet_probe is setting addr_assign_type to _RANDOM. ax88179_reset comes along later, and calls ax88179_get_mac_addr to set the address, but never clears the flag.
I'd missed one backported commit (https://github.com/raspberrypi/linux/commit/d7a319889498a1542470dd461c8e9022f3ef75f4 in 6.6, https://github.com/raspberrypi/linux/commit/d2689b6a86b9d23574bd4b654bf770b6034e2c7e in 6.8) which removes an extra call to ax88179_reset from bind. That call would have set the MAC address, and hence avoided usbnet_probe setting the RANDOM flag in the first place.
We can revert that locally, but it needs reporting upstream.
You guys rock!
@6by9 You are a genius! But I expect you already know that! Thanks.
Thanks Phil for reverting. I'll sort out reporting it upstream tomorrow.
Reported upstream and acknowledged. They're looking into the proper fix. https://lore.kernel.org/netdev/20240325121756.456684-1-jtornosm@redhat.com/T/#t
Thx for the update, @6by9
Fix proposed upstream - https://lore.kernel.org/netdev/20240326092459.GG403975@kernel.org/T/ As it's cc'ed stable, it should get backported automagically to 6.6.
I believe have a related problem on Proxmox
I have a Startech USB32000SPT USB 3.0 to Dual Port Gigabit Ethernet Adapter, which a year ago installed correctly on my system. It has an ASIX - AX88179A chip. When I try to configure it, it does not get predictable network names, and the two ports are given identical MAC addresses.
On the same system I have a single port usb nic with the same chip, which has been onboard for 12 months or so. It runs correctly and retains the predictable network name, and uses the MAC address printed on its case.
12 months ag - the double nic configured itself correctly with the manufacturer's MAC addresses.
According to this post it worked prior to 6.6, but it doesn't now. Steps:
eth1
Enable predictable names and reboot
After the reboot, in-built network adapter is
end0
and the ASIX adapter iseth0
ip a