How to change MAC address in Linux or Android

Let's say that for recreational and academic reasons -which have nothing to do with the limitations that some hotels, servers, proxies, etc. may impose on you - you need to change the MAC address your Linux the device Android.

Doing so is bullshit. But, like all fried eggs, you have to know how to do it.


In both Linux and Android, the question is very simple. However, it should be noted that in both cases administrator privileges will be required, which means that in the case of Android it must be a "rooted" device.

Steps to follow

1.- Enable wifi.

2.- Disconnect from any network the device has connected to.

3.- Open a terminal and run the following script:

su
ifconfig wlan0 hw ether 00: 22: d2: 34: ac: 78
netcfg

Obviously, you will have to replace 00: 22: d2: 34: ac: 78 with whatever MAC address you want. In case you intend to pretend that you are using another particular device, you can find out its MAC address by typing the following on that device:

ifconfig

Finally, clarify that the netcfg command that appears in the script is simply included in order to see that the changes were made successfully.

On Android, you may need to replace the second line with busybox ifconfig wlan0 hw ether 00: 22: d2: 34: ac: 78.

4.- In case you want to save the script to a file and assuming you call it macchanger, don't forget to give it execute permissions using the following command:

chmod + x macchanger

5.- All that remains is to run the script with Wi-Fi enabled but without being connected to any network.

sh mcchanger

Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Baptist Palazesi said

    hi how are you .. i have a query .. how is the subject of the script .. ?? would it be like automating the process of changing the mac address .. ??? and how do I create it .. ?? thanks

  2.   gonzalocampero1982 said

    Hi, let me tell you that I have a serious problem with my Sony Acro S (LT26w) cell phone, what happens is that when the Wi-Fi is activated, the cell phone goes to safe mode and cannot be used again and the official JB rom must be loaded with the flashtool.
    I released the bootloader, I loaded the cyanogenmod 10.1 ROM, but when I activated the wifi again, what I mentioned happens to me and load the ROM again 🙁
    what do you think is the problem !!!!!
    Por favor…. can you help me

    1.    Lucas said

      Did you change the mac address of the cell phone? You have to be careful, because in the case of cell phones there are many addresses that are not valid, and many cell phones use their address to identify their own device, I happened to use an iPod I changed the Mac and from there it reset to as if it were from the factory (but with all the space of my applications occupied!) when restoring the original mac again, the settings were put back as usual ...

      1.    let's use linux said

        Hello Lucas! that on linux / android doesn't happen, at least not that I know of. It seems to be a mac / apple specific problem, not cell phones in general. 🙁
        Hug! Paul.

  3.   jos1727 said

    One question, is the change permanent or should the script be executed at the moment we want to change the address? Cheers

    1.    let's use linux said

      If memory doesn't fail me, you have to do it every time you start Android (in case you always need to use it). In other words, it is "permanent" as long as you do not restart the phone. Restarting it loses the change.
      Cheers! Paul.

  4.   santihoyos said

    Hello, I have created a Java program to solve this problem graphically. It is tested on Ubuntu.

    I leave you the Link of gitHub. In case you want to take a look at the code and someone is encouraged to improve it. And to download it of course 🙂

    https://github.com/santiihoyos/Linux-Mac-Changer/releases

  5.   Alan said

    hello it doesn't work for me it tells me ifconfig: siocsifhwaddr: operation not supported