You are not logged in.

#1 2016-06-16 17:23:26

maymay
Member
Registered: 2016-06-16
Posts: 5

[SOLVED] spoofed MAC reverts to original (NetworkManager)

I'm having a problem on connecting to networks with spoofed MAC address.

First, when I was using Fedora 23, connecting to a network with a spoofed MAC worked perfectly. I could confirm it with "ip link"

And then I installed arch linux with KDE Plasma which uses NetworkManager 1.2.2-1 to deal with network connections.
In arch linux, I'm able to change the MAC address using any methods incluing macchanger, "ip link set..." or adding "MACAddressPolicy=random" to systemd .link file. Changing the address itself is not a problem.
But when I connect to any network, using plasma-nm gui, it does connect but with the original MAC address, not the spoofed one.
It seems that NM automatically 'set MAC address' to its original when it connects and 'resets' when it disconnects. Here's from journalctl | grep MAC:

fbi NetworkManager[1024]: <info>  [1460000000.7700] device (wlp2s0): set MAC address to xx:xx:xx:xx:xx:xx <- hardware original MAC addr.
fbi NetworkManager[1024]: <info>  [1460000001.0714] device (wlp2s0): reset MAC address to 00:12:34:56:78:90 <- manually spoofed MAC addr.

What I tried: I edited NetworkManager.conf to add

[connection.no-cloned]
ethernet.cloned-mac-address=leave
wifi.cloned-mac-address=leave

But this doesn't change anything. Moving it under [connection] doesn't work neither. I deleted network profiles and rebooted everytime I tried something, to make sure they are effective.
What can I do to NM not to set the MAC address to its original? Is NM the problem? or KDE Plasma?



Maybe relevent:
1. Using "cloned MAC address" function in NM works fine but its not my purpose.
2. I added "wifi.mac-address-randomization=2" in NetworkManager.conf at [connection] section to randomize my MAC address, and this makes NM can't even connect to any network. journalctl says:

fbi NetworkManager[938]: <error> [1460000000.9586] device (wlp2s0): Activation: (wifi) couldn't build wireless configuration: 802-11-wireless: cannot enable mac-randomization due to missing supplicant support
fbi NetworkManager[938]: <info>  [1460000000.9586] device (wlp2s0): state change: config -> failed (reason 'supplicant-config-failed') [50 120 9]
fbi NetworkManager[938]: <info>  [1460000000.9600] manager: NetworkManager state is now DISCONNECTED
fbi NetworkManager[938]: <warn>  [1460000000.9605] device (wlp2s0): Activation: failed for connection 'James_5627'
fbi NetworkManager[938]: <info>  [1460000000.9630] device (wlp2s0): state change: failed -> disconnected (reason 'none') [120 30 0]

But my wpa_supplicant is version 2.5 which I think supports mac randomization. I don't know why these happen on arch linux.

Last edited by maymay (2016-09-14 13:07:31)

Offline

#2 2016-06-25 07:21:56

maymay
Member
Registered: 2016-06-16
Posts: 5

Re: [SOLVED] spoofed MAC reverts to original (NetworkManager)

Downgrading NetworkManager from 1.2.2 to 1.0.8 "fixed" this problem. Plasma/KDE was not the culprit.
I noticed it by Fedora 24 showing the same symptom. (F24 has NM 1.2)

Now the question has been narrowed: How can I change the behavior of NM 1.2 that always sets MAC address to the original one? Which config file?

Offline

#3 2016-06-27 10:14:09

Abaddon
Member
From: Poland
Registered: 2004-05-03
Posts: 249

Re: [SOLVED] spoofed MAC reverts to original (NetworkManager)

Some time ago I researched this issue and from what I found it seems that this is how Networkmanager works. I found no real solution, only workarounds like https://forums.kali.org/showthread.php? … ch-boot-up

I think that it makes sense to create a bug report for Networkmanager project.

Last edited by Abaddon (2016-06-27 10:15:01)


Gnome - The weakest link!
Linux, *not* GNU/Linux!

Offline

#4 2016-07-03 12:29:47

maymay
Member
Registered: 2016-06-16
Posts: 5

Re: [SOLVED] spoofed MAC reverts to original (NetworkManager)

I found that some people are also experiencing same/similar thing.

https://bugzilla.gnome.org/show_bug.cgi?id=708820

It seems that the bugfix has been merged to NM. So when NM package in arch linux repository updates with this bugfix, I'll post in this thread if it solves the problem.

Offline

#5 2016-09-14 13:03:19

maymay
Member
Registered: 2016-06-16
Posts: 5

Re: [SOLVED] spoofed MAC reverts to original (NetworkManager)

NM 1.4 fixed this problem by introducing "cloned-mac-address" variables.

NetworkManager.conf I'm using now:

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

Using this config works well as intended. (I use a systemd service to change the ethernet MAC)
Actually It had some bugs with plasma-nm but it also got fixed with an update about a week ago.

Solved.

Offline

Board footer

Powered by FluxBB