openhab / openhabian

openHABian - empowering the smart home, for Raspberry Pi and Debian systems
https://community.openhab.org/t/13379
ISC License
821 stars 252 forks source link

Random MAC address on fresh install #1607

Closed rainerleuschke closed 2 years ago

rainerleuschke commented 2 years ago

Issue information:

I get a random MAC address on every boot. This will cause my router to assign a new IP address. Not good. The symptoms were reported before in issue #158, fixed and closed.

This issue occured on a fresh install. I installed the latest image from here v1.6.6. The wifi was set up by adding ssid and passwd to openhabian.conf. I never connected ethernet or used the hotspot. I do not recall adding anything else to the system. This started occurring right from the start with MAC address changing every time the RPi reboots during initial setup.

Debug information:

After some digging I was able to fix this on my system. It appears the culprit is NetworkManager. NetworkManager is not installed with the standard Raspberry Pi OS.

The fix that worked for me is described here Re: Raspberry pi 3 Model B WiFi MAC address keeps changing It involves adding a config file /etc/NetworkManager/conf.d/100-disable-wifi-mac-randomization.conf that disables randomized MAC addresses.

System information:

OS: openhabian (openhabian-pi-raspios32-202110080655-gitaa64c8a-crcaef28b5e.img.xz) hardware: RPi 4B 4GB