insufficient permissions to change MAC address

19,122

On Kubuntu 14.10 This page has a procedure that works. As root:

service network-manager stop; sleep 5 
ifconfig wlan0 down
macchanger -b -a wlan0; sleep 5 
ifconfig wlan0 up; sleep 5
service network-manager start

The sleeps may not be necessary, but that's what worked. Macchanger is in the repos. My attempts using ifconfig or ip link appeared to take but did not survive connecting to a network, because I didn't stop Network Manager. The burnt in MAC was reasserted.

This also works:

service network-manager stop; sleep 5
ifconfig wlan0 down; ifconfig wlan0 hw ether F8:27:93:01:02:03
ifconfig wlan0 up; sleep 5; 
service network-manager start; sleep 5;

I have a feeling there are some little gotchas lurking:

  • In the Network Manager gui, clear the 'Restrict to Device:' field. Also clear the 'Random' field.

  • Use a MAC with a recognised vendor prefix, easily found on Goog. Many routers can tell the difference. It also avoids any snafu with the 'locally administered' bit, WTH that is.

  • Start from a clean state, regarding the ifup & ifdown commands. They only keep a record of changes they have made & can be inconsistent
    with the true network state ( And no: I have no idea what I'm talking about regarding these)

Easy. Once you know how.

Share:
19,122

Related videos on Youtube

d3pd
Author by

d3pd

Updated on September 18, 2022

Comments

  • d3pd
    d3pd over 1 year

    I am attempting to change the MAC address of the Wi-Fi hardware of a laptop. When I attempt to change the MAC address using macchanger, I encounter an error:

    >sudo service network-manager stop
    >sudo macchanger --mac 28:27:c4:f6:ca:a5 wlp4s0
    Current MAC:   28:27:c4:f6:ca:a5 (unknown)
    Permanent MAC: 5a:ef:56:3d:dd:7e (Intel Corporate)
    [ERROR] Could not change MAC: interface up or insufficient permissions: Device or resource busy
    

    Here, the default MAC address of the hardware is 5a:ef:56:3d:dd:7e and the MAC address to which it should be changed is 28:27:c4:f6:ca:a5. How should I approach this error?

    • iñaki murillo
      iñaki murillo over 7 years
      try deactivating the interface: sudo ifconfig wlp4s0 down
  • ssi-anik
    ssi-anik over 4 years
    first command snippet worked for me. had to use sudo.