alobbs / macchanger

GNU MAC Changer
http://www.gnu.org/software/macchanger
GNU General Public License v3.0
580 stars 112 forks source link

Network Manager messing with macchanger #22

Open c-gabri opened 8 years ago

c-gabri commented 8 years ago

Ubuntu 16.04, macchanger 1.7.0, Intel Centrino Wireless-N 2230 interface.

Changing MAC address of wireless interface works only if interface is shut down (ifconfig wlan0 down) or if Wi-Fi is disabled through Network Manager (nmcli radio wifi off). However, once the interface is brought up again (ifconfig wlan0 up and service network-manager restart) or Wi-Fi is re-enabled (nmcli radio wifi on), the MAC address defaults to the permanent one.

thoger commented 8 years ago

This is not a macchanger bug. macchanger sets MAC on some interface, and any other application can do so, and hence change settings originally applied using macchanger.

It seems NetworkManager tried to respect MAC address set by other applications, at least at some points. It also got some related changes upstream recently (days ago) to make it possible to configure it to preserve MAC already set on device, or generate a random MAC in NM (so you do not need to you macchanger any more).

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

smclt30p commented 8 years ago

God, I hate NetworkManager. I'ts just bad.

jerabaul29 commented 8 years ago

I have been working on some python wrappers to interact with NetworkManager through nmcli. This way you can do MAC spoofing while having NetworkManager taking care of your connections. It is a work in progress but maybe it can already help you. Participation in developing the code is welcome. I have little experience in coding so the code may look ugly to a programmer...

https://github.com/jerabaul29/randommac

asishadhikari commented 6 years ago

@smclt30p found solution yet?

conmat commented 6 years ago

AFAIK, there is no solution for any 16.04LTS 'buntu. I am using Ubuntu-MATE 16.04LTS with NetworkManager v1.2.6-0. This is the latest version of NetworkManager that will work with 16.04. Later versions of NetworkManager require dependencies that can not be met (libgnutls30 v3.5.0). I wish the Ubuntu Devs would fix this.