Re: NetworkManager reset MAC address



On Tuesday 31 of August 2010 12:26:05 mmsim6 gmail com wrote:
> I wrote a udev rule to change the MAC address of my wireless card and
> it worked correctly until I upgraded to
> NetworkManager-0.8.1-4.git20100817.fc13.x86_64
> today. Now I find the MAC is reset back to the original address by
> NetworkManager.
> How to stop this new feature?

The new NetworkManager has implemented MAC spoofing feature just for this 
purpose.
In connection editor,  on 'Wireless' tab there is a new edit box 'Cloned MAC 
address'. If you put your desired MAC here, it will be set on an interface 
when the connection is activated. And you don't need to change your MAC in 
udev or any other way.
See https://bugzilla.redhat.com/show_bug.cgi?id=447827

Unfortunately, there is still one glitch in wpa_supplicant that causes WPA 
connections don't work. I've sent a patch to hostap mailing list fixing that, 
but no reply yet.

As a ugly workaround for this WPA problem, you can do this:
1. Make sure you set new MAC to 'Cloned MAC address'
2. Leave your changing MAC script code as it is
3. And add after your MAC changing code this:

a) the command from Exec= line of /usr/share/dbus-1/system-
services/fi.epitest.hostap.WPASupplicant.service file
That is:
/usr/sbin/wpa_supplicant -c /etc/wpa_supplicant/wpa_supplicant.conf -B -u -f 
/var/log/wpa_supplicant.log -P /var/run/wpa_supplicant.pid    (for Fedora)

/sbin/wpa_supplicant -u -s    (for Ubuntu)
This will start wpa_supplicant. (and NetworkManger won't start it again)

b)
python -c 'import dbus; print 
dbus.SystemBus().call_blocking("fi.epitest.hostap.WPASupplicant", 
"/fi/epitest/hostap/WPASupplicant", "fi.epitest.hostap.WPASupplicant", 
"addInterface", "sa{sv}", ("wlan0", {"driver":"wext"}))'
This will add an interface to wpa_supplicant and that will read your changed 
MAC.
(That's the D-Bus call that NM makes internally.)

These steps has to be done *before* NetworkManager is started.

Jirka


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]