Mac Apps

Change your hard-coded MAC address – without additional software

Your Mac has a media access control address (confusingly for Mac users, it’s called the MAC address) that uniquely identifies your laptop.

This string of letters and numbers is hard-coded into your device in the factory, so it’s impossible to change on a permanent basis. However, you can change this fingerprint temporarily, using a technique known as spoofing.

In this article I’m going to cover the reasons why you might want to spoof your MAC, before showing you how to generate a new address using macOS’ Terminal app.


Why should I spoof my MAC address?

There’s many reasons why you might want to change your MAC address, but here’s some of the most common ones:

Accessing a protected network

For increased security, some networks only accept connection requests from devices that have a pre-approved MAC address. If this is a network you use regularly, then ideally your Mac should already be registered as a valid connection, but if it isn’t, then you’ll need to spoof your address before connecting to that network.

Free Wi-Fi, for longer

Free public Wi-Fi is great, but it’s becoming increasingly common for these networks to be capped. Cafes, hotels, airports, and many other places that offer free Wi-Fi, are starting to block users once they reach a specific time or data limit.

If you find yourself unceremoniously kicked off a network, then you can often trick that network into seeing you as a new user, by changing your MAC address. Just make sure you play fair – spoofing your address so that you can quickly finish off a task is unlikely to inconvenience anyone, but you don’t want to be the person who spends hours hogging the free Wi-Fi at your local cafe!

Keep you private browsing, private

Tracking your MAC address is one of the ways that third parties can gather information about your online activities. Generating a new MAC address from time to time can make it more difficult for these third parties to track your browsing history.

Checking your hard-coded MAC address

You can change your MAC address via the Terminal, but since this information is hard-coded, your device will revert to its original MAC address upon restart. This automatic reset means you can always restore your Mac’s original address with a simple reboot. However, if you want the option of restoring the original address without restarting your Mac, then you’ll need to enter the original address into the Terminal.

If this sounds like something you might want to do, then you should make a note of your MAC address before you start the spoofing process. You can check your Mac’s hard-coded address, either via the Terminal or the System Preferences app.

System Preferences

  • Select the ‘Apple’ logo from the menu bar.
  • Select ‘Network.’
  • In the left-hand menu, make sure ‘Wi-Fi’ is selected.
  • Click the ‘Advanced…’ button.

  • Select ‘Hardware.’
  • Make a note of the ‘MAC address’ value.

Terminal

  • Launch your Mac’s Terminal, by navigating to ‘Applications > Utilities > Terminal.’
  • Type the following command into the Terminal:

ifconfig en1 | grep ether

  • Press the ‘Enter’ key on your keyboard. This returns your current MAC address – make a note of this value.

Change your MAC address

To generate a new MAC address at random, type the following command into your Mac’s Terminal and then press the ‘Enter key on your keyboard:

openssl rand -hex 6 | sed ‘s/\(..\)/\1:/g; s/.$//’ | xargs sudo ifconfig en0 ether

Your Mac will now be using a new address! If you want to check what this address actually is, then simply run the following Terminal command:

ifconfig en1 | grep ether

To switch back to your original address at any point, either restart your computer or enter the original MAC address into the Terminal, using the following command:

sudo ifconfig en0 ether your-MAC-address

Before you go

After spending over 20 years working with Macs, both old and new, theres a tool I think would be useful to every Mac owner who is experiencing performance issues.

CleanMyMac is highest rated all-round cleaning app for the Mac, it can quickly diagnose and solve a whole plethora of common (but sometimes tedious to fix) issues at the click of a button. It also just happens to resolve many of the issues covered in the speed up section of this site, so Download CleanMyMac to get your Mac back up to speed today.

mac-pc

About the author

Jessica Thornsby

Jessica Thornsby is a technical writer based in Sheffield. She writes about Android, Java, Kotlin and all things Apple. She is the co-author of O'Reilly's "iWork: The Missing Manual," and the author of "Android UI Design," from Packt Publishing.

Add Comment

Click here to post a comment

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.