You are on page 1of 12

Home

Mac OS X

iPhone

iPad

Tips & Tricks

Apple MacBook Air


MJVE2LL/A 13.3"

Mac OS X version
10.6.3 Snow

$999.99 $889.99

$29.79

Jailbreak
Apple MacBook
News Air
iOS
MJVE2LL/A 13.3"

Mac OS X version
10.6.3 Snow

$999.99 $889.99

$29.79

Change (Spoof) a MAC Address in OS X


Mountain Lion & Mavericks

Mac Computing
Nick Vandome
Paperback

Search
Mac Computing
Nick Vandome
Paperback

Subscribe to OSXDaily

Mar 1, 2012 - 49 Comments

A MAC address is a unique identification number assigned to network interfaces, these can be

Suka

Follow @OSXDaily

66rb

attached to physical hardware like NIC and Wi-Fi cards or assigned to virtual machines. On
some occasions, youll need to change a MAC address to another ID.

Weve received a few questions about this


recently because the process of changing
(sometimes called spoofing) these
addresses has changed slightly from
version to version in Mac OS X. With that
in mind, we will show you how to change

OS X Daily
66.848 suka

a MAC address in the latest versions of


OS X 10.7, 10.8 Mountain Lion, and 10.9
OS X Mavericks, and OS X 10.10

Sukai Halaman

Bagikan

Yosemite.
Jadilah orang pertama yang menyukai ini.

Launch the Terminal found within


/Applications/Utilities/ to get started.

Get a New MAC Address


The first thing youll want to do is retrieve the intended MAC address. If you have one in mind
then use that, but if you arent trying to spoof a specific address and just need a random one,

OSXDaily
Follow

use the following command to generate one with openssl:


+ 7,929

openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'

MAC addresses are always in the format of xx:xx:xx:xx:xx:xx, yours must conform to this format
in order to work. For the purpose of this walkthrough the randomly generated address of
d4:33:a3:ed:f2:12 will be used.

Changing the MAC Address


If you arent in the Terminal yet, open it now. Well use the interface en0 for this, but yours could
be en1 (read notes at bottom). The command for changing the MAC address is as follows:
sudo ifconfig en0 ether xx:xx:xx:xx:xx:xx

+1

Replace xx:xx:xx:xx:xx:xx with the desired MAC address, in the example case this will look
like:
sudo ifconfig en0 ether d4:33:a3:ed:f2:12

Hit return and enter the administrators password to set the new address. To confirm it has been
changed, type the following:
ifconfig en0 |grep ether

You can also find it in Network preferences, though the GUI doesnt always report the MAC
change immediately, instead waiting until the network connection has been cycled.

Notes & Troubleshooting


If you arent sure which interface to use (en0, en1, etc), type ifconfig and find it that way.
For MacBook Air without an ethernet port the en0 is usually the Wi-Fi interface, whereas a
MacBook, iMac, Mac Mini, MacBook Pro, or any Mac that has an ethernet port will
probably use en1 for Wi-Fi instead
You may want to note the default hardware MAC address before beginning
Some Macs will use the following command instead:
sudo ifconfig en1 Wi-Fi xx:xx:xx:xx:xx:xx

OS X Yosemite, Lion, Mountain Lion, and Mavericks and later renamed airport to Wi-Fi
and thus the naming change
You will need access to an admin account or have the root user enabled
You need to disassociate from a connected wi-fi network before the new MAC address will
register
This has been tested on a MacBook Air and MacBook Pro running OS X 10.7 OS X 10.8,
OS X 10.9, and OS X 10.10, older versions of OS X can go here
The whole process should take no more than 15 seconds or so, as demonstrated in this video:

Change (or Spoof) MAC Address in Mac OS X

HP 61 Ink
Cartridges Black
and Color...
Hewlett Packard

Canon PIXMA
MX922 Wireless
Color Pho...
Canon USA
New $96.98

ARRIS
SURFboard
SB6141 DOCSIS
3.0 Ca...
Motorola
New $88.99

Fujitsu ScanSnap
iX500 Scanner for
P...
FUJITSU
New $399.99

Privacy Information

OS X Daily
66.848 suka

Enjoy this tip? Subscribe to the OSXDaily newsletter to get more of


our great Apple tips, tricks, and important news delivered to your
inbox! Enter your email address below:

Subscribe

391

130

61

27

Like

Related articles:
How to Generate & Change a MAC
Address in OS X the Easy Way
Generate and Set a Random Valid MAC
Address from the Command Line in OS
X
12 Address Book tips
How to Set a Manual IP Address in Mac OS X

