Hello,
I want to change the wifi MAC address on my TL-WR841n, I tried the usual way using ifconfig:
root@OpenWrt:/# ifconfig
...
wlan1 Link encap:Ethernet HWaddr 10:FE:ED:EB:65:C0
inet6 addr: fe80::12fe:edff:feeb:65c0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1317 errors:0 dropped:0 overruns:0 frame:0
TX packets:1953 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:260870 (254.7 KiB) TX bytes:515115 (503.0 KiB)
root@OpenWrt:/# ifconfig wlan1 down
root@OpenWrt:/# ifconfig wlan1 hw ether 10:FE:ED:EB:66:A0
root@OpenWrt:/# ifconfig wlan1 up
root@OpenWrt:/# ifconfig
...
wlan1 Link encap:Ethernet HWaddr 10:FE:ED:EB:66:A0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:1328 errors:0 dropped:0 overruns:0 frame:0
TX packets:1985 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:263754 (257.5 KiB) TX bytes:526934 (514.5 KiB)
All good so far, but when I start wifi:
root@OpenWrt:/# wifi
root@OpenWrt:/# ifconfig
...
wlan1 Link encap:Ethernet HWaddr 10:FE:ED:EB:65:C0
inet6 addr: fe80::12fe:edff:feeb:65c0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:1056 (1.0 KiB)
The MAC-address gets changed back to the original one.
I tried to join the network manually after changing the MAC address but that didn't work either:
root@OpenWrt:/# iwconfig wlan0 essid mDjMAR1L5IsAQwG4
Error for wireless request "Set ESSID" (8B1A) :
SET failed on device wlan0 ; Operation not supported.
root@OpenWrt:/# iw dev wlan0 connect -w mDjMAR1L5IsAQwG4
command failed: Operation not supported (-122)
I looked at what the /sbin/wifi script does, but I was unable to find out where the ubus calls are going.
What am I doing wrong? How can I spoof the MAC address for the wifi interface?