Re: NetworkManager reset MAC address



Thank you. I use knetworkmanger, so I don't see the new edit box.
Now I find the MAC reset feature have different effects on a pci card and a usb card. For the pci card in my T410, the changed mac by udev  won't be reset, but the mac of a usb card is always reset when plugin. Why there is a difference ?

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]