Posted by: William Pearson in Command Line, Mac OS X, Tips & Tricks

49 Comments
Comments RSS Feed

Scott says:
March 1, 2012 at 2:14 pm

The MAC layer address is used by the local network router and switch. It is not used once
packets leave the local network so I have no idea why anyone would need to change the
MAC layer address.
Reply

parakeet says:
March 1, 2012 at 2:54 pm

A lot of networks and routers filter access by MAC address, changing it to an


approved address can be necessary.
Reply

tricky business says:


March 1, 2012 at 4:20 pm

kinda sounds like a hacking situation


Reply

Thomas D says:
March 1, 2012 at 9:26 pm

Not necessarily. IT runs into this all the time when network resources are
determined by MAC. Swapping a failed ethernet card changes the address,
in some organizations its faster to jot down the old number and spoof it
rather than waiting x many days to get some other departments approval
for the new hardware.
Reply

Ash says:
October 31, 2014 at 1:58 am

You know airport wifi where you get 30 minutes, on 30 mb free.


Change your MAC. Free unlimited wifi

Unclebaby says:
March 1, 2012 at 3:46 pm

How do you revert to the original MAC address?


Reply

ASLAN says:
March 1, 2012 at 4:25 pm

run the command again with your default in place, or reboot


Reply

tricky business says:


March 1, 2012 at 4:19 pm

same procedure, if you wrote down the original MAC address


Reply

Matt says:
March 1, 2012 at 4:30 pm

You should not just randomly generate a mac address without knowing how these are
assigned. The least significant bit of the first byte MUST be 0 otherwise it will be considered
a multicast ethernet and arp to some routers will be ignored.
See http://en.wikipedia.org/wiki/MAC_address, specifically the section on addressing:
If the least significant bit of the most significant address octet is set to 1, the frame will still
be sent only once; however, NICs will choose to accept it based on dierent criteria than a
matching MAC address: for example, based on a configurable list of accepted multicast
MAC addresses. This is called multicast addressing.
Reply

Ben Stoltz says:


March 1, 2012 at 4:34 pm

You should take care that the random MAC address you use is locally administered and
not Multicast:
ruby -e puts (%02x%((rand 64)*4|2))+(0..4).inject(){|s,x|s+:%02x%(rand 256)}
Reply

Roberto says:
March 25, 2012 at 11:41 pm

Hi, I have a problemwhen I try to change address with sudo ifconfig en1 Wi-Fi
xx:xx:xx:xx:xx:xx it ask me the password but I cannot type anythinganyone can help me?
Reply

yiotaki says:
April 9, 2012 at 7:11 am

write the code and dont care if it is visible. The code and enter
Reply

pm says:
March 31, 2012 at 3:25 am

I did to change the MAC in the console, but the change isnt shooing up in the GUI
(Network Preferences Pan) at all -no matter how often I reconnect Is there anyway to
force that?
Reply

yiotaki says:
April 9, 2012 at 7:04 am

I changed my mac adr. for eth., but when i restart my computer it returns to the original?
Why?
Its a real change or masking?How can i save it permanently?
Thanks in advance!!!
Reply

FinFin says:
December 31, 2014 at 4:44 am

You can just write a shell script like so


#!/bin/sh
sudo ifconfig en0 ether a1:b2:c3:d4:e5:f6
save it as bootup.sh
go to your terminal and where the bootup.sh is do
chmod 755 bootup.sh
now you want to put that file in you /bin directory
you can always use the Go to Folder function of the finder under the menu header
go and type /bin
to make it autoloading on boot youll also need a launchd script
in a text editor put in something like this
Label
com.user.bootup
Program
/bin/bootup.sh
RunAtLoad
save that as com.user.bootup.plist
in the Terminal do
chmod 744 com.user.bootup.plist
and put it in /Library/LaunchAgents

WARNING:
DO NOT put it in LaunchDeamons instead of LaunchAgents as a launchdeamon will
continously run forvever even if you kill the command
Enjoy
Reply

FinFin says:
December 31, 2014 at 4:45 am

sorry, do the bash script without sudo


Reply

DirtyTicker says:
April 27, 2012 at 1:42 pm

OK. I work on OS X Lion 10.7.3 I tried the procedure, sure it changes your MAC so it
displays in your terminal window. The thing is I cannot connect to any of the wireless
networks(!). It doesnt work. Each time I try to connect almost instantly a comment
Connection time-out displays. Each time I have to revert to the original MAC address in
order to have internet access.
Any help?
Thanks,
DT
Reply

Anthony says:
May 31, 2012 at 2:54 pm

