Every network card in your Mac, whether it’s for Ethernet, Wi-Fi, or even Thunderbolt, has been assigned a unique identifier called a Media Access Control or MAC address. This address can be used to identify a specific computer when it’s on the Internet, so those individuals who are very concerned about privacy sometimes use what’s called “MAC address spoofing” to temporarily mask the MAC address of the computer they’re using. It’s rare, but it’s one of those things you might need to know someday.
Find the MAC address
First, let’s find the existing MAC address for the connection you’re most likely using — a Wi-Fi connection. This is quite simple; just hold down the Option key on your keyboard, then click on the Wi-Fi icon in the Mac menubar:
This tells us a few things about the Mac we’re on. First, it’s using an interface with the name of
en1 to connect to Wi-Fi. The MAC address is right below that interface name — in this case, it begins with the hexadecimal address
28:f0:76...and I’m going to stop right there because I don’t want to encourage hackers to break into my machine!
If you need to check the MAC address for other network devices, the System Information utility is very helpful. Launch it from Applications > Utilities > System Information, or from the Apple Menu > About This Mac > System Report. In either case, click on Network, then the specific network hardware you wish to find. On my iMac (see image below), the Ethernet card is listed as
en0 with a MAC address beginning with
You can also use the Terminal to find the current MAC address of an interface. Launch Terminal from the Applications > Utilities folder, then type in the command highlighted in yellow below, substituting the correct BSD Device Name (in this case,
Changing the MAC address
Here comes the fun part. Remember, there’s usually no reason for you to change the MAC address unless you have a specific reason to do so. Both of the methods I’m demonstrating here require the use of Terminal. If you’re not comfortable with the OS X command line, perhaps it’s not a good idea to play with MAC addresses…
First, let’s change the MAC address to a specific address. It needs to be twelve hexadecimal numbers in groups of two, separated by colons. For example, something like
14:d2:71:11:57:a6 would work.
Now at the Terminal prompt, (without the quotes) type in “
sudo ifconfig en1 ether 14:d2:71:11:57:a6" and press the return key. In this case, Terminal sets the MAC address of
en1 (which is the Wi-Fi adapter in my iMac) to the address we selected.
The next method changed the MAC address to a randomly chosen address, which is probably the absolute best way to ensure your privacy. Once again in Terminal, type (or copy and paste) the following command, being sure to change the BSD Device Name (en1 or en0) to the interface you wish to change:
openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//' | xargs sudo ifconfig en1 ether
In my example, that selects a random hexadecimal string that fits the required format and then passes that random string to ifconfig to set the MAC address.
Every time you run this command, it generates and sets a new MAC address for the chosen interface. Realize that any time you restart, the MAC addresses revert to the number originally assigned to the interface, so this is by no means permanent. Some privacy fans make this command a script, then have it run each time the Mac is rebooted. That gives them a new MAC address each time they start their computer.
One other thing: editing your MAC address may cause temporary network issues. It’s a good idea to restart that particular network connection after you change the MAC address to ensure a good connection. For Wi-Fi, that’s simple to do — just click the Wi-Fi menubar icon, select Turn Wi-Fi Off, wait a few seconds, then use the same menu to select Turn Wi-Fi On.