lwfinger / rtl8723au

Repo for RTL8723AU code before Linux Kernel commit
126 stars 46 forks source link

Cannot change a MAC address #69

Closed 7aitsev closed 6 years ago

7aitsev commented 6 years ago

Hi!

I've been using the WiFI driver for about a year and everything has been fine. Today I had tried to change a MAC address for wlan0 but didn't succeed.

So I have this lines in my /etc/modprobe.d/blacklist.conf:

blacklist rtl8xxxu
blacklist r8723au

To change MAC address, I execute this:

# /etc/rc.d/rc.networkmanager stop
Stopping NetworkManager: stopped
# ip link show dev wlan0
2: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
    link/ether --:--:--:--:--:-- brd ff:ff:ff:ff:ff:ff
# # ok, wlan0 is down, let's see dmesg
# dmesg # ..:..:..:..:..:.. - MAC of my router
...
[  968.646459] RTL8723AU: ERROR indicate disassoc
[  968.646482] RTL8723AU: ERROR set bssid:00:00:00:00:00:00
[  968.646522] RTL8723AU: ERROR set ssid [f2^M\xffffffb71X\xffffffa3Z%]^E^WX\xffffffe9^ԫ\xffffffb2\xffffffcdƛ\xffffffb4T^Q^N\xffffff82tA!=܇B?Y\xffffffa1\xffffff94^L\xffffff88\xffffff8e\xffffff80\xffffff89^K^R^B\xffffff88\xffffffff\xffffffff] fw_state=0x00000008
[  968.649580] RTL8723AU: ERROR sta recv deauth reason code(6) sta:..:..:..:..:..:..
[  968.663435] RTL8723AU: ERROR indicate disassoc
[  968.673252] RTL8723AU: ERROR set bssid:00:00:00:00:00:00
[  968.673284] RTL8723AU: ERROR set ssid [p\xffffffe9>\xffffffa1A\xffffffe1\xfffffffcg>^A~\xffffff97\xffffffea\xffffffdck\xffffff96\xffffff8f8\*\xffffffec\xffffffb0;\xfffffffb2\xffffffaf<T\xffffffec^X\xffffffdb\B?Y\xffffffa1\xffffff94^L\xffffff88\xffffff8e\xffffff80\xffffff89^K^R^B\xffffff88\xffffffff\xffffffff] fw_state=0x00000808
[  968.681673] RTL8723AU: ERROR indicate disassoc
[  972.220997] RTL8723AU: ERROR nolinked power save enter
#
#
# # spoof MAC
# ip link set dev wlan0 address XX:XX:XX:XX:XX:XX
# ip link show dev wlan0
2: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
    link/ether --:--:--:--:--:-- brd ff:ff:ff:ff:ff:ff
# # MAC has not changed, "dmesq | tail" shows nothing new
# rfkill list # maybe I should use rfkill to disable WiFi device
0: ideapad_wlan: Wireless LAN
    Soft blocked: no
    Hard blocked: no
1: ideapad_bluetooth: Bluetooth
    Soft blocked: yes
    Hard blocked: no
# rfkill block 0
# rfkill list
0: ideapad_wlan: Wireless LAN
    Soft blocked: yes
    Hard blocked: no
1: ideapad_bluetooth: Bluetooth
    Soft blocked: yes
    Hard blocked: no
# # "dmesg | tail" shows nothing new
# ip link set dev wlan0 address XX:XX:XX:XX:XX:XX && ip link show dev wlan0
2: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
    link/ether --:--:--:--:--:-- brd ff:ff:ff:ff:ff:ff
# # same result :( Let's start networkmanager and look at dmesg
# /etc/rc.d/rc.networkmanager start
Starting NetworkManager daemon:  /usr/sbin/NetworkManager
# dmesg
[ 1837.902351] RTL8723AU: ERROR nolinked power save leave
[ 1837.909489] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[ 1838.014111] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[ 1838.071532] RTL8723AU: ERROR set bssid:00:00:00:00:00:00
[ 1838.071556] RTL8723AU: ERROR set ssid [g\xffffffc6isQ\xffffffffJ\xffffffec)ͺ\xffffffab\xfffffff2\xfffffffb\xffffffe3F|\xffffffc2T\xfffffff8ESC\xffffffe8\xffffffe7\xffffff8dvZ.c3\xffffff9fɚ\xffffffcb\xffffffc0=\xffffff90\xffffffca\xffffffe2\xffffffc8<\xffffffc0)\xffffffe4\xffffffbc] fw_state=0x00000808
[ 1838.089432] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[ 1844.035699] RTL8723AU: ERROR nolinked power save enter
[ 1848.135423] RTL8723AU: ERROR nolinked power save leave
[ 1849.489843] RTL8723AU: ERROR set ssid [BROADCAST_NAME] fw_state=0x00000008
[ 1849.489882] RTL8723AU: ERROR set bssid:..:..:..:..:..:..
[ 1849.569168] RTL8723AU: ERROR start auth
[ 1849.574162] RTL8723AU: ERROR auth success, start assoc
[ 1849.578163] RTL8723AU: ERROR assoc success
[ 1849.578203] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[ 1849.580676] RTL8723AU: ERROR send eapol packet
[ 1849.585768] UpdateHalRAMask8192CUsb => mac_id:0, networkType:0x0b, mask:0x000fffff
                 ==> rssi_level:0, rate_bitmap:0x000ff015
[ 1849.593398] RTL8723AU: ERROR send eapol packet
[ 1849.593431] RTL8723AU: ERROR set pairwise key to hw: alg:4(WEP40-1 WEP104-5 TKIP-2 AES-4) camid:4
[ 1849.595153] RTL8723AU: ERROR set group key to hw: alg:4(WEP40-1 WEP104-5 TKIP-2 AES-4) keyid:1
[ 1853.157638] UpdateHalRAMask8192CUsb => mac_id:0, networkType:0x0b, mask:0x000fffff
                 ==> rssi_level:2, rate_bitmap:0x000ff000

I've tried not only ip command, but also ifconfig and macchanger. Also I've edited something in /etc/udev/rules.d/70-persistent-net.rules, but it hasn't helped me either.

The thing is that if I block 8723au and add modules rtl8xxxu & r8723au, than there are no more problems with spoofing the address. But those drivers usually are able to provide me with 5-10 MB/sec. But if I change MAC address the speed becomes unusable. Every Web page loads so-o-o slo-o-w.

So you have any idea what the problem could be?

7aitsev commented 6 years ago

I am not really sure that this is the right place to address my issue... forgot to mention: I use the latest code from the repo (master branch) and my system is running with the Linux kernel 4.4.x.

lwfinger commented 6 years ago

Not really. I have no idea where or what r8723au is. That is not found in any driver package that I know about.

If you want to complain about loss of speed when the MAC address is changed for rtl8xxxu, then you need to report that to the maintainer of that device. Send E-mails to linux-wireless@vger.kernel.org.

If you want to change the MAC address for this driver, you need to change it on module load with the "rtw_initmac=xx:xx:xx:xx:xx:xx" option. As far as I know, there is no code for changing it on the fly.

7aitsev commented 6 years ago

Thank you! The "rtw_initmac" thing is exactly what I'v been looking for a few days!