The MAC address changes on every reboot on Raspbian Lite after installing Home Assistant

I think it’s caused by the network-manager package, but I couldn’t find any reference or solution to this problem.

You might want to add a little more details to your question… :slight_smile:

I followed the instructions from this page on Raspbian Lite, and the Wi-Fi MAC address changes every time I reboot the Raspberry Pi 4.

OK, I’ll try it again… :slight_smile: Please check this topic, especially for your case is #10 and #7 to #9. All others are relevant as well.

After I installed Raspbian Buster Lite 4.19.97 using balenaEtcher, and connected it wirelessly to the router, the MAC address wasn’t changing between reboots.

After I installed Home Assistant, the MAC address started changing after reboots.

My goal is to have Home Assistant installed, without changing the MAC address after reboots.

I tried finding any reference to this issue to no avail.

I installed Home Assistant version 0.106.5, using the instructions from this page.

how you checking mac? Where are you seeing this change?

same/similar problem and they found solution in below

https://www.raspberrypi.org/forums/viewtopic.php?t=171534

In the router’s DHCP Client List and in ifconfig's output. They’re trying to spoof it, not reset it to the default value.

I’ll reinstall everything from scratch tonight while paying more attention to this.

Did you reserve the MAC address for the Pi in your router? That is all I do and it’s never changed on me.

I did. But it doesn’t help if the Pi changes it.

The Pi won’t change it if the router is allocating it via DHCP if that ip is reserved for that MAC address.

I have half a dozen Pi’s used for different purposes and the IP address never changes when it’s reserved.

The router allocates the IP address for a MAC address, it doesn’t allocate a MAC address. The device “publishes” a MAC address, which usually is hardware bound, but can be spoofed intentionally (or unintentionally, as in my case), in which case the router wouldn’t have an IP address assigned to the new spoofed MAC address, meaning that the allocated IP address (and not the MAC address) for that device will be changed.

For example, what happens if I turn Wi-Fi off on my Raspberry Pi and reboot it? How would it know not to change it’s MAC address just because “the router is allocating it via DHCP”?

Yes I know and I never said any different.

No it can’t.

The MAC address won’t spontaneously change.

If you switch from Ethernet to WiFi… both Ethernet and wifi will have a unique MAC address you can reserve an IP address for (NOT the same IP address obviously)

I never said this either. I said unintentionally, meaning, I didn’t want to change it. But from what I found, the Linux package network-manager can change the MAC address to anything you want, and somehow, for me, it changes to a random one by default.

And I have half a dozen Pi’s that have not changed MAC address ever in the years I have used them. I also did a generic Linux install of HA Supervised (formerly Hassio) on Raspbian Lite - never had a single issue. I have never assigned a Static IP address on the devices - I always reserve an IP address for a specific MAC address. If your Pi is doing something different it’s something you have installed doing it - not HA.

Network-manager is optional on a generic Linux install. You could try to remove it.

Could you please post the output of ifconfig? Maybe it is an issue with Docker (outdated version from the package repository and not Docker itself). Docker assigns internal MAC addresses, maybe there is something wrong?

Have you changed any settings regarding eth configs or wireless on the Pi (not with HA)? What router are you using? C’mon, give us more information about your setup, it gets boring, if we have to ask every detail.

What exactly is your setup? How exactly did you install? What other things are running on that Pi? As you noted yourself, you didn’t find any “known issues” around this, so to solve this problem, it needs to be examined, and that is way easier, if you dogive out all information you can think of. In this case I’d say, the more the better. :slight_smile:

And how would I know what detail is relevant?!

I said twice in this thread how I did it.

I just wanted some tips or pointers, not for someone else to directly solve it for me. I will do the main investigation and debugging.

In other words, a reply like “This sounds like it could be caused by x, you could try searching if y and see if it helps” would have been more helpful then asking why I didn’t give some details that I didn’t think were relevant at all, because I don’t know this software as good as others (which, again, could have asked for specific details that they knew they were relevant because they know the software better).

Did you remove network-manager as I suggested?