7

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?

0

2 Answers 2

4

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.

2
  • 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
    Commented Apr 27, 2012 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
    Commented Dec 8, 2013 at 4:20
0

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.

1
  • 1
    ifconfig -a returns the error "-a: no such device" on my rooted Desire.
    – Robert
    Commented Jun 24, 2011 at 14:54

You must log in to answer this question.