Skip to content
This repository has been archived by the owner on Jan 6, 2022. It is now read-only.

Randomizing MAC post initial setup #109

Open
alecStewart1 opened this issue Sep 17, 2018 · 1 comment
Open

Randomizing MAC post initial setup #109

alecStewart1 opened this issue Sep 17, 2018 · 1 comment

Comments

@alecStewart1
Copy link

alecStewart1 commented Sep 17, 2018

nordnm version: 0.5.5

system: Linux void 4.18.8_1 #1 SMP PREEMPT Sun Sep 16 04:42:29 UTC 2018 x86_64 GNU/Linux

DNS service: dnsmasq

Hello, so I've having some issues in regards to having my MAC address randomized upon making a connection. I have alright setup my auto-connection with nordnm sync -uka blah blah blah, but after this running nordnm mac --random will always output two things; the first being irrelavent to this issue

[ERROR] [nordnm.utils]: Could not check PyPi for latest version.

And the second

[ERROR] [nordnm.networkmanager]: Could not save MAC address configuration to '/usr/lib/NetworkManager/conf.d/nordnm_mac.conf'

Ok, no problem. Probably because the network interface is busy. So let's just try stopping dnsmasq and NetworkManager and changing the MAC myself with macchanger.

> sv stop dnsmasq && sv stop NetworkManager
ok: down: dnsmasq: 0s, normally up
ok: down: NetworkManager: 0s, normally up
> sudo macchanger -r -b my_interface
Current MAC:   ac:2b:6e:8e:61:dd (unknown)
Permanent MAC: ac:2b:6e:8e:61:dd (unknown)
[ERROR] Could not change MAC: interface up or insufficient permissions: Device or resource busy

Hmm that's weird, let me try seeing if anything is doing something with the interface.

> ps aux | rg my_interface
root      2842  0.0  0.0  10172  4104 ?        S    10:18   0:00 /usr/bin/dhclient -d -q -sf /usr/libexec/nm-dhcp-helper -pf /var/run/dhclient-my_interface.pid -lf /var/lib/NetworkManager/dhclient-d1693009-b4cf-4c95-97c4-795542ca4600-my_interface.lease -cf /var/lib/NetworkManager/dhclient-my_interface.conf my_interface
bigdaddy  6427  0.0  0.0  24716  6588 pts/2    S+   10:34   0:00 rg my_interface

Hmmm, why is dhclient running? I don't use that or dhcpcd. Let me just kill it and try again.

> sudo pkill dhclient

> ps aux | rg wlo1
bigdaddy  6499  0.0  0.0  24716  6788 pts/2    S+   10:36   0:00 rg my_interface
> sudo macchanger -r -b my_interface
Current MAC:   ac:2b:6e:8e:61:dd (unknown)
Permanent MAC: ac:2b:6e:8e:61:dd (unknown)
[ERROR] Could not change MAC: interface up or insufficient permissions: Device or resource busy

Alright well that's annoying. Normally, before I used this tool, all I did was run sudo sv stop dnsmasq && sudo sv stop NetworkManger ; sudo macchanger -r -b wlo1 ; sudo sv start dnsmasq && sudo sv start NetworkManager and that worked fine, and then I'd connect to a server.

So this tool is running some other process that's keeping my network interface busy. I'm no expert by any means at all, but my only other guess might be the dbus-daemon.

So until I know what else is interacting with my network interface, I can't randomize my MAC address.

@chadsr
Copy link
Owner

chadsr commented Sep 19, 2018

Huh, that is indeed strange.

Nordnm does all operations through NetworkManager, so no new processes (except for ping during benchmarking) are ever spawned directly. Since restarting NetworkManager does not solve this, I am a little perplexed.

When the tool changes MAC addresses, it is simply leaving a config file at /usr/lib/NetworkManager/conf.d/nordnm_mac.conf following steps such as these. This appears to have been unsuccessful in your case. Could you maybe see if this directory does indeed exist and if so, what its permissions and contents are?

My best guess right now is that NetworkManager and macchanger are in conflict somehow somewhere along the lines of this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants