I was unable to change the MAC address of the Wi-FI device on a MacBook Air (M1 2020) running macOS Monterey due to the following error: ifconfig: ioctl (SIOCAIFADDR): Can't assign requested addres
.
By running the commands in following sequence I was able to change it successfully:
- Turn WiFi device off
- Turn the WiFi device on again:
networksetup -setairportpower en0 on
- Change the MAC:
ifconfig en0 ether <mac-address-here>
- Run:
networksetup -detectnewhardware
Sorry for late replay but it is not working even with latest script variant. Also strange enough is that it says that interface is Wi-Fi in self detect. But result is same
ifconfig: ioctl (SIOCAIFADDR): Can't assign requested address
edit: tested on the Macpro Wi-Fi script is working for it, but it is not working for ethernet at all