Geordon
Posts: 27
Joined: Fri Dec 27, 2013 6:29 am

WLAN MAC address changes at every reboot?

Sun Apr 07, 2019 8:00 am

I am in the US and have Xfinity as my Internet provider. They have the rented routers set up so that you can do some basic LAN and usage monitoring on their website, where you can see the devices connected to the WiFi router.

This evening, I discovered that my brand new RPi 3 B+ keeps changing the MAC address that the router sees every time it reboots. Some examples of the addresses that have shown tonight are:
26FAC023F266
323B93DE1451
AAF284033D5D
5A779C7B38A5
2A61D54909F0

This also causes a new IP address to be assigned via DHCP, so my ssh keys are getting screwed up every time I reboot the Pi.

I have updated and upgraded all of the installed software on the Pi.

Two questions:
  • What is causing this?
  • How can I either force a consistent MAC address or hard code an IP address for the wlan0 interface?
This is a crazy thing and it shouldn't be doing what it's doing, but I don't know where to start looking to figure this out. I would have thought that the MAC address was hard-coded into the wlan hardware...

User avatar
B.Goode
Posts: 10086
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: WLAN MAC address changes at every reboot?

Sun Apr 07, 2019 8:12 am

What Operating System is running on your RPi 3b+?

What additional software have you installed?

(Your expectation is correct: the wlan Mac address should be 'hardwired' and derived from the system hardware serial number. The Mac addresses you are seeing are not from the range assigned to Raspberry Pi Foundation/Trading. Something else 'odd' is going on.)

Are you in a position to put a completely standard unmodified release of Raspbian Stretch on a new/spare microSD card and check its behaviour?

User avatar
DougieLawson
Posts: 38763
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: WLAN MAC address changes at every reboot?

Sun Apr 07, 2019 10:32 am

I've got a 3B that does this. It's got a static IP assigned by my router but the MAC changes at every boot and it gets a DHCP pool address.

I've not had enough time to find whether it's a firmware bug or a Raspbian bug.

It runs my ADS-B receiver so it's going to be a pain to build a new SDCard - so at the moment that's on hold until Raspbian Buster emerges from its cocoon some time in the next few months. That Raspberry will be the first on Buster.

It works ok and it does the FlightAware job ok as it is so I'm applying the "if it ain't broke" rule.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Geordon
Posts: 27
Joined: Fri Dec 27, 2013 6:29 am

Re: WLAN MAC address changes at every reboot?

Sun Apr 07, 2019 2:44 pm

DougieLawson wrote: I've got a 3B that does this. It's got a static IP assigned by my router but the MAC changes at every boot and it gets a DHCP pool address.

I've not had enough time to find whether it's a firmware bug or a Raspbian bug.

[...]

It works ok and it does the FlightAware job ok as it is so I'm applying the "if it ain't broke" rule.
It's driving me batty. However, after I burned the SD card with Stretch (again) it seems to be holding the MAC address fine. Is there somewhere on the Pi that I can manually set the IP address snd still get everything else via DHCP?

I'm glad to know its not just me experiencing this weirdness.

Andyroo

Re: WLAN MAC address changes at every reboot?

Sun Apr 07, 2019 2:52 pm

You can set a static IP in /etc/dhcpcd.conf

Mine has:

Code: Select all

interface wlan0
    static ip_address=192.168.1.2/24
    static routers=192.168.1.254
For my WiFi link but you can do the same for eth0 if you want.

Geordon
Posts: 27
Joined: Fri Dec 27, 2013 6:29 am

Re: WLAN MAC address changes at every reboot?

Sun Apr 07, 2019 8:25 pm

Andyroo wrote:
Sun Apr 07, 2019 2:52 pm
You can set a static IP in /etc/dhcpcd.conf
I'm slightly confused. In order to get something similar, I had to install udhcpd, which seems to be a full DHCP server implementation. My Xfinity router is my local DHCP service provider, and I want it to stay that way.

Is there a package that I should be looking for to install that file, or do I just need to manually create it as you showed and that will be enough to get the job done to force the specified IP address?

Geordon
Posts: 27
Joined: Fri Dec 27, 2013 6:29 am

Re: WLAN MAC address changes at every reboot?

Sun Apr 07, 2019 9:04 pm

Ok, I was able to force the WiFi address, but the MAC is still flipping all over the place with reboots, which is playing havoc with the router's device table. I plugged the Pi in via Ethernet and was able to use the network preferences tool to configure the address.

This is definitely an annoying issue. Is there somewhere I can submit a bug report or something?

mattmiller
Posts: 2230
Joined: Thu Feb 05, 2015 11:25 pm

Re: WLAN MAC address changes at every reboot?

Sun Apr 07, 2019 9:26 pm

JFI I just tried rebooting my Pi3B+ to see what happens and its kept its MAC address of b8:27:eb:7f:21:68 so it doesn't happen to them all

glum
Posts: 26
Joined: Wed May 16, 2018 11:27 am

Re: WLAN MAC address changes at every reboot?

Sun Apr 07, 2019 10:17 pm

In order to get something similar, I had to install udhcpd
`dhcpcd` is the default dhcp client in Raspbian. You don't need to install anything.

Geordon
Posts: 27
Joined: Fri Dec 27, 2013 6:29 am

Re: WLAN MAC address changes at every reboot?

Sun Apr 07, 2019 10:25 pm

Aurgh! I just rebooted my Pi again (while it was still plugged into Ethernet) and BOTH of the interfaces changed MAC addresses!

User avatar
NGC6543
Posts: 81
Joined: Thu Feb 28, 2019 7:30 pm
Location: Lancashire, UK

Re: WLAN MAC address changes at every reboot?

Sun Apr 07, 2019 11:37 pm

Assuming (dangerous, I know) that the (seemingly top secret) LAN7515 is similar to the LAN7500, the MAC address is either stored in an external EEPROM or is configured by the driver. I cannot see an EEPROM anywhere near the LAN7515, so in the absence of any other clues must assume it's done by the driver.

Edit to add: Just realised we're mainly talking about WLAN. The below still applies.

Now, that should be done by some algorithm that doesn't change. It's simply wrong that it can do so without external influence. Anyway...

External influence... if the driver supports the standard ifconfig command to change MAC address, perhaps putting it in a startup script would do the trick.

Code: Select all

ifconfig eth0 hw ether MAC-ADDRESS
Maybe worth a try. I'm not running it my 3B+, because it's working properly and I don't want to scupper it :lol:

The other possibility of course is that the LAN7515 holds the MAC address internally in which case, if no software is deliberately changing the MAC, something is broken.

User avatar
rpdom
Posts: 16964
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: WLAN MAC address changes at every reboot?

Mon Apr 08, 2019 5:37 am

NGC6543 wrote:
Sun Apr 07, 2019 11:37 pm
The other possibility of course is that the LAN7515 holds the MAC address internally in which case, if no software is deliberately changing the MAC, something is broken.
The Ethernet MAC is set by the driver and based on the Pi's serial number.

The built-in WiFi MAC is set the same way, but the bottom 48 bits are xored with 0x555555 to make it different to the Ethernet MAC.
Unreadable squiggle

andrum99
Posts: 1177
Joined: Fri Jul 20, 2012 2:41 pm

Re: WLAN MAC address changes at every reboot?

Mon Apr 08, 2019 7:31 am

rpdom wrote:
Mon Apr 08, 2019 5:37 am
NGC6543 wrote:
Sun Apr 07, 2019 11:37 pm
The other possibility of course is that the LAN7515 holds the MAC address internally in which case, if no software is deliberately changing the MAC, something is broken.
The Ethernet MAC is set by the driver and based on the Pi's serial number.

The built-in WiFi MAC is set the same way, but the bottom 48 bits are xored with 0x555555 to make it different to the Ethernet MAC.
Just had a quick look at the driver for the LAN7515, and if I've read it correctly it attempts to get a MAC address from Device Tree, then EEPROM, then OTP, then falls back to generating a random MAC address. How does the serial number get passed to the driver to calculate the MAC address? Is the OTP referenced in the driver One Time Programmable memory, or something else?

incognitum
Posts: 472
Joined: Tue Oct 30, 2018 3:34 pm

Re: WLAN MAC address changes at every reboot?

Mon Apr 08, 2019 11:21 am

rpdom wrote:
Mon Apr 08, 2019 5:37 am
The Ethernet MAC is set by the driver and based on the Pi's serial number.

The built-in WiFi MAC is set the same way, but the bottom 48 bits are xored with 0x555555 to make it different to the Ethernet MAC.
While the values are both derived from serial, I recall they are SET in different ways though.

