Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.3: Change Ethernet MAC address from the Terminal System
For anyone who has not noticed it ... you are now able to change the system's Ethernet card MAC adress without any third party software. Just do a:
 % sudo ifconfig en0 ether aa:bb:cc:dd:ee:ff
where en0 is the network interface (numbered from en0, en1, en2 ...) and aa:bb:cc:dd:ee:ff is the desired MAC address in hex notation.
    •    
  • Currently 3.15 / 5
  You rated: 1 / 5 (13 votes cast)
 
[163,038 views]  

10.3: Change Ethernet MAC address from the Terminal | 40 comments | Create New Account
Click here to return to the '10.3: Change Ethernet MAC address from the Terminal' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Possible with airport card?
Authored by: adroitboy on Nov 07, '03 11:52:48AM

Has anybody tried this with a wireless card? I'd love to be able to do this with my Mac.



[ Reply to This | # ]
Possible with airport card?
Authored by: Telluride on Nov 07, '03 12:03:04PM

I just tried with no luck...the Airport driver probably doesn't support this to prevent MAC address spoofing. Should be possible with a different driver though.



[ Reply to This | # ]
Possible with airport card?
Authored by: tone@fatuous.org on Feb 03, '04 06:22:11AM

i just noticed my powerbook airport change the MAC addess itself.. i had the MAC hardcoded on my gateway, and after about a month of working flawlessly, all of a sudden it just stopped working - turned out the MAC address had changed!

so, it must be possible somehow :)



[ Reply to This | # ]
10.3: Change Ethernet MAC address from the Terminal
Authored by: MacOSXAddict on Nov 07, '03 01:03:56PM

Available through the GUI also, not just a command line hint...

---
--
Bob



[ Reply to This | # ]
10.3: Change Ethernet MAC address from the Terminal
Authored by: nobody on Nov 07, '03 01:54:32PM

- Under Jaguar the command does exists, however there is no support built into the kernel.
- I also thought I might find access through the GUI interface to this function, but did not find it. Where is it if not in Network, Advanced Ethernet configuration Page ?
- probably does not work with Airport. But does work on my G4 AGP and G4 Cube.



[ Reply to This | # ]
10.3: Change Ethernet MAC address from the Terminal
Authored by: simonpie on Nov 07, '03 08:31:32PM

It was possible to patch the kernel in jaguar to change the mac address, maybe the same thing is possible under panther so that one can change the aiport mac address.



[ Reply to This | # ]
eh?
Authored by: dave@mmu on Nov 09, '03 11:15:44AM

So where's the setting for that? I've not seen it in th eGUI at all...
Dave


---
Dave L



[ Reply to This | # ]
10.3: Change Ethernet MAC address from the Terminal
Authored by: sigghy on Nov 09, '03 03:52:21PM

Please, tell us how to change from GUI
Thanks



[ Reply to This | # ]
How to change MAC address from GUI
Authored by: MacOSXAddict on Nov 10, '03 09:03:34AM

Hi Sorry it took so long to respond.

To change the MAC address from the GUI you go to the Network control pannel, and select the Built in Ethernet (or other card) when you see the button bar that looks kind like (TCP/IP|PPPoE|AppleTTalk|Proxies|Ethernet) Select the Ethernet tap and below select configure and move it to manually- advanced. You can then enter your changed mac address info directly...

---
--
Bob



[ Reply to This | # ]
Wait, My Bad :(
Authored by: MacOSXAddict on Nov 10, '03 09:10:19AM

I'm sorry, I just checked again one mu mac here at work and found that you can change the speed and duplex, but the mac address is un-selectable. I saw it there when I was digging arround when I installed Panther but didn't try to edit it... Sorry for the mistake.

---
--
Bob



[ Reply to This | # ]
10.3: Change Ethernet MAC address from the Terminal
Authored by: cynikal on Nov 07, '03 01:08:28PM

I've tried this back in Jaguar, i saw the option there already but I don't remember it actually doing anything.

Isn't the hardware address hard-coded into the network interface cards's media access control chip?

I don't think you can override something in hardware witih software.



[ Reply to This | # ]
10.3: Change Ethernet MAC address from the Terminal
Authored by: eredhuin on Nov 07, '03 10:44:06PM

Linux and BSD have been able to do this for years. The absence in Darwin was a bit strange. It is nice they implemented this.



[ Reply to This | # ]
10.3: Change Ethernet MAC address from the Terminal
Authored by: Bytesmiths on Nov 07, '03 01:45:31PM
I can't swear it actually worked, but this is documented on the Jaguar man page. I also recall doing this in Solaris 7 -- some five years ago -- so I suspect it has been with us from the beginning of MacOS X.

Not that it isn't useful to be reminded of such things, though...

One caveat -- you may have to re-install certain software after doing such a thing. Some licensing activation schemes tie an install to the MAC, and the software will cease working if it thinks it's been copied to a different machine.

Unless you know what you're doing, messing with the MAC is generally not advised!

[ Reply to This | # ]

10.3: Change Ethernet MAC address from the Terminal
Authored by: dave1212 on Nov 07, '03 11:35:03PM

In this case, would it not be smart to do this semi-regularly, say at a rate of once a year? It goes without saying that you can change it more often if you're paranoid.. but I think it's just a matter of personal security.

If it does break an app, I'll have to deal with the consequences.

---
______
http://www.68kmla.ca/



[ Reply to This | # ]
10.3: Change Ethernet MAC address from the Terminal
Authored by: tsaar on Nov 08, '03 11:19:38AM

Why would changing a Mac-address once a year be safe?
Am I missing something?

BTW, the change exists you choose a valid Mac-address from somebody else on your specific stretch of LAN. This will seriously mess things up. I've seen this happen on corporate LAN, where flaky drivers caused NT-workstations to use a 'default' MAC-address. Needless to say only the first guy that had such a workstation arriving in the morning was able to get a DHCP lease & start working :)

Also, unless you work this into some startup-script, you'll be back to your 'real' Mac-Address once you reboot.

It's pretty handy though. My Cable connection is 'linked' to my Mac-Address (Static DHCP) and using this at least I'm able to swap Macs with a minimum of hassle......



[ Reply to This | # ]
10.3: Change Ethernet MAC address from the Terminal
Authored by: dave1212 on Nov 10, '03 01:36:03AM

Thanks for the heads-up. I wasn't realizing it would revert to its default (apparently hardware-assigned) MAC address after a reboot.

..and not so much for security, just privacy. I'm sure the logs of where/what we surf/share etc. are based on this number, since it's the easiest to find out over a network and would be least likely to change.

side note: burns me up when people spell "Mac", as in Macintosh, "MAC". I see this all over the place.

---
______
http://www.68kmla.ca/



[ Reply to This | # ]
10.3: Change Ethernet MAC address from the Terminal
Authored by: babbage on Nov 10, '03 11:23:24AM
..and not so much for security, just privacy. I'm sure the logs of where/what we surf/share etc. are based on this number, since it's the easiest to find out over a network and would be least likely to change.

Huh? This smells like paranoia to me. If any network activity is logged (web servers, mail servers, etc), the vast majority of those logs are going to be keyed off IP addresses, not MAC addresses.

The point of a MAC address is to be a globally unique identifier for a particular piece of network hardware. The point of an IP address is to be a managed, locally unique (as in, no duplication on the network you have direct access to, which might or might not be the public internet) identifier for routing traffic to & from that machine.

For TCP/IP traffic -- i.e. the internet, web, email, ssh, ftp, etc -- the IP address can be thought of as roughly the "atomic particle" of address information. On the other hand, the MAC address is like a "subatomic particle" -- it exists at a lower level, it has different properties that don't correlate to those of the level up, and for the most part it's of interest mainly to people in specialized fields.

So. Yes, it is possible that your MAC address is being logged somewhere, e.g. at your ISP. But for the most part, the IP address is a much more useful nugget of information. The Apache web server, for example, logs the IP address by default, but I don't even know if it's possible to get Apache to log all MAC addresses -- that piece of information isn't normally available to a web server, unless you're running software that specifically transmit that piece of information to the server for some reason (e.g. iTMS, allegedly).

Some people in some specific circumstances might have a legit reason to change their MAC address. From what I've read elsewhere in this discussion, cable modem users can avoid some bureaucratic red tape by this technique. I know that some server machines provide a mechanism for swapping out MAC addresses to assist in network resource management. But for most home users, I just don't see the point -- privacy certainly isn't the best reason to do this, because your IP is still logged all over the place, and it's much easier to track you down with that data than with a MAC address. If that's the only reason you'd want to change your MAC -- don't bother, it's unlikely to change anything at all.

---
--
DO NOT LEAVE IT IS NOT REAL


[ Reply to This | # ]

10.3: Change Ethernet MAC address from the Terminal
Authored by: MobileMac on Jan 27, '04 03:33:09AM

Hi,
I really need to change the mac-address to join a big secure DHCP-network. The new mac-adress is generated by the systemadmin. On about 5000 PCs this networksystem runs properly with this method.

Is it possible, that the mac for incoming packets can be changed in the network-settings--->DHCP---> DHCP-Client-ID ?

Hagen



[ Reply to This | # ]
10.3: Change Ethernet MAC address from the Terminal
Authored by: allanmarcus on Aug 19, '04 06:33:55PM

In this case MAC is shot for Media Access Control (I think) address. So "mac-address" would be incorrect, while MAC address is correct. So as not to confuse the masses, Apple refers to this address as the ethernet address, which is a little confusing considering Airport cards have them.



[ Reply to This | # ]
10.3: Change Ethernet MAC address from the Terminal
Authored by: quentinsf on Nov 08, '03 02:26:16PM

Not all hardware will allow this, but quite a lot will.

The machine ID used by the Apple Music Store is based on the ethernet MAC address. You might find that purchased music won't play if you change it to something else. Anyone confirm or deny this?



[ Reply to This | # ]
MAC address change dependent on hardware capabilitites
Authored by: klktrk on Nov 09, '03 12:38:18PM

I guess it should go without saying, but I'll say it anyway. This hint only works if your hardware supports it. If you try this on my PowerBook Lombard, for example, you'll get the following helpful message: "ifconfig: ioctl (SIOCAIFADDR): Operation not supported".

Cheers



[ Reply to This | # ]
10.3: Change Ethernet MAC address from the Terminal
Authored by: arizdave on Nov 09, '03 01:01:34PM

WHY would one NEED or WANT to change the MAC address anyway??? <(;-0



[ Reply to This | # ]
10.3: Change Ethernet MAC address from the Terminal
Authored by: mnb on Nov 09, '03 06:17:11PM

I'm sure there must be some legit reason to need to change your MAC address, but I can't think of one offhand. I can think of a few reasons that aren't legit, however...

1 - to allow access to a network that is controlled by MAC address.

2 - to bypass identification methods that use the MAC address as your machine's unique identifier. Some applications use this, it's rumored ITMS does. This is, in essence, VERY similar to the first reason...

MAC addresses are supposed to be like public IPs, that is... UNIQUE. Allowing people to change them defeats the purpose of having them.



[ Reply to This | # ]
10.3: Change Ethernet MAC address from the Terminal
Authored by: MacOSXAddict on Nov 10, '03 09:05:37AM

Don't forget, to modify your mac address so you can use your brand new machine on your cable modem without goint through the hassle of informing the ISP of the MAC change...

---
--
Bob



[ Reply to This | # ]
10.3: Change Ethernet MAC address from the Terminal
Authored by: Crawdad on Nov 12, '03 11:43:47AM

Not all MAC addresses are expected to be unique across the world. If the second-lowest bit of the first octet is set, the address is "locally administered" and not assumed to be worldwide-unique.

Warning! If you set the lowest-order bit of the first octet to a "1" (in other words, if the first byte is odd) strange and bad things may happen, because that indicates an ethernet multicast address. In a very small network envirnment you might not notice, but elsewhere it may bite you.



[ Reply to This | # ]
10.3: Change Ethernet MAC address from the Terminal
Authored by: urilabob on Apr 05, '06 08:45:49AM

Let me give a legitimate reason. I have just spent ~40 hours debugging a problem with MAC address allocation in a Fedora Core 5 intel box. Strange behaviour - it could establish a network connection and run services such as ssh, but persistent connections such as http and sftp failed. The _only_ reason I was finally able to narrow it down to MAC addresses was that I found this thread, and discovered how to reset my powerbook's MAC address. I was then able to exactly duplicate the FC5 box's network settings on my PB. Lo and Behold, it _didn't_ have the problem - so that meant it was a problem in the box, not with the setup of the network itself. Shortly afterward, I deduced that it had to be the MAC address itself. Turns out that if you set the MAC address under FC5 in upper case - AA:BB:CC:DD:EE:FF - it screws up, at least with my driver. If you set it up in lower case - aa:bb:cc:dd:ee:ff - it works fine. I assume that the driver returns lower case, and some stupid code somewhere is case-sensitive and returns a mismatch if upper case is entered. I doubt I would _ever_ have found this bug, and would have continued to blame the problem on my network managers, if not for this thread.



[ Reply to This | # ]
10.3: Change Ethernet MAC address from the Terminal
Authored by: xcham on Jul 11, '04 12:00:05PM

If i'm sitting in some random spot with my iBook leeching off god knows whose open Wi-Fi network, I'd rather them not have any unique information about me. Thus it'd be good to be able to periodically change the MAC address, simply to protect my privacy.



[ Reply to This | # ]
10.3: Change Ethernet MAC address from the Terminal
Authored by: nobody on Nov 10, '03 04:47:26PM

Other Machine which is able to change the MAC address:
Just tried the Command on a Dual G5, works.
Even if in the Network Control Panel the old MAC shows up, the ARP cache table from a remote Machine in the Network shows the changed MAC after a successful ping.



[ Reply to This | # ]
10.3: Change Ethernet MAC address from the Terminal
Authored by: chamud on Jan 17, '04 07:45:29PM

i have tried it with my g4 ibook. the ifconfig command shows the changes of the MAC address but in the gui there is still the old one. as well as i cant connect to the internet.

does anyone know something about it?

thanks andreas



[ Reply to This | # ]
10.3: Change Ethernet MAC address from the Terminal
Authored by: saschxd on Mar 04, '04 11:39:31AM

nope, it doesn't work with an airport card, at least not with this command under osx 10.3 ...

anyone find a solution ?
if u do a ifconfig, u will see the MAC address of the airport card is (at least it looks like 2 me) NOT in hex format ?
maybe it has to do with this ?



[ Reply to This | # ]
10.3: Change Ethernet MAC address from the Terminal
Authored by: plist on May 08, '04 11:16:20AM

I tried this one. In the Terminal ist was accepted without error message but it didn't change the MAC address. Exchanging "ether" with "lladdr" didn't help either.



[ Reply to This | # ]
10.3: Change Ethernet MAC address from the Terminal
Authored by: GlowingApple on Aug 20, '04 10:36:43AM

While we're on the topic of different types of NIC's, can anyone tell me what the gif0 and stf0 devices are? I have a G4 1.25gHz PowerBook. There is also the firewire port (fw0), the ethernet port (en0), the airport (en1), and the typical loopback (lo0). I would assume one is bluetooth, but I'm not really sure which one. Looks like from ifconfig, the gif0 supports PTP an multicast. The stf0 doesn't seem to support any protocols from what I can tell.

---
Jayson

When Microsoft asks you, "Where do you want to go today?" tell them "Apple."



[ Reply to This | # ]
10.3: Change Ethernet MAC address from the Terminal
Authored by: chris_on_hints on Aug 20, '04 02:54:08PM

You were asking about strange network codes:

i use 'MenuMeters' to give me a menubar readout of processor useage and the network. it provides a drop down menu with all the network connections, with their codes and their full name / descriptions. try that?



[ Reply to This | # ]
10.3: Change Ethernet MAC address from the Terminal
Authored by: thetatorment on Oct 15, '04 01:08:03PM

i'm on 10.3.5 and am trying to do this hack on my old g4. but everytime i try i get a : ifconfig: ioctl (SIOCAIFADDR): permission denied
message returned to me. i AM indeed the administrator on my machine so i don't know why i wouldn't have permission. does anyone know how i can get around this? like is there some special preference or permission i have to set up for terminal commands or something??? any help/input would be GREATLY appreciated! thanks to all of you in advance!
CHEERS!!!



[ Reply to This | # ]
you must type SUDO
Authored by: t3hl33t on Oct 22, '04 04:12:41AM

If you don't type the sudo it gives you that. You need to type sudo before it or you will get
ioctl (SIOCAIFADDR):permission denied

Also, this does work, the ip in the GUI will not change because it doesn't refresh.

Try this and see if it works
Open a terminal window and run these commands

sudo ifconfig en0 ether
(write down the number after ether, this is your mac address)
sudo ifconfig en0 ether <enter a new mac address here>
sudo ifconfig en0 ether
(compare the number with the written down one)



[ Reply to This | # ]
10.3: Change Ethernet MAC address from the Terminal
Authored by: soccerpro21@eart on Dec 27, '04 11:19:27PM

Hi,
I was just wondering if anyone knows if this will fool the mac address tracking system on Gameranger if you have been banned, as I have. Any help is greatly appreciated.

Thanks!



[ Reply to This | # ]
10.3: Change Ethernet MAC address from the Terminal
Authored by: shaoyeh on Feb 04, '05 12:01:53PM

i can't seem to get this to work, i ran

sudo ifconfig en0 ether xx:xx:xx:xx:xx:xx

there was no error and subsequent 'ifconfig en0' showed the changed MAC address.

but when i tried to obtain an IP thru DHCP from my router, it timed out and assigned itself an IP. my router is not set to do any MAC filtering. does anyone else have this problem?

i'm currently using 10.3.7.

also, when i used the sudo ifconfig command to change back to my original MAC, it grabbed an IP just fine.



[ Reply to This | # ]
Somewhat of a workaround
Authored by: rayhaque on Mar 02, '06 07:53:26AM

While this is a *nasty* solution to your inability to change your MAC address, it does work. I have found that you can always change the MAC of your internal nic ... but not the MAC of your Airport card. One would think that the hardware doesn't allow it. But ... this is just the OS not wanting to do it.

Case in point: Dowload Ubunutu Linux, and change the MAC of your Airport card. It will let you. If you don't want to blow away OS X and replace it with Ubuntu linux, I don't blame you. But unlike other distro's, they actually make a bootable Live version FOR the PowerPC Mac (G3 to G5). I booted it up on a G3 iBook with 128MB of RAM (the minimum). It was PAINfully slow. But I was able to change the MAC with `ifconfig eth1 hw ether 00:00:00:00:00:00` and then test to see that it was successful. Of course, you must down the interface first with `ifconfig eth1 down`. Otherwise you get "device is busy" errors.

Anyways, hope that helps someone out.

Get Ubununtu from a mirror at ... http://www.ubuntu.com/download Note that NOT all mirrors have the PPC Live distro. You may have to check out a few before you find one that has it.

At the time of this post ... this link still worked ...
http://mirrors.unixfu.net:81/Ubuntu/5.10/ubuntu-5.10-live-powerpc.iso

ENJOY!



[ Reply to This | # ]
10.3: Change Ethernet MAC address from the Terminal
Authored by: n8gray on Dec 20, '07 11:38:54AM

Doesn't work in Leopard AFAICT.



[ Reply to This | # ]
10.3: Change Ethernet MAC address from the Terminal
Authored by: cvetko on Mar 11, '08 02:36:58AM

This doesn't work for wired MAC address, under Mac OS X any more.
Does anyone knows another way of doing this?



[ Reply to This | # ]