I'm suddenly getting a random MAC address after reboot

Hi everybody,

Something changed in NixOS 23.11 default config…

Today I updated my PC that runs stable NixOS 23.11 and that hasn’t been updated for approx ~3 weeks. After rebooting, I realized that the network was down. After some investigation I realized that USB NIC adapter ax88179_178a has a different MAC address and therefore static IP is not set (I set static IP to specific interfaces using systemd-network).

I thought that is strange and I updated my second PC which also had outdated NixOS and also has the same model of USB adapter and again, the MAC changed after reboot.

I didn’t change my configuration so I assume something changed in NixOS default configuration and I’m now getting random MACs on each reboot. Or maybe kernel is built with different options.

I don’t know how to fix it… My only hope was that Network Manager is doing something funny but I checked and those interfaces are unmanaged and I also tried and removed Network Manager and it didn’t help…

Any suggestions?

Thank you.

Are you sure you removed Network Manager and not just stop it (systemctl stop NetworkManager.service)?

You might look into /etc/NetworkManager/NetworkManager.conf for:

[connection]
ethernet.cloned-mac-address=<value>

I think the default is preserve and you might need to change it to permanent.

To change it there will be an option in config.networking.networkmanager.

2 Likes

Thank you. For wired NICs I use systemd-network and after reading your post I completely removed Network Manager and it still doesn’t work (the mac address changes every reboot).

My assumption is that something changed in the last kernel update or in systemd-network but I can’t figure out what.

And all other laptops / PCs are OK - the only problem is those with ax88179_178a

And it’s weird that something changed since I’m on stable 23.11.