I am not sure how to acomplish this, but from prior knowledge the MAC address is semi-hard coded into the NIC (Network Interface Card, I know it's a chip these days but the acronym still stands). Part of the MAC address is the manafacturer ID which is normally hard coded, the remainder of the address is left to be incremented when the card is rolled out, so supposedly no two addresses are ever the same. As the ID can be flashed prior to rolling out the card, by nature it can be changed after the fact. To do this, you will have to have low level access to the hardware, which can only be done at the OS level.

The ifconfig method mentioned a few posts down will give you what you want, you could write a small script to do this or write a library which can be used by java.

1 Changing the MAC address on a device is similar to altering the serial number on something.

This may or may not be illegal, that really depends on the device, and more importantly how its being used. Basically as soon as you change the MAC address and try and use a fake one you're falsifying information. Which on a low level means you're probably breaking the user agreements or terms of service. (i.e. changing the MAC address on a cable modem means your device is trying to connect under a different user account as some cable companies (comcast) uses the MAC address as the only thing tied to your account).

2. Truly changing a MAC address is not an easy task. Sure in Linux and OS X you can tell the system to use a different address, the physically coded address' in the hardware is still the same, and if THEY are asked to authenticate they will provided their unique id number. (changing a MAC address at the system level is something network engineers will do to manage network/user security)

Can they be changed, yes, with either software or with a diagnostic tool.

Should they be changed, not really. They are meant to be unique, and if they're being used to identify you as an account holder you're breaking TOS.

You need a usb chord
a rooted phone
and terminal emulator
I posted this tutorial over at rohitab under Leisure Suit Larry
But it never seem to have posted and the more the merrier
After your rooted head into terminal emulation type su and go into /data/misc/wifi
Look for a file called nvram.txt
Copy it to your sdcard and then to your cpu desktop
open it with notepad and at the
bottom of nvram.txt is the mac address
This i was able to verify and test on android Citrus Ciena
Edit that mac address and save it as nvram1.txt onto sdcard
Now go back to data wifi misc and copy nvram.txt to nvram.bak
Head into gui and then settings then wifi then turn on the wifi but don't connect to any wifi
turn off the wifi,switch back to terminal
Copy the nvram1.txt to data misc wifi
remove the original (make sure you got it backed up)
Rename nvram1.txt to nvram.txt
head back into gui and then settings then wifi
Now for me it immediately stated unable to turn on wifi
Ignore it and try to turn it on anyways
When it turns on your newly edited mac address will take effect
Connect to your AP
NOW B4 REBOOTING YOU MUST CHANGE NVRAM BACK TO THE ORIGINAL!

did this and verified a fake mac address with tcpdump-arm
Busybox ip link show eth0
And a router with wpa2 table reflected the new fake mac

Maybe someone here with some Android Bourne Shell scripting know how can help me
I have this script which will change MAC address on the fly but i cant seem to check if file exist when using if then else statements

here is a simple check if exist script call but it wont echo what i want
===========
#!/bin/bash
if [ -e "/data/misc/wifi/nvram.bak" ];
then echo "!@#";
fi;
echo "1111"
==========

AND HERE IS MY MAC CHANGE SCRIPT WHICH WORKS
i just want to see if the bak file exist or not so i dont overwrite the bak with the fake
ran it like so:
copy the .sh script to sdcard
copy it to /data/local
while in the sdcard directory run it with
sh /data/local/test.sh OR you can sh test.sh with the file in sdcard (either way)
which works fine except the check exist conundrum
===========
#!/bin/bash
echo "Enter Fake MacAddress:"
read macx;
echo "# Motorola Ciena B2B Test nvram by BRCM JP, 2010.07.15
# $Copyright (C) 2008 Broadcom Corporation$
# $id$

on top of all that... if you do something like add a blank line at the end of a script file when piping output to create a file...
NOTE: OMIT THE <EOF> its there to show the board thats where it would end
it will create the file (test.txt) in this case and add a ? at the end of it.. forcing yu to use busybox ls to see the file with a ? and then rm to remove it so long yu add the? ... dont ask me how that exploit works but it does
#!/bin/bash
echo "123123" > /data/local/test.txt
CRLF (BLANK NEWLINE)
<EOF>

Well i do apologize and it seems to be fixed and im not going to try to cover up the mistake. Ill leave the post here for all to see
I do have a copy in my email proving this did occurr now lemme say this
no sooner did this happen from my cell bash did the verizon arbitrary unit call me up saying i am being sued. Talking about how he has deep pockets. Lol
i got the phone for free for signing up for a plan
Then canceled the plan after 2 days
The contract was signed by me but the rep didn't sign creating a legal binding contract
But this sucks that i cant reproduce this any longer
if yu would like to see my email copy of the entire terminal printout let me know
pm me...
sorry to let y'all down

now plug in the USB CHORD and setup USB developement debug mode in the settings
place that testx.sh into /sdcard
UNPLUG THE USB CHORD
su
cp /sdcard/testx.sh /data/local
PLUG THE USB CHORD BACK IN
goto /data/local
sh testx.sh
and you will have a file testx.txt with a hidden ?

this will change your mac addy to "00:12:f0:dd:cc:dc" change as needed
i test it in the standerd sdk works with 2.1 it also backs up your org address
to the sdcard for safe keeping..
im runing a x10 with 2.3.5 on it an it is not allowing me to set the mac with the ip etc cmd so im going to keep working on a script for the xperia users. but for the rest that shoud work....
also android uses busybox to send all commands to the kernel and busybox uses ash and not bash
just a heads up anyway hope this helps sum ppl

EDIT::2
that is currintly work on my android 2.3.5 (MiUi 1.9.9) =D spoffing

EDIT::3
also im going to try and get a database of wireless mac addys so that it will pull an replace
the address with diff address everytime the script is execed so it can be added to corn =D

EDIT::4
after 24hur test changing networks worked fine however enabling GPS restored the org mac address. so im gessing the mac is assinged to the GPS and that must be the same to access the satellites.
anyway enjoy spoofing

this will change your mac addy to "00:12:f0:dd:cc:dc" change as needed
i test it in the standerd sdk works with 2.1 it also backs up your org address
to the sdcard for safe keeping..
im runing a x10 with 2.3.5 on it an it is not allowing me to set the mac with the ip etc cmd so im going to keep working on a script for the xperia users. but for the rest that shoud work....
also android uses busybox to send all commands to the kernel and busybox uses ash and not bash
just a heads up anyway hope this helps sum ppl

EDIT::2
that is currintly work on my android 2.3.5 (MiUi 1.9.9) =D spoffing

EDIT::3
also im going to try and get a database of wireless mac addys so that it will pull an replace
the address with diff address everytime the script is execed so it can be added to corn =D

EDIT::4
after 24hur test changing networks worked fine however enabling GPS restored the org mac address. so im gessing the mac is assinged to the GPS and that must be the same to access the satellites.
anyway enjoy spoofing

Click to expand...

I made that sh file and put it on my /sdcard/ folder. Then I used Better Terminal and sh the file and this is what I got:

You need a usb chord
a rooted phone
and terminal emulator
I posted this tutorial over at rohitab under Leisure Suit Larry
But it never seem to have posted and the more the merrier
After your rooted head into terminal emulation type su and go into /data/misc/wifi
Look for a file called nvram.txt
Copy it to your sdcard and then to your cpu desktop
open it with notepad and at the
bottom of nvram.txt is the mac address
This i was able to verify and test on android Citrus Ciena
Edit that mac address and save it as nvram1.txt onto sdcard
Now go back to data wifi misc and copy nvram.txt to nvram.bak
Head into gui and then settings then wifi then turn on the wifi but don't connect to any wifi
turn off the wifi,switch back to terminal
Copy the nvram1.txt to data misc wifi
remove the original (make sure you got it backed up)
Rename nvram1.txt to nvram.txt
head back into gui and then settings then wifi
Now for me it immediately stated unable to turn on wifi
Ignore it and try to turn it on anyways
When it turns on your newly edited mac address will take effect
Connect to your AP
NOW B4 REBOOTING YOU MUST CHANGE NVRAM BACK TO THE ORIGINAL!

did this and verified a fake mac address with tcpdump-arm
Busybox ip link show eth0
And a router with wpa2 table reflected the new fake mac

Click to expand...

When I typed /data/misc/wifi on the terminal emulator there is a error message showing that permission denied. How to get permission for this?? Please reply to me..

Saw this thread and tweaked around a bit on my LG L9 and was able to write a 3 line script that works... easily. Run the script and it'll toggle OFF you wifi, change your mac then toggle back on. Toggle wifi off then on to revert to original one. Easy, work and you DON'T have to worry about changing file or permissions. Just execute VIA rom toolbox or script manager. NEED ROOT AND BUSYBOX INSTALLED. Should be a given

anyways, here it is (assuming your device uses wlan0. If not try eth0)