The wifi chip has its own OTP.
Unlike Ethernet, in which case the Pi's firmware calculates desired MAC and passes it to Linux through device-tree, so driver can set it.
Geordon wrote:
Sun Apr 07, 2019 10:25 pm
Aurgh! I just rebooted my Pi again (while it was still plugged into Ethernet) and BOTH of the interfaces changed MAC addresses!
Are you sure that both wifi and LAN are changing?
Are you running something different than Raspbian?

User avatar
RaTTuS
Posts: 10554
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: WLAN MAC address changes at every reboot?

Mon Apr 08, 2019 12:31 pm

Code: Select all

cat /etc/debian_version ; uname -v ; ip link show
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

Guff666
Posts: 6
Joined: Thu Feb 23, 2017 6:24 pm

Re: WLAN MAC address changes at every reboot?

Sun Nov 03, 2019 11:55 am

Has there been any update on this issue?

I've recently rebuilt a Pi 3B+ that was previously working fine. It's running stock stretch with all updates applied and with no additions at the moment and is suffering exactly the same behaviour.

Everything starts as expected:

Code: Select all

Nov  3 10:15:33 docker4 systemd[1]: Starting dhcpcd on all interfaces...
Nov  3 10:15:33 docker4 dhcpcd[287]: dev: loaded udev
Nov  3 10:15:33 docker4 dhcpcd[287]: wlan0: starting wpa_supplicant
Nov  3 10:15:33 docker4 dhcpcd-run-hooks[352]: wlan0: starting wpa_supplicant
Nov  3 10:15:33 docker4 dhcpcd[287]: eth0: waiting for carrier
Nov  3 10:15:33 docker4 dhcpcd[287]: wlan0: waiting for carrier
Nov  3 10:15:33 docker4 dhcpcd[287]: wlan0: carrier acquired
Nov  3 10:15:33 docker4 dhcpcd[287]: DUID 00:01:00:01:24:3d:de:25:b8:27:eb:a6:09:03
Nov  3 10:15:33 docker4 dhcpcd[287]: wlan0: IAID eb:a6:09:03
Nov  3 10:15:33 docker4 dhcpcd[287]: wlan0: adding address fe80::c564:f0e5:bab8:c32
Nov  3 10:15:33 docker4 dhcpcd[287]: wlan0: carrier lost
Nov  3 10:15:33 docker4 dhcpcd[287]: wlan0: deleting address fe80::c564:f0e5:bab8:c32
Nov  3 10:15:36 docker4 dhcpcd[287]: wlan0: carrier acquired
Nov  3 10:15:36 docker4 dhcpcd[287]: wlan0: IAID eb:a6:09:03
Nov  3 10:15:36 docker4 dhcpcd[287]: wlan0: adding address fe80::ed76:8f08:b2b2:4fae
Nov  3 10:15:37 docker4 dhcpcd[287]: wlan0: rebinding lease of 172.29.12.3
Nov  3 10:15:37 docker4 dhcpcd[287]: wlan0: probing address 172.29.12.3/24
Nov  3 10:15:37 docker4 dhcpcd[287]: wlan0: soliciting an IPv6 router
Nov  3 10:15:41 docker4 dhcpcd[287]: wlan0: leased 172.29.12.3 for 300 seconds
Nov  3 10:15:41 docker4 dhcpcd[287]: wlan0: adding route to 172.29.12.0/24
Nov  3 10:15:41 docker4 dhcpcd[287]: wlan0: adding default route via 172.29.12.1
Nov  3 10:15:41 docker4 dhcpcd[287]: forked to background, child pid 518
Nov  3 10:15:41 docker4 systemd[1]: Started dhcpcd on all interfaces.
Nov  3 10:15:50 docker4 dhcpcd[518]: wlan0: no IPv6 Routers available
The .3 address is statically allocated by my Unifi USG.
However, 10 mins later:

Code: Select all

Nov  3 10:25:47 docker4 dhcpcd[518]: wlan0: deleted route to 172.29.12.0/24
Nov  3 10:25:47 docker4 dhcpcd[518]: wlan0: deleted IP address 172.29.12.3/24
Nov  3 10:25:47 docker4 dhcpcd[518]: wlan0: deleting default route via 172.29.12.1
Nov  3 10:25:48 docker4 dhcpcd[518]: wlan0: carrier lost
Nov  3 10:25:48 docker4 dhcpcd[518]: wlan0: new hardware address: c2:b9:b1:9a:c2:90
Nov  3 10:25:50 docker4 dhcpcd[518]: wlan0: carrier acquired
Nov  3 10:25:50 docker4 dhcpcd[518]: wlan0: IAID b1:9a:c2:90
Nov  3 10:25:50 docker4 dhcpcd[518]: wlan0: adding address fe80::7d43:ac48:3ac3:75a9
Nov  3 10:25:50 docker4 dhcpcd[518]: wlan0: carrier lost
Nov  3 10:25:50 docker4 dhcpcd[518]: wlan0: deleting address fe80::7d43:ac48:3ac3:75a9
Nov  3 10:25:50 docker4 dhcpcd[518]: wlan0: carrier acquired
Nov  3 10:25:50 docker4 dhcpcd[518]: wlan0: IAID b1:9a:c2:90
Nov  3 10:25:50 docker4 dhcpcd[518]: wlan0: adding address fe80::7d43:ac48:3ac3:75a9
Nov  3 10:25:50 docker4 dhcpcd[518]: wlan0: rebinding lease of 172.29.12.3
Nov  3 10:25:51 docker4 dhcpcd[518]: wlan0: NAK: address not available from 172.29.12.1
Nov  3 10:25:51 docker4 dhcpcd[518]: wlan0: message: address not available
Nov  3 10:25:51 docker4 dhcpcd[518]: wlan0: soliciting a DHCP lease
Nov  3 10:25:51 docker4 dhcpcd[518]: wlan0: soliciting an IPv6 router
Nov  3 10:25:54 docker4 dhcpcd[518]: wlan0: offered 172.29.12.137 from 172.29.12.1
Nov  3 10:25:54 docker4 dhcpcd[518]: wlan0: probing address 172.29.12.137/24
Nov  3 10:25:59 docker4 dhcpcd[518]: wlan0: leased 172.29.12.137 for 300 seconds
Nov  3 10:25:59 docker4 dhcpcd[518]: wlan0: adding route to 172.29.12.0/24
As you can see, at 10:25:48, carrier is lost and a new hardware address allocated: which precipitates a change of IP address.

Subsequent reboots result in similar behaviour. The hardware address changes each time the system reboots and thereafter changes at random intervals. This is the result of `sudo grep dhcp /var/log/daemon | less`

Code: Select all