I have the same problem I need to spoof my MAC address to get back into my
iTunes match account on the same damn laptop/account I bought it on.. I have 1
month left before it resets, but now that I know I can just change my MAC address Id
definitely do that instead Any help would be deeply appreciated!
Reply

Mads says:
April 30, 2012 at 5:41 am

Regarding:
openssl rand -hex 6 | sed s/\(..\)/\1:/g; s/.$//
Can anyone help modifying the line for creating a random but VALID MAC such that it is
always a locally administered (not multicast) one?
Reply

osmium says:
May 1, 2012 at 1:03 pm

openssl rand -hex 1 | tr [:lower:] [:upper:] | xargs echo obase=2;ibase=16; | bc | cut -c16 | sed s/$/00/ | xargs echo obase=16;ibase=2; | bc | sed s/$/:$(openssl rand -hex 5 |
sed s/\(..\)/\1:/g; s/.$// | tr [:lower:] [:upper:])/ | xargs sudo ifconfig en0 ether
This should generate and set a new random valid MAC.
If anyone knows a better way or find any error in code please share.
Reply

Will says:
May 1, 2012 at 1:08 pm

Great tip, thanks for this!


Reply

Doc. says:
June 15, 2012 at 2:11 pm

OSX 10.7.4
I am able to successfully change the MAC address and it does in fact show up on the
router, in the DHCP table, and via a network scan done by another device.
However, the GUI still shows the Apple MAC address, though it doesnt seem to make a
dierence out on the network.
-Doc
Reply

Doc. says:
June 15, 2012 at 2:13 pm

BTW, I dont use a random MAC address I want to retain a bit of privacy when on
public hotspots, so my Macbook Air is named Dell User and my MAC address prefix
is one that is registered with Dell.
Reply

Josh says:
September 29, 2012 at 7:43 pm

Same here. Change shows on router but not in Network Pref > Wi-FI > Advanced >
Hardware > Mac Address
And the change is only good until a reboot then it reverts back to the original. Would
be nice not to have to change on a reboot. I just have to run a small script on startup
but still
Reply

Kieran says:
April 22, 2014 at 4:41 pm

did you sort out an answer to this?


Reply

Zach Boyer says:


June 27, 2012 at 9:15 pm

OK, Ive tried this in the past everything goes as its supposed to but then the Internet
connection wont work I dont have wireless I have a router through the Internet
company, like with a wire that connects right into the compIm not sure if thats a factor. I
know the router itself has a separate mac address of its own Id like to change that too
but for now Im willing to settle for just the first problem Can someone help me w/
this?
Reply

flash says:
August 11, 2012 at 4:04 am

I made a simple Preference Pane for this: https://github.com/funkensturm/LinkLiar

Maybe it will help one or the other. I find it kind of convenient.


Reply

Episode 132 The Breakfast Show | "I Confess I'm a Geek!" says:
September 4, 2012 at 11:22 pm

[] Change (Spoof) a MAC Address in OS X Lion & OS X Mountain Lion []


Reply

Bri says:
September 18, 2012 at 6:41 pm

FYI, system updates seem to undo this little change reverting back to the original MAC
address. Doing the procedure again fixes it, no issues.
Reply

Juan says:
October 27, 2012 at 8:09 am

With the computer serial number I can get the original MAC address? I lost my macbook
and I need the mac address.
Reply

How to Generate & Change a MAC Address in OS X the Easy Way says:
November 9, 2012 at 12:22 pm

[] (the unique ID attached to a physical network interface), but arent comfortable with the
command line approaches that weve discussed before, an excellent free preference panel
called LinkLiar makes it []
Reply

Robert says:
February 21, 2013 at 8:38 am

Neither of this works for me. I either get ioctl (SIOCAIFADDR): permission denied or
ifconfig: Wi-Fi: bad value if I use the alternative command from the tips on the bottom.
I have the root user enabled. Please advise?
Reply

tim says:
March 15, 2013 at 11:48 am

How did you make it work after that error?


Reply

Robert says:
February 21, 2013 at 8:53 am

Ok i made it work but it resets on restart.


Is there a way to set random mac address upon each restart?
Reply

james says:
January 22, 2014 at 3:19 pm

The easiest solution. USE LINUX..


Reply

spickingtons says:
September 13, 2014 at 11:03 am

ER no every network problem I have encountered on linux has been 10 x more


complex then on a mac.
you do you use linux right and understand what easy means???
Reply

Kieran says:
April 21, 2014 at 12:14 pm

Whenever i change my mac address it is fine, but once i shut it down it always goes back to
the default address im trying to change, any ideas?
Reply

Kieran says:
April 21, 2014 at 12:14 pm

Whenever i change my mac address it is fine, but once i shut it down it always goes back to
the default address im trying to change, any ideas??
Reply

Scap says:
May 27, 2014 at 8:59 pm

I did this procedure and then checked it using the command ifconfig en0 |grep ether
which show the new mac address i chose. So it seems all good but i went to System
preferences > Network > Advanced.. and its still show the real mac address!! is that
normal?
I tried many times with dierent mac address, the Terminal told me it worked each time but
not in the system preference/network!
Reply

caseyg48 says:
July 2, 2014 at 7:18 am

So, when I do the default command everything works, but unfortunately I play on the WiFI So When I go to spoof the mac for the en1 interface I get the message:
ifconfig: Wi-Fi: bad value
I have been entering addresses found by the random generator and tried addresses from
the other generating commands in the comments, which doesnt even generate for me.
Any help would be appreciated, thanks!
Reply

Sam Imigin says:


August 29, 2014 at 6:08 am

Even with Wi-Fi you need to set its ether (i.e., ethernet) address. Thus, try:
sudo su
ifconfig en1 ether xx:xx:xx:xx:xx:xx
Also, the Wi-Fi adapter needs to be on (so connect to some random other network
first)
Note: for xx:xx:xx:xx:xx:xx you can try just adding one to your current ethernet
address

Reply

awd1969 says:
July 21, 2014 at 2:51 pm

I was getting the same bad value message on following the interactions on here. How I
got mine to work was by first going to System Preferences/Network/Advanced/Hardware
and changing Configure to Manual; then by using:
sudo ifconfig en0 ether xx:xx:xx:xx:xx:xx
where xx:xx:xx:xx:xx:xx is the new MAC you want to use and en0 is the interface you want
to change, in this case my wi-fi connection. To check which ones which, use:
networksetup -listallhardwareports
This is working for me as Im typing it from a hotel chain that tries to make you pay if you
want more than the initial 30 mins. per day.
Hope it helps.
Reply

Ox says:
July 29, 2014 at 12:17 pm

Does the change of the MAC Address change also the public IP address on FTTH on Mac
OS X 10.9.4 (Mavericks)? Thanks.
Reply

Mike says:
December 18, 2014 at 7:09 pm

So I have done this all and successfully changed the Mac number, now where is this magic
internet connection? To me I am in the same boat as before with my own Mac number
looking at a long list of password locked wifi signals
Reply

woody says:
February 28, 2015 at 7:34 am

It wont allow you to get through a encrypted system. But if there is a wifi connection
that will give you some free time but then wants you to pay after the free time (like
xfinity public hotspots) you can keep on changing the Mac address to get unlimited
free internet.
So for example Xfinity public hotspots will give you a complimentary hour. So once
that hour is up you can change your mac address and get another free hour. Repeat
again and again for unlimited free internet
Reply

yapko says:
February 17, 2015 at 3:20 pm

Mike, get o your computer now. Get back to school.


Reply

Josh says:
March 29, 2015 at 2:13 pm

If I change my MAC Address, will I lose all my important files? I need to know because my
dad will punish me if I break the computer. Thanks in advance.

Reply

Josh says:
March 29, 2015 at 2:15 pm

Lol, not break, sorry. I mean ruin the data.


Reply

Meade says:
April 16, 2015 at 7:46 pm

Ive done this many times before but since the update today it doesnt work. Ive tried
everything and I put the same stu as always in but when i try to confirm that Ive changed
it it comes up with the same address. Someone please help
Reply

Leave a Reply
Name (required)

Mail (will not be published) (required)

Website

Submit Comment

How to Enable Caps Lock on

6 Ways to Force Quit Mac

iPhone, iPad, and iPod touch

Applications

Shop for Apple & Mac Deals on Amazon.com

Apple MacBook Air


MJVE2LL/A 13.3"

Mac OS X version
10.6.3 Snow

$999.99 $889.99

$29.79

Apple MacBook Air


MJVE2LL/A 13.3"

Mac OS X version
10.6.3 Snow

$999.99 $889.99

$29.79

Mac Computing
Nick Vandome
Paperback

Mac Computing
Nick Vandome
Paperback

OS X Daily
Email us: osxdailycom@gmail.com
About OSXDaily | Contact Us | Privacy Policy | Sitemap
This website is unrelated to Apple Inc
All trademarks and copyrights on this website are property of their respective owners.

2015 OS X Daily. All Rights Reserved. Reproduction without explicit permission is prohibited.

You might also like