Change your MAC address with macchanger
Give your Wi-Fi or Ethernet card a random hardware address for privacy.
01Command
$ sudo ip link set dev wlan0 down && sudo macchanger -r wlan0 && sudo ip link set dev wlan0 up02What 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
04Undo
$ sudo ip link set dev wlan0 down && sudo macchanger -p wlan0 && sudo ip link set dev wlan0 up05Sources
- MAC address spoofing — Arch WikiEvidence: 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 pageEvidence: 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
One command that prints every interface with its state and IPv4/IPv6 addresses in a short table — the modern, memorable replacement for digging through `ifconfig` or the verbose `ip addr` output.
The classic forgotten-syntax command: `traceroute` shows every router between you and a destination plus the round-trip time of probes to each hop.
Add a UFW rule to permit inbound traffic on a TCP or UDP port, such as SSH on port 22.