The Privacy Feature Paradox
A Media Access Control (MAC) address is a unique hardware identifier for your computer’s network interface card. Modern versions of Ubuntu, leveraging NetworkManager, include a privacy feature called “MAC Address Randomization.” When you connect to a public Wi-Fi network, Ubuntu will automatically generate and use a fake, randomized MAC address instead of your real hardware address. This prevents advertisers and network admins from tracking your physical laptop across different cafes or airports. However, this feature breaks connectivity entirely if you are on a corporate or university network that relies on strict MAC address whitelisting, or if your home router uses static IP assignment based on MAC addresses.
Disabling MAC Randomization in NetworkManager
To stop Ubuntu from automatically changing your MAC address and force it to use your permanent hardware address, you must modify the global NetworkManager configuration.
Open your terminal (`Ctrl + Alt + T`). You need to create or edit a configuration file for NetworkManager. Use a text editor with root privileges by typing: sudo nano /etc/NetworkManager/conf.d/disable-randomization.conf (if the file doesn’t exist, nano will create it). In this new, blank file, paste the following three lines of configuration code exactly:
[device]
wifi.scan-rand-mac-address=no
[connection]
wifi.cloned-mac-address=permanent
Press Ctrl + O and then Enter to save the file, then press Ctrl + X to exit nano. To apply this permanent rule, you must restart the network service. Type sudo systemctl restart NetworkManager and press Enter. Ubuntu will immediately drop its current Wi-Fi connection, reconnect, and broadcast your true, permanent, physical MAC address to the router.