With Ubuntu 14.04 when I wanted to connect to a network using a different mac address I would run the following commands

sudo service network-manager stop
sudo ifconfig $interface down
sudo macchanger -m <mac_addresse> $interface
sudo ifconfig $interface up
sudo service network-manager start

This would assign a new mac address which persisted after network-manager was restarted and a new connection to the network was made.
now, on Ubuntu 16.04, after running those same commands using

  • sudo macchanger -m 00:60:1B:EB:F8:73 wlp2s0

I then restart network-manager but not connected to the network yet, the new macchanger assigned mac address persists i.e.

% nmcli dev show wlp2s0
GENERAL.DEVICE:                         wlp2s0
GENERAL.TYPE:                           wifi
GENERAL.HWADDR:                         00:60:1B:EB:F8:73
      address assigned by macchanger -->^^^^^^^^^^^^^^^^^
GENERAL.MTU:                            0
GENERAL.STATE:                          30 (disconnected)
GENERAL.CONNECTION:                     --
GENERAL.CON-PATH:                       --

but the moment I connect to a network, the mac address is reset back to the original hardware mac address. after making connection to the network

% nmcli  dev show wlp2s0
GENERAL.DEVICE:                         wlp2s0
GENERAL.TYPE:                           wifi
GENERAL.HWADDR:                         E0:06:E6:A3:2C:A7
   mac is back to original hardware  -->^^^^^^^^^^^^^^^^^

GENERAL.MTU:                            1500
GENERAL.STATE:                          100 (connected)
GENERAL.CONNECTION:                     lowfi
GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/ActiveConnection/0
IP4.ROUTE[1]:                           dst =, nh =, mt = 1000

How can I make the macchanger assigned mac address persist when connecting to the network using the command line?


1 Answer 1


You could use nmcli to temporarily change your mac address:

nmcli connection modify --temporary <connection_name> 802-11-wireless.cloned-mac-address 00:60:1B:EB:F8:73
nmcli connection up <connection_name>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.