How to change the MAC address of our Mac using the terminal

A few days ago, we saw how with iOS 14, iPadOS 14 and watchOS 7 Apple gives us the ability to hide the MAC address of our network card to prevent Wi-Fi providers from following us. While this feature hasn’t reached the Mac, at least for now, a simple Terminal command is enough to achieve the same effect.

Hello, my name is a1: b1: c1: d1: e1: f1

When we connect to a Wi-Fi network, the access point with which we do it, which in our house is the router, you need to identify our device. Because? Because you need to know what traffic to direct to each device, so it is important to distinguish between them.

For this distinction, the MAC (Media Access Control) address is used, which could be understood as the license plate of the network card. This license plate is built into the making of the same card and never changes, it is therefore possible that the network operator or other observers on the network associate our device with certain data. A relationship that encompasses both network activity, such as DNS requests, as well as our location in various access points, such as a museum and its various rooms.

Changing the MAC address of our network card is quite simple, The steps are as follows:

  • We open the app Terminal on our Mac.
  • Copier et coller: sudo ifconfig en0 ether $ (openssl rand -hex 6 | sed ‘s / (..) / 1: / g; s /.$//’)
  • We press Enter (↩︎).
  • We write down our computer password.
  • We press Enter again.

If instead of a random MAC we want to use our own address, we can use the command « sudo ifconfig en0 ether Where the address will need a1: b1: c1: d1: e1: f1 format. Once the change is made, a simple click on the Wi-Fi icon in the menu bar while holding down the key option will show the new address at the top of the menu. For now, it seems that this system still does not work on macOS Big Sur which, on the other hand, is still in beta.

Here’s Tim Cook at Apple according to a WSJ profile

Simple and efficient, whether it’s to spend a little more time on the airport’s Wi-Fi or because we just don’t want the network operator to be able to meet us every time we go to Starbucks for working with our Mac, Terminal is at our disposal.