Just installed Ubuntu 22.04 and istalled morrownr's 8821au drivers for my usb wireless adapter https://github.com/morrownr/8821au-20210708

The usb device is detected as 8811au but based on the description, the drivers support it just fine.

The problem is that the mac address gets randomly generated after every reboot... which results in any previous working network connection to be useless (will have to manually establish connection and type in password again etc, and creates multiple network profiles perpetually until manually removed via nmcli)

  1. have tried to set the clone mac address to permanent/preserve.. no use there.
  2. have tried this USB Wifi Dongle changes MAC Address on every boot - How to prevent this?. no use there.
  3. have also confirmed this wifi.scan-rand-mac-address=no in NetworkManager.conf

Anyone got any idea how to resolve this? I suspect it has something to do with USB adapters only

Just found before i posted Won't automatically reconnect wifi on startup (18.10) the solution works, but i guess if someone has multiple wifi connection on the same machine, it wouldn't work well..

Maybe someone else have a better solution?

1 Answer 1


if you want to configure the MAC address via NetworkManager, then the per-profile setting wifi.cloned-mac-address is the right setting.

wifi.scan-rand-mac-address=no only matters while scanning, so unless there is a problem (e.g. driver having bugs with changing the MAC address), it's fine that NetworkManager is doing it.

Unless you (or something on your system) configured NetworkManager's wifi.cloned-mac-address to change the MAC address, it already defaults to "preserve". So it's expected that setting wifi.cloned-mac-address=preserve has no effect. If somebody else is changing the MAC address and you don't want that, it would be best to prevent that other tool from doing that.

If the device has no permanent MAC address, you can also set wifi.cloned-mac-address=stable or set it to an explicit MAC address wifi.cloned-mac-address=aa:bb:cc:dd:ee:ff. In those cases, NetworkManager should just set the MAC address when activating the profile.

Of course, wifi.cloned-mac-address is a setting of the profile. It only takes effect when you activate the profile.

have tried this USB Wifi Dongle changes MAC Address on every boot - How to prevent this?. no use there.

If you followed that, and set the property in NetworkManager.conf, then you configured a default for the per-profile value. That only takes effect, if the per-profile value is unset. That's explained in man NetworkManager.conf. If you still are looking what the right setting is, configure it per-profile (nmcli connection modify "$PROFILE" wifi.cloned-mac-address "$VALUE"). Setting a default in NetworkManager.conf is possible and fine if you understand what is happening, but it adds one layer of confusion.

  • Have tried setting the wifi.cloned-mac-address before.. it doesn't work... On every reboot a new MAC address is given to the Wifi dongle, resulting in any existing connection profile to fail to work.... in a normal ubuntu ip add.. i would actually get something like this as the device ID - wlp0s20f3..... but for this instance the device ID will be something like this wlx00e04ce55daf... and it changes every reboot.
    – belgeran
    Jul 22 at 0:14
  • hard to say what is happening. When activating a profile with wifi.cloned-mac-address set, NetworkManager is supposed to set the MAC address. Saying "on every reboot" seems confusing, because wifi.cloned-mac-address takes effect when activating the profile, not before. In any case, the level=TRACE log of NetworkManager will tell you, when NetworkManager changes the MAC address. Read gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/…, reboot (to get a complete log from the start) and search the log for the MAC address.
    – thaller
    Jul 22 at 8:24
  • hmm not sure it works that way... cause the behavior from a user point of view, this seems to be happening instead: - Create a profile, connected successfully... - Reboot - Wifi doesn't connect automatically.... attempt to connect by activating the profile doesn't work.....Creating a new profile with exactly the same credentials works fine... after that went to check out ip add or nmcli.. the mac address is different between both profiles.... maybe the mac address is set when NetworkManager is loaded?.. not when the profile is activated?
    – belgeran
    Jul 23 at 11:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.