User Tools

Site Tools

diy:change-mac

This is an old revision of the document!


How To Change Your MAC Address

A MAC address (which is short for medium access control address) is the unique identifier assigned to pretty much every network interface controller. The ethernet jack and the wifi adapter on your computer each have their own MAC address.

On networks (such as your home network, or the wifi network at Starbucks) the MAC address is typically used by the network to identify and track individual machines. This means that your machine can be tracked not only every time it logs in to the same network, but it can be tracked across other networks as well. You can hinder this by changing your MAC address, or configuring it to use a random MAC.

There are more than just privacy benefits to changing your MAC address. Some networks which provide only a limited amount of free access for guests, can have the timer reset if you disconnect, clear your browser cookies/cache, and reconnect with a new MAC. This can get you around bans on some services as well.

MAC addresses are typically burned into the firmware of the network controller from the factory. In the past, this sometimes made them very hard to change, but this is less of a problem with modern operating systems.

Scroll down for instructions for your particular system.

Linux/BSD/Mac Instructions

Manually, with ifconfig

ifconfig (short for “interface config”) is a command-line network management utility that has been in use on Unix-like systems since 1983. Many alternatives have come and gone, but ifconfig remains the de facto standard on most BSD, MacOS and Linux machines.

Run ifconfig to find your network adapter name:

$ ifconfig

There is a high chance it will be something like wlan0, but it can be anything. If you want, make note of the current MAC address under the ether line, or just look it up with grep:

$ ifconfig wlan0 | grep ether

And it will output the current address, like ether 00:01:02:03:04:05.

Set the value to any MAC address you want, like so:

$ sudo ifconfig wlan0 ether 00:e2:e3:e4:e5:e6

Use grep again to verify the change went through:

$ ifconfig wlan0 | grep ether

And it should output ether 00:e2:e3:e4:e5:e6 instead of the value before.

Note that this method is not persistent. Reboot to reset.

Manual MAC Generation

If you need help coming up with a random MAC, you can generate a string to use with this command:

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

Linux Instructions

Automatically, with NetworkManager

Most of you using Linux will likely have NetworkManager installed already. To set-and-forget your machine to automatically generate & provide a random MAC address every time you connect to a network, save the following file to /etc/NetworkManager/conf.d/:

random-mac.conf
##############################################################
## RANDOM MAC DROP-IN CONFIGURATION FILE FOR NETWORKMANAGER ##
## PROVIDED BY THE ANONYMOUS MILITARY INSTITUTE             ##
## HTTPS://BESTPOINT.INSTITUTE/DIY/CHANGE-MAC               ##
##############################################################
 
[device-mac-randomization]
# "yes" is already the default for scanning, but set it anyways.
wifi.scan-rand-mac-address=yes
 
[connection-mac-randomization]
# Randomize MAC for every ethernet connection.
ethernet.cloned-mac-address=random
# Generate a random MAC for each WiFi connection.
wifi.cloned-mac-address=random

Then reboot, or reset NetworkManager:

$ sudo service NetworkManager restart

Automatically, with iwd

If you are using iwd and its built-in network configuration without NetworkManager, set the following two lines under [General] in /etc/iwd/main.conf:

[General]
AddressRandomization=once
AddressRandomizationRange=full

Manually, with GNU MAC Changer

Before NetworkManager had flawless MAC randomization built in, the preferred Linux utility was GNU MAC Changer. You can find it at alobbs/macchanger, or for most Debian-based systems with apt install macchanger.

Mac Instructions

This section needs expansion. You can help by adding to it.

Windows Instructions

This section needs expansion. You can help by adding to it.

Android Instructions

This section needs expansion. You can help by adding to it.

diy/change-mac.1717650520.txt.gz · Last modified: (external edit)

Find this page online at: https://bestpoint.institute/diy/change-mac