By default, Ubuntu’s Network Manager uses a feature called “MAC Address Randomization.” When your laptop scans for or connects to a Wi-Fi network, it temporarily spoofs its hardware MAC address, presenting a random, fake address to the router. This is an excellent privacy feature for public Wi-Fi (like coffee shops or airports), preventing tracking companies from following your physical device across different locations.
However, MAC randomization completely breaks enterprise and home networks that rely on MAC filtering for security or static IP assignment. If your office router is configured to only allow specific, whitelisted laptops to connect, your Ubuntu machine will constantly be rejected because it generates a new, unrecognizable address every time it tries to connect. You must disable randomization to restore network stability.
How to Disable Wi-Fi MAC Randomization in Ubuntu
You must edit the Network Manager configuration file to force it to use your permanent hardware address.
- Open the Terminal (Ctrl + Alt + T).
- You need to create or edit the Network Manager configuration file using a text editor with root privileges. Run the following command:
sudo nano /etc/NetworkManager/conf.d/disable-randomization.conf - The nano text editor will open a blank file (or an existing one). Copy and paste the following two lines into the file:
[device] wifi.scan-rand-mac-address=no - Save the file by pressing Ctrl + O and then Enter.
- Exit nano by pressing Ctrl + X.
- To apply the changes, restart the Network Manager service by running:
sudo systemctl restart NetworkManager
Your Wi-Fi connection will briefly drop and reconnect. From now on, your Ubuntu machine will always broadcast its true, permanent hardware MAC address, allowing it to bypass strict MAC filters and reliably acquire static IP addresses from your router.