What is a MAC Address?
A MAC (Media Access Control) address is a unique 48-bit identifier hardcoded into your network interface controller (NIC) by the manufacturer. It's written as six pairs of hexadecimal digits separated by colons — something like aa:bb:cc:dd:ee:ff.
Every device that connects to a network has a MAC address. Your router uses it to identify devices on the local network, and it can also be used to track your device as you move between WiFi networks — which is one of the main reasons you might want to change it. (On macOS, see how to spoof your MAC address; for broader privacy, learn to remove your personal info from data brokers.)
The first three bytes (24 bits) of a MAC address are called the OUI (Organizationally Unique Identifier), which identifies the manufacturer. For example, Intel, TP-Link, and Alfa each have their own OUI prefixes. The last three bytes are unique to the specific device.
Why Change Your MAC Address?
There are several legitimate reasons to spoof your MAC address:
- Privacy on public WiFi: Prevent tracking across networks at airports, coffee shops, and hotels
- Penetration testing: Bypass MAC-based access controls during authorized security assessments
- Evade network monitoring: Avoid detection by intrusion detection systems during authorized tests
- Bypass network restrictions: Some networks whitelist specific MAC addresses — useful when testing MAC filtering
- Troubleshooting: Impersonate another device to diagnose connectivity issues on your own network
Prerequisites
Before you start, make sure you have:
- Kali Linux installed (bare metal, USB, or VirtualBox)
- Root or sudo access
- A wired (Ethernet) or wireless (WiFi) network interface
Installing Macchanger
Macchanger (GNU MAC Changer) comes pre-installed on Kali Linux. To verify it's available — or install it if it's missing — run:
During installation, you'll be asked whether macchanger should automatically change your MAC address every time a network interface is brought up or plugged in.
Select "No" for manual control over when your MAC changes
After installation, you can verify macchanger is working by running macchanger -h to see the help menu:
The macchanger help menu with all available flags
Identifying Your Network Interface
Before changing your MAC address, you need to know the name of your network interface. Use the ip link show command to list all interfaces:
Common interface names include eth0 for wired Ethernet and wlan0 for WiFi. Your system may use different names — just use whatever appears in your output.
ifconfig command still works on Kali but is considered deprecated. The modern replacement is ip link, which is part of the iproute2 package and is actively maintained. This guide uses ip commands throughout.
You can also view your current MAC address using macchanger itself:
Changing Your MAC Address
The process has three steps: bring the interface down, change the MAC, and bring it back up. You must bring the interface down first — otherwise you'll get a "device is busy" error.
Step 1: Bring the interface down
Step 2: Change the MAC address
Macchanger gives you several options depending on what you need. Here's a quick reference:
| Flag | Command | What It Does |
|---|---|---|
-r |
macchanger -r wlan0 |
Fully random MAC (no real vendor prefix) |
-a |
macchanger -a wlan0 |
Random vendor MAC of the same device type |
-A |
macchanger -A wlan0 |
Random vendor MAC of any device type |
-m |
macchanger -m XX:XX:XX:XX:XX:XX wlan0 |
Set a specific MAC of your choice |
-e |
macchanger -e wlan0 |
Randomize but keep the vendor bytes |
-p |
macchanger -p wlan0 |
Reset to original permanent hardware MAC |
The most common option is -r for a fully random MAC:
If you want to set a specific MAC address (for example, to impersonate a specific device during an authorized test):
-A instead of -r if you want a random MAC that uses a real vendor OUI prefix. A fully random MAC can sometimes be identified as spoofed because the OUI won't match any known manufacturer. Using -A makes the address look more legitimate.
Step 3: Bring the interface back up
Your MAC address has been changed. The "Permanent MAC" always shows your original hardware address, while "Current MAC" shows the spoofed one.
Viewing Known MAC Vendors
If you want to set a specific MAC address that matches a real manufacturer, macchanger includes a database of known vendor OUI prefixes. You can search it with the -l flag:
Changing MAC Address Manually (Without Macchanger)
If macchanger isn't available, you can change your MAC address using the ip command directly:
Making the Change Persist Across Reboots
By default, your MAC address resets to the permanent hardware value after a reboot. To make the change persist, you have a few options:
Option 1: Systemd service (recommended)
Create a systemd service that runs macchanger at boot:
Then enable it for your interface:
Option 2: rc.local (simple but deprecated)
Add the commands to /etc/rc.local before exit 0:
Frequently Asked Questions
Can a spoofed MAC address be detected?
Yes, in some cases. A fully random MAC (using -r) may have an OUI that doesn't match any real manufacturer, which could flag it as spoofed. Using -A instead assigns a real vendor prefix, making the address harder to detect. Some advanced network monitoring tools can also detect MAC spoofing by looking for duplicate MAC addresses on the network.
Does changing my MAC address also change my IP address?
Not directly. However, if your network uses DHCP (most do), bringing the interface down and back up will typically trigger a new DHCP lease request, which may result in a different IP address being assigned.
Does this work with USB WiFi adapters?
Yes. Replace wlan0 with whatever interface name your USB adapter uses. You can find it with ip link show. Some adapters may use names like wlan1 or something vendor-specific. For recommended USB adapters, see our guide on the best WiFi adapters for Kali Linux.
Why do I get "device busy" or "insufficient permissions" errors?
Two common causes: either you forgot to bring the interface down first (run sudo ip link set wlan0 down before macchanger), or you're not running the command as root. Always use sudo.
Will my MAC address stay changed after a reboot?
No — unless you set up a systemd service or rc.local script (see the "Making the Change Persist" section above). By default, macchanger only changes the MAC for the current session.
What's the difference between macchanger -a, -A, and -r?
-r sets a fully random MAC with no real vendor. -A sets a random MAC using a real vendor prefix of any type. -a sets a random MAC using a real vendor prefix of the same device type as your current adapter. Use -A for the best balance of randomness and realism.