Nov  3 11:49:05 docker4 systemd[1]: Starting dhcpcd on all interfaces...
Nov  3 11:49:05 docker4 dhcpcd[384]: dev: loaded udev
Nov  3 11:49:05 docker4 dhcpcd[384]: wlan0: starting wpa_supplicant
Nov  3 11:49:05 docker4 dhcpcd-run-hooks[445]: wlan0: starting wpa_supplicant
Nov  3 11:49:05 docker4 dhcpcd[384]: eth0: waiting for carrier
Nov  3 11:49:05 docker4 dhcpcd[384]: wlan0: waiting for carrier
Nov  3 11:49:05 docker4 dhcpcd[384]: wlan0: carrier acquired
Nov  3 11:49:05 docker4 dhcpcd[384]: DUID 00:01:00:01:24:3d:de:25:b8:27:eb:a6:09:03
Nov  3 11:49:05 docker4 dhcpcd[384]: wlan0: IAID eb:a6:09:03
Nov  3 11:49:05 docker4 dhcpcd[384]: wlan0: adding address fe80::c564:f0e5:bab8:c32
Nov  3 11:49:05 docker4 dhcpcd[384]: wlan0: carrier lost
Nov  3 11:49:05 docker4 dhcpcd[384]: wlan0: deleting address fe80::c564:f0e5:bab8:c32
Nov  3 11:49:07 docker4 dhcpcd[384]: wlan0: new hardware address: c6:db:7e:ff:79:b0
Nov  3 11:49:12 docker4 dhcpcd[384]: wlan0: carrier acquired
Nov  3 11:49:12 docker4 dhcpcd[384]: wlan0: IAID 7e:ff:79:b0
Nov  3 11:49:12 docker4 dhcpcd[384]: wlan0: adding address fe80::e53e:9146:3af:509b
Nov  3 11:49:12 docker4 dhcpcd[384]: wlan0: carrier lost
Nov  3 11:49:12 docker4 dhcpcd[384]: wlan0: deleting address fe80::e53e:9146:3af:509b
Nov  3 11:49:12 docker4 dhcpcd[384]: wlan0: carrier acquired
Nov  3 11:49:12 docker4 dhcpcd[384]: wlan0: IAID 7e:ff:79:b0
Nov  3 11:49:12 docker4 dhcpcd[384]: wlan0: rebinding lease of 172.29.12.137
Nov  3 11:49:12 docker4 dhcpcd[384]: wlan0: NAK: address in use from 172.29.12.1
Nov  3 11:49:12 docker4 dhcpcd[384]: wlan0: message: address in use
Nov  3 11:49:12 docker4 dhcpcd[384]: wlan0: soliciting an IPv6 router
Nov  3 11:49:12 docker4 dhcpcd[384]: wlan0: soliciting a DHCP lease
Nov  3 11:49:16 docker4 dhcpcd[384]: wlan0: offered 172.29.12.162 from 172.29.12.1
Nov  3 11:49:16 docker4 dhcpcd[384]: wlan0: probing address 172.29.12.162/24
Nov  3 11:49:17 docker4 dhcpcd[384]: wlan0: carrier lost
Nov  3 11:49:17 docker4 dhcpcd[384]: wlan0: carrier acquired
Nov  3 11:49:17 docker4 dhcpcd[384]: wlan0: IAID 7e:ff:79:b0
Nov  3 11:49:17 docker4 dhcpcd[384]: wlan0: adding address fe80::e53e:9146:3af:509b
Nov  3 11:49:17 docker4 dhcpcd[384]: wlan0: carrier lost
Nov  3 11:49:17 docker4 dhcpcd[384]: wlan0: deleting address fe80::e53e:9146:3af:509b
Nov  3 11:49:17 docker4 dhcpcd[384]: wlan0: carrier acquired
Nov  3 11:49:17 docker4 dhcpcd[384]: wlan0: IAID 7e:ff:79:b0
Nov  3 11:49:17 docker4 dhcpcd[384]: wlan0: adding address fe80::e53e:9146:3af:509b
Nov  3 11:49:17 docker4 dhcpcd[384]: wlan0: soliciting a DHCP lease
Nov  3 11:49:17 docker4 dhcpcd[384]: wlan0: offered 172.29.12.162 from 172.29.12.1
Nov  3 11:49:17 docker4 dhcpcd[384]: wlan0: soliciting an IPv6 router
Nov  3 11:49:17 docker4 dhcpcd[384]: wlan0: probing address 172.29.12.162/24
Nov  3 11:49:23 docker4 dhcpcd[384]: wlan0: leased 172.29.12.162 for 300 seconds
Nov  3 11:49:23 docker4 dhcpcd[384]: wlan0: adding route to 172.29.12.0/24
Nov  3 11:49:23 docker4 dhcpcd[384]: wlan0: adding default route via 172.29.12.1
Nov  3 11:49:23 docker4 dhcpcd[384]: forked to background, child pid 593
The system was previously running jessie, so I might try re-flashing with jessie to see if the behaviour is restricted to stretch.

User avatar
B.Goode
Posts: 10086
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: WLAN MAC address changes at every reboot?

Sun Nov 03, 2019 12:34 pm

The system was previously running jessie, so I might try re-flashing with jessie to see if the behaviour is restricted to stretch.

The last time I recall this being discussed it was traced to HASSIO being installed on top of Raspbian, and Hassio in turn installs Network Manager which was thought to be the cause of the non-standard behaviour.

So although you are starting with a 'stock' OS, have you added anything?


And if you have got to reinstall the Raspbian Operating System, why not move forward to the Raspbian Buster release which has been the recommended and supported version for over 4 months?

How, if at all, does Docker feature in your configuration?

jj_0
Posts: 113
Joined: Wed Jul 11, 2012 7:07 am

Re: WLAN MAC address changes at every reboot?

Sun Nov 03, 2019 12:46 pm

For reference, see here for the fix for NetworkManager, in case you have that installed.

Guff666
Posts: 6
Joined: Thu Feb 23, 2017 6:24 pm

Re: WLAN MAC address changes at every reboot?

Sun Nov 03, 2019 3:56 pm

The last time I recall this being discussed it was traced to HASSIO being installed on top of Raspbian, and Hassio in turn installs Network Manager which was thought to be the cause of the non-standard behaviour.
Now that is interesting. Previously, this node was running hassos/hassio. The reason for the rebuild is to be able to run hassio_supervisor etc on top of docker on raspbian, rather than on top of hassos. I need this as I want to add a UPS hat and hassos has no drivers for it. Also, I am used to docker commands rather than the abbreviated hassos set. However, despite the coincidence, the node is running just the basic raspbian with no additions yet. Your caution does give me a concern though. I'll try to find previous threads on this issue.

As an aside, I'm pursuing this problem because whenever i tried to do a `docker pull`, it failed with "Could not reach any registry servers". I tracked this down to being due to unsymmetrical routes on the USG because of the frequent IP address changes. I then rebuilt with pure stretch and the problem persisted.

In the end I deferred the downgrade to jessie (I couldn't find an IMG that would boot) in favour of reinstalling stretch and removing the static address allocation on the USG. NB: I stayed with stretch because buster wasn't fully supported for home assistant last time I checked.

Clearing the static allocation seems to have cured the problem. The node seems to be stable now (30 mins).

NB: I have now checked again and hassio etc seem to be supported, so I'll have a go with buster.

bls
Posts: 585
Joined: Mon Oct 22, 2018 11:25 pm
Location: Seattle, WA
Contact: Twitter

Re: WLAN MAC address changes at every reboot?

Thu Nov 14, 2019 8:55 pm

I was curious to see how KDE performed on the Pi4, so I installed it. Each time I rebooted the Pi, the MAC address changed. When I rebooted with a non-KDE system, the MAC address reverted to the one on the system.

It would be interesting to know if anyone seeing a changing MAC address is using KDE or some other heavyweight windowing system that apparently mucks where it shouuld't be mucking (IMHO).
Super-useful tools:
RPi SD Card Manager: https://github.com/gitbls/sdm
Lightweight Virtual VNC Config: https://github.com/gitbls/RPiVNCHowTo
Easy-Peasy VPN installer/manager: https://github.com/gitbls/pistrong

Guff666
Posts: 6
Joined: Thu Feb 23, 2017 6:24 pm

Re: WLAN MAC address changes at every reboot?

Fri Nov 15, 2019 9:53 am

I got to the bottom of the problem. My installation, (and I think, buster by default) had network-manager installed. Network-manager gets the IP address instead of dhcpcd and network-manager can be set to randomise the MAC address when it boots. This is a security “feature”, but it obviously screws with statically-allocated IP addresses.
The documentation is confusing about how to stop this behaviour (it’s not supposed to be the default anyway). My solution was to simply remove network-manager.

svs.smol
Posts: 2
Joined: Sat Nov 16, 2019 10:06 pm

Re: WLAN MAC address changes at every reboot?

Sat Nov 16, 2019 10:40 pm

If Network-manager is installed.
To disable the MAC address randomization create the file:

Code: Select all

/etc/NetworkManager/conf.d/100-disable-wifi-mac-randomization.conf
And add:

Code: Select all

[connection]
wifi.mac-address-randomization=1
[device]
wifi.scan-rand-mac-address=no

AskePetter
Posts: 3
Joined: Sun May 14, 2017 1:17 pm

Re: WLAN MAC address changes at every reboot?

Wed Mar 11, 2020 3:11 pm

If Network-manager is installed.
To disable the MAC address randomization create the file:

Code: Select all

/etc/NetworkManager/conf.d/100-disable-wifi-mac-randomization.conf

And add:

Code: Select all

[connection]
wifi.mac-address-randomization=1
[device]
wifi.scan-rand-mac-address=no
The method described above solved my problems. I was on a Pi 4 Running Hassio on top of Docker, on top of Raspbian Buster, and I saw the same whirlwind of MAC addresses but this seems to have cured it! Big thanks to user sms.smol! :D

ob2s
Posts: 3
Joined: Thu Mar 12, 2020 4:11 pm

Re: WLAN MAC address changes at every reboot?

Fri Mar 13, 2020 2:54 am

AskePetter wrote:
Wed Mar 11, 2020 3:11 pm
The method described above solved my problems. I was on a Pi 4 Running Hassio on top of Docker, on top of Raspbian Buster, and I saw the same whirlwind of MAC addresses but this seems to have cured it! Big thanks to user sms.smol! :D
I tried this, rebooted my router and the pi, but the allocations persist. I guess I can live with 5 less dhcp addresses, but it IS annoying.
Thanks

panec
Posts: 1
Joined: Sun Mar 15, 2020 9:18 pm

Re: WLAN MAC address changes at every reboot?

Sun Mar 15, 2020 9:21 pm

In my case this helped:
Network-Manager will reset your mac address during the wifi scanning.

To permanently change your mac address:

Edit your /etc/NetworkManager/NetworkManager.conf as follows:

[device]
wifi.scan-rand-mac-address=no
Reboot and verify your settings.

Got from https://community.home-assistant.io/t/t ... 38?u=panec

Return to “Troubleshooting”