Change your MAC address with macchanger

Give your Wi-Fi or Ethernet card a random hardware address for privacy.

LinuxmacchangernetworkmacMedium risk
Take the interface down, run sudo macchanger -r wlan0 to set a random MAC, then bring it back up; -p restores the original.

01Command

Command
$ sudo ip link set dev wlan0 down && sudo macchanger -r wlan0 && sudo ip link set dev wlan0 up

02What it does

A MAC address identifies your device to the local network, and coffee-shop or airport Wi-Fi use it to track and remember devices. macchanger swaps it for a random one while the interface is down, and NetworkManager re-connects under the new identity. The change lasts until reboot; -p puts the factory address back.

03Risk

RiskMedium risk
Requirementsmacchanger installed (Debian/Ubuntu: sudo apt install macchanger)
!Warning: Changing your MAC on a corporate or campus network may violate policy and get you flagged; also expect a temporary disconnection and a fresh DHCP lease.

04Undo

Undo
$ sudo ip link set dev wlan0 down && sudo macchanger -p wlan0 && sudo ip link set dev wlan0 up

05Sources

  • MAC address spoofing — Arch Wiki
    Arch Linux · community · 2026-09-17
    Evidence: The interface must be brought down before changing its MAC address; macchanger is the standard tool and -p restores the permanent address.
  • macchanger(1) — Ubuntu manual page
    Ubuntu · community · 2026-09-17
    Evidence: macchanger -r sets a fully random MAC address and -p restores the original permanent hardware address; the interface must be down.

Last verified: 2026-09-18 · Category: Network

06Related solutions