MAC adress not changing automatically

I have this config:

[device]
wifi.scan-rand-mac-address=yes

[connection]
wifi.cloned-mac-address=random
ethernet.cloned-mac-address=random

Inside all those files:

  • /etc/NetworkManager/conf.d/00-macrandomize.conf
  • /etc/NetworkManager/conf.d/wifi_rand_mac.conf
  • /etc/NetworkManager/NetworkManager.conf

I use Fedora 41 Workstation (stable version).

I restart my OS multiple times. My MAC adress is not changing everytime I re-connect to Wi-Fi.

I check the MAC values from my router web user interface.

What do you see listed for 802-11-wireless.cloned-mac-address and 802-11-wireless.mac-address-randomization when you run nmcli connection show ssid (replacing ssid with the network SSID you are using and using quotes if there are any spaces)?

If the former is set to permanent, you can set it random by running nmcli connection modify ssid wifi.cloned-mac-address random.

If the latter is set to never, you can set it to always by running nmcli connection modify ssid wifi wifi.mac-address-randomization always.

I see those:

802-11-wireless.cloned-mac-address: –

802-11-wireless.mac-address-randomization:default




NOTE-1:

The system is fresh installed. I did nothing as config to OS yet.

NOTE-2:

sudo ls -a /etc/NetworkManager/conf.d

Output:

00-macrandomize.conf
wifi_rand_mac.conf

Note that the gnome settings panel for wifi has this

There are several options and I believe the default is the highlighted one at the bottom. Stable per SSID

With that it generates a random MAC the first time it connects to a particular new SSID, then always uses that same one for that same SSID.

The ā€˜Permanent’ option uses the hardware defined MAC
The ā€˜Random’ option generates a new random MAC every time it connects, even to the same SSID.
ā€˜Stable’ generates a random MAC then uses that same MAC for every connection, even to new SSIDs.
I am unsure of what the ā€˜Preserve’ does.

1 Like

It looks like preserve uses whatever MAC address that had already been assigned to the interface by some other means or use the permanent address.

Source: NetworkManager Trackability Reduction - Wandering Computerer

1 Like

When I do this it works. But I have many many different connections. And I always change router info of connections. My general config should work for connections. Why it does not work ?

Thank you for info. :pray: But for now I want only ā€œrandomā€ which is not working on my OS. And I’m researching the reason.

If you have previously made a connection to an SSID with one of the other options selected then the previous config is saved and does not get changed.

Try the ā€˜forget connection’ option then disconnect and reconnect after making the choice for ā€˜random’ and it should now truly randomize each connection.

No I haven’t do any config for specific connection.

But the same problem exist for all connections by the way.

Can you provide some information on the wireless network adapter you are using? If you could provide information from the inxi -Fzxx command, specifically from the Network section?

Maybe just do something similar to what’s already there…
/etc/NetworkManager/conf.d/99-wifi-mac-addr.conf

[connection.99-wifi-mac-addr]
match-device=type:wifi
wifi.cloned-mac-address=random

/etc/NetworkManager/conf.d/99-ethernet-mac-addr.conf

[connection.99-ethernet-mac-addr]
match-device=type:ethernet
ethernet.cloned-mac-address=random
3 Likes

Otput is below (I change chip-id’s manually from output (becuase of privacy))

Network:
  Device-1: Intel Wireless 7265 driver: iwlwifi v: kernel pcie:
    speed: 2.5 GT/s lanes: 1 bus-ID: 04:00.0 chip-ID: 8888:2222
  IF: wlo1 state: up mac: <filter>
  Device-2: Realtek RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet
    vendor: Hewlett-Packard driver: r8169 v: kernel pcie: speed: 2.5 GT/s
    lanes: 1 port: 3000 bus-ID: 05:00.0 chip-ID: 11aa:1111
  IF: eno1 state: down mac: <filter>

@grumpey I don’t have those files:

  • /etc/NetworkManager/conf.d/99-wifi-mac-addr.conf
  • /etc/NetworkManager/conf.d/99-ethernet-mac-addr.conf

I have those (as I mention on my first post):

You would need that create them and remove the other files.

1 Like

Changing the chip IDs makes it impossible for us to check and verify the proper drivers are being used. Please show the full output as requested.

In fact, the chip ID has nothing to do with identifying information for an individual since many users may have the same chipset in their system. It has everything to do with identifying whether the system has loaded and is using the proper driver or to find out whether that chipset may be reported as having issues with linux.

When we ask for information, it is important that full information is provided in most cases. The inxi output, as requested already hides anything that would be a potential issue as you could see in the parts where it tells you something like this.

This is my network portion

Network:
  Device-1: Realtek RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet
    vendor: ASRock driver: r8169 v: kernel pcie: speed: 2.5 GT/s lanes: 1
    port: f000 bus-ID: 04:00.0 chip-ID: 10ec:8168
  IF: enp4s0 state: down mac: <filter>
  Device-2: Intel Wi-Fi 6E AX210/AX1675 2x2 [Typhoon Peak] driver: iwlwifi
    v: kernel pcie: speed: 5 GT/s lanes: 1 bus-ID: 05:00.0 chip-ID: 8086:2725
  IF: wlp5s0 state: up mac: <filter>
  IF-ID-1: virbr0 state: down mac: <filter>

Note the <filter> on both those devices where the MAC could be identifying for an attacker.

@computersavvy

inxi -Fzxx

output is:

Network:
Device-1: Intel Wireless 7265 driver: iwlwifi v: kernel pcie:
speed: 2.5 GT/s lanes: 1 bus-ID: 04:00.0 chip-ID: 8086:095a
IF: wlo1 state: up mac:
Device-2: Realtek RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet
vendor: Hewlett-Packard driver: r8169 v: kernel pcie: speed: 2.5 GT/s
lanes: 1 port: 3000 bus-ID: 05:00.0 chip-ID: 10ec:8168
IF: eno1 state: down mac:

I just want to ask if its important my hardware or driver-software info ? Because if I will apply ā€œrandomā€ for specific connection, it changes the MAC every-time.

@grumpey I did it . It worked. Thank you :hearts: :pray:

Can you tell me what happened here? I want to learn. Every source I read on internet, they say my configs should be enough.

By the way my configs were working on my device before. I just see randomly that it does not work after years.

I’m not sure what broke it, using match-device felt like a cleaner way to handle all connections and matched what :fedora: did for their implementation for wifi. /usr/lib/NetworkManager/conf.d/22-wifi-mac-addr.conf