Wi-Fi MAC address changing

Search This thread

Adam77Root

Inactive Recognized Developer
Jul 3, 2012
2,521
11,117
Hello everybody!

I have managed to change the Wi-Fi MAC address of my device and now I share this technique with you. With this method, you can change your address permanently!

What is a MAC address?
A Media Access Control address (MAC address) is a unique identifier assigned to network interfaces for communications on the physical network segment. It may also be known as a burned-in address, an Ethernet hardware address (EHA), hardware address or physical address. (Source: Wikipedia)

Why would somebody change his/her MAC address?
- To access the internet where it is restricted to particular addresses.
- To hide his/her illegal activity. (Though this is not effective enough since the Android system sends product information and a lot of other things to the Google servers and I'm sure that previous IP addresses could be searched for if somebody does something really nasty.)

Is it legal to change the MAC address?
As far as I know, it is. However, I firmly discourage you on doing anything illegal with changed/unchanged MAC.

Let's do it!
What do you need?
- A rooted device.
- A kernel with MAC address changing support. (I include my ICS kernel (version 3.1.10) for those who want to try it out and the method of implementing it into other custom kernels.)
- A file manager that can explore the root filesystem.

How does this exactly work?
Normally, the Wi-Fi driver gets the MAC address from the built-in chip then it writes the address to '/efs/wifi/.mac.info' and '/data/.mac.info'. This is the original burned-in address. This cannot be changed with software modifications, but only by soldering off the chip from the motherboard and rewriting its contents. Our Wi-Fi device is a Broadcom BCM4330. It has very good built-in features and the open source driver can be found in our kernel sources.

There are two different options in the driver (READ_MACADDR and RDWR_MACADDR (actually, there is a WRITE_MACADDR option too, which stands for creating the two files I have mentioned before)), which enable us changing the address. I tested both and found READ_MACADDR better. By enabling it in the kernel, you get some options regarding MAC changing.

Before you change your MAC address in any way, turn off Wi-Fi! I recommend writing down your original address somewhere (just to be extra secured). You can always return to your original one using the second method (read further) or by flashing a kernel that doesn't have the patch.

- If you flash a patched kernel and delete the '/efs/wifi/.mac.info' file, the driver will generate (!!) a custom MAC address based on some predefined rules (The first 24 bits are common in all generated addresses.).
- Of course you can set your own custom MAC address. Do this by editing the '/efs/wifi/.mac.info' file with a file manager. If you change it to an incorrect address, the system will automatically use the original (burned-in) MAC.

For kernel developers who want to enable this:
Find '#define WRITE_MACADDR' after '#ifdef CONFIG_MACH_N1' in 'drivers/net/wireless/bcmdhd/src/dhd/sys/dhd_sec_feature.h' and insert '#define READ_MACADDR' after that line. This is for ICS kernels (version 3.1.10), but the patch must work on GB ones too. You just have to insert the define somewhere else (I didn't look into this.).
(I count on you guys in implementing this! :))

I attach my prebuilt (secure, MMC_ERASE_CAP disabled) kernel for trying out this feature. It is an ICS kernel (version 3.1.10).

Every custom modification to devices have risks. Use this at your own risk!

Have fun and enjoy! :)
 

Attachments

  • Kernel_MAC_changing.zip
    7 MB · Views: 15,726
Last edited:

ardatdat

Senior Member
Jun 13, 2010
787
1,659
Travel around; but XDA x24
Thanks!

Just tried patching the kernel, it works! So, this feature will be included in my next kernel.

Before flashing the patched kernel, when I turn off wifi, delete .mac.info file, re-enable wifi, the MAC address is not changed.

However, after flashing the patched kernel, after I turn off wifi, delete .mac.info file and re-enable wifi, the MAC address is changed!

Thanks very much for the useful guideline from Adam77Root :good:
 
  • Like
Reactions: xlm13x

Abuzzz

Member
Sep 9, 2012
7
0
29
Pune
www.facebook.com
Hey bro can u explain this in a more simpler manner...I'm a newbie here and i need this! bcuz my brother alwayz blocks my wifi mac address so i cannot access wifi. I hav a rooted Samsung galaxy ace s5830 using cm 10.1 rc4......thanks in advance!:good:
 

mj.vikram

Senior Member
Mar 2, 2012
2,729
2,421
XDA 24 X 7
Hey bro can u explain this in a more simpler manner...I'm a newbie here and i need this! bcuz my brother alwayz blocks my wifi mac address so i cannot access wifi. I hav a rooted Samsung galaxy ace s5830 using cm 10.1 rc4......thanks in advance!:good:

If kernel supports only we change the WIFI MAC Address, we can not use it on all the kernels...
 
  • Like
Reactions: Abuzzz

Deadfreak

Senior Member
Apr 30, 2012
135
18
Home
Is it possible to port this to nexus 7 wifi edition with Dirty Aokp rom? :confused:
I already have this on my r with cm10.1 kernel
Sent from my GT-I9103 using Tapatalk 2
 

The-Droidster

Senior Member
May 27, 2012
1,295
893
XDA 24 x 7
Can you suggest me a ROM with the suitable kernel to change the mac address of my Samsung Galaxy Ace S5830 please?? It would be of great help...

I think your best bet would be the galaxy ace forums. You could search if there's an existing kernel with this functionality or else you could direct one of the kernel developers there to have a look at this thread.
 
  • Like
Reactions: humorlife

pkb149

New member
Dec 29, 2012
3
0
I'm a beginner, plz explain in detail such that I can do it.

I'm using Karbonn A11(rooted).
I need to change my Wi Fi mac address because my network administrator blocked my device mac address.
yo be able to connect to wi fi I need to change my wi fi MAC address...
plzz help me..
plzzz

---------- Post added at 02:42 PM ---------- Previous post was at 02:20 PM ----------

I'm using Karbonn A11(rooted).
I need to change my Wi Fi mac address because my network administrator blocked my device mac address.
yo be able to connect to wi fi I need to change my wi fi MAC address...
plzz help me..
plzzz
 

Adam77Root

Inactive Recognized Developer
Jul 3, 2012
2,521
11,117
You need a kernel that supports it.

BTW: Why on earth is this thread in the Q&A??
 

android_paul

Senior Member
Sep 25, 2013
242
122
Berlin
...not on my refrigerator, but on my U8860

If you didn't say, I would have tried it out on my refrigerator.

Hello experts,

since a long time I'm trying to fix my mutating MAC on a Huawei U8860 (so called Honor).
Your Thread gives me new hope. Atm I'm running a custom rom (baidu v.5, ROM 43) on my device.
Do you think, it's possible to insert the phrase into the kernel-source to make the MAC fix again? The wlan-chip is nearly the same as in your tested device (bcm4329).
What else do I have to patch? Is it necessary to write the MAC (seen on the label under battery) into any config-file?
I apprecheate your help - thanx for reading...
 
Last edited:

unicycle2

New member
Mar 8, 2014
2
0
Works on Samsung S4 mini with CM 11, however I need to reboot after changing .mac.cob even when deleting .mac.info (which does not automaticly returns), as turning off/on WiFi isn't enough.
I guess the READ_MACADDR option is missing, and at one point I'd like to make my own CM modification. Or is there a more simple solution?
 

princesbal

New member
Mar 27, 2014
1
0
I'm new here..
I have rooted my galaxy note 2 gt-N7100
I want to change my mac address to another one that i want
Can you tell me how can I do it?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 29
    Hello everybody!

    I have managed to change the Wi-Fi MAC address of my device and now I share this technique with you. With this method, you can change your address permanently!

    What is a MAC address?
    A Media Access Control address (MAC address) is a unique identifier assigned to network interfaces for communications on the physical network segment. It may also be known as a burned-in address, an Ethernet hardware address (EHA), hardware address or physical address. (Source: Wikipedia)

    Why would somebody change his/her MAC address?
    - To access the internet where it is restricted to particular addresses.
    - To hide his/her illegal activity. (Though this is not effective enough since the Android system sends product information and a lot of other things to the Google servers and I'm sure that previous IP addresses could be searched for if somebody does something really nasty.)

    Is it legal to change the MAC address?
    As far as I know, it is. However, I firmly discourage you on doing anything illegal with changed/unchanged MAC.

    Let's do it!
    What do you need?
    - A rooted device.
    - A kernel with MAC address changing support. (I include my ICS kernel (version 3.1.10) for those who want to try it out and the method of implementing it into other custom kernels.)
    - A file manager that can explore the root filesystem.

    How does this exactly work?
    Normally, the Wi-Fi driver gets the MAC address from the built-in chip then it writes the address to '/efs/wifi/.mac.info' and '/data/.mac.info'. This is the original burned-in address. This cannot be changed with software modifications, but only by soldering off the chip from the motherboard and rewriting its contents. Our Wi-Fi device is a Broadcom BCM4330. It has very good built-in features and the open source driver can be found in our kernel sources.

    There are two different options in the driver (READ_MACADDR and RDWR_MACADDR (actually, there is a WRITE_MACADDR option too, which stands for creating the two files I have mentioned before)), which enable us changing the address. I tested both and found READ_MACADDR better. By enabling it in the kernel, you get some options regarding MAC changing.

    Before you change your MAC address in any way, turn off Wi-Fi! I recommend writing down your original address somewhere (just to be extra secured). You can always return to your original one using the second method (read further) or by flashing a kernel that doesn't have the patch.

    - If you flash a patched kernel and delete the '/efs/wifi/.mac.info' file, the driver will generate (!!) a custom MAC address based on some predefined rules (The first 24 bits are common in all generated addresses.).
    - Of course you can set your own custom MAC address. Do this by editing the '/efs/wifi/.mac.info' file with a file manager. If you change it to an incorrect address, the system will automatically use the original (burned-in) MAC.

    For kernel developers who want to enable this:
    Find '#define WRITE_MACADDR' after '#ifdef CONFIG_MACH_N1' in 'drivers/net/wireless/bcmdhd/src/dhd/sys/dhd_sec_feature.h' and insert '#define READ_MACADDR' after that line. This is for ICS kernels (version 3.1.10), but the patch must work on GB ones too. You just have to insert the define somewhere else (I didn't look into this.).
    (I count on you guys in implementing this! :))

    I attach my prebuilt (secure, MMC_ERASE_CAP disabled) kernel for trying out this feature. It is an ICS kernel (version 3.1.10).

    Every custom modification to devices have risks. Use this at your own risk!

    Have fun and enjoy! :)
    2
    Is it possible to port this to nexus 7 wifi edition with Dirty Aokp rom? :confused:
    I already have this on my r with cm10.1 kernel
    Sent from my GT-I9103 using Tapatalk 2

    I have looked into the sources of your Wi-Fi driver (the same BCMDHD) and it seems it doesn't support it. Maybe this is a Samsung-only feature.
    1
    Thanks!

    Just tried patching the kernel, it works! So, this feature will be included in my next kernel.

    Before flashing the patched kernel, when I turn off wifi, delete .mac.info file, re-enable wifi, the MAC address is not changed.

    However, after flashing the patched kernel, after I turn off wifi, delete .mac.info file and re-enable wifi, the MAC address is changed!

    Thanks very much for the useful guideline from Adam77Root :good:
    1
    Hey bro can u explain this in a more simpler manner...I'm a newbie here and i need this! bcuz my brother alwayz blocks my wifi mac address so i cannot access wifi. I hav a rooted Samsung galaxy ace s5830 using cm 10.1 rc4......thanks in advance!:good:

    If kernel supports only we change the WIFI MAC Address, we can not use it on all the kernels...
    1
    Hello,

    Is it possible on Samsung Galaxy SII GT-I9100 ?

    thanks ;)

    Just have taken a look into your kernel sources and it seems it is.

    Check this thread: http://xdaforums.com/showthread.php?p=37299543
    Somebody will surely compile a kernel for you.