On Android 11, MAC address randomizations works fine when connecting the phone as a client to a WiFi network. However, I'm looking for a solution to randomize (or specify) the MAC address when sharing the internet connections to others using a WiFi hotspot.
For testing purposes, I use a OnePlus 5T with LineageOS dumpling (Android 11) which is rooted with Magisk.
I've tried setting the MAC address as I would in a normal Linux environment with ip link set dev wlan1 address XX:XX:XX:XX:XX:XX
. This does not work, however. ip a
shows the custom MAC, but capturing the beacon frames emitted by the hotspot feature, the original MAC is still the source.
iw dev <OLD_IFACE> interface add <NEW_IFACE> type __ap addr <MAC_ADDR>
. More details: How to create a wifi hotspot from the terminal?. – Irfan Latif Jan 24 '22 at 12:52