Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

I am trying to change the MAC address on a device running Android. It has been rooted and a command line installed ("ConnectBot"); I was looking around Google for methods of changing the MAC address on it and I found something called ip and ip link. Initially I thought I would use ifconfig but I haven't found the name of the network interface to change.

How would this be done on an Android device?

share|improve this question

migrated from serverfault.com May 24 '11 at 2:44

This question came from our site for professional system and network administrators.

add comment

2 Answers 2

ifconfig -a to list interfaces.

ifconfig wlan0 hw ether ff:ff:ff:ff:ff:ff to set the MAC address, replacing wlan0 with the interface you want to use, and the MAC address with the one you want to spoof. Not all drivers support changing the MAC address though, so this may not work.

share|improve this answer
1  
ifconfig -a returns the error "-a: no such device" on my rooted Desire. –  Robert Jun 24 '11 at 14:54
add comment

As superuser run:

# netcfg

A list with the interfaces will appear. For example my interface was eth0

# ifconfig eth0 down
# ifconfig eth0 hw ether your:new:mac
# ifconfig eth0 up

Note that not all drivers support this operation, and the Android ifconfig do not support these commands. You will need another ifconfig executable, perhaps that from busybox will be suitable.

After the reboot these changes are lost.

share|improve this answer
    
How can this command be executed on each reboot, or does this change stick? My galaxy nexus randomly changes the mac id on every reboot due to an error in the kernel. (Google is aware but seems to be in no hurry to fix it. It makes mac id authentication impossible.) –  user14633 Apr 27 '12 at 22:18
    
@user14633: funny. that's the behavior I'm looking to implement, in order to avoid being identified by my MAC wherever I go. –  mc0e Dec 8 '13 at 4:20
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.