0

I would like to change the mac address on boot. How does one randomize or set a particular MAC address in Ubuntu 16.04? I have searched but other threads are for older versions of Ubuntu and don't seem to work.

Thanks

2
  • You can set a MAC address in Network Manager.
    – Pilot6
    Feb 22, 2017 at 20:30
  • Yes. However I would like to have the MAC address set at boot. Plus I am led to believe that Network Manager resets the MAC address when connecting.
    – rancher
    Feb 24, 2017 at 23:15

1 Answer 1

0

I received an answer from th great .

I hope this helps someone else

As noted in the Ubuntu Forum guide, Network Manager resets changes made by macchnager. Did you know that as of Network Manager 1.4, you can generate a random MAC address upon each connection?

Ubuntu 16.04 has Network Manager 1.2 unfortunately. You can replace it with wicd. To change MAC address at startup, you can create a systemd service file.

sudo nano /etc/systemd/system/macspoof.service

Put the following text into the file. Replace %i with your network interface name.

[Unit] Description=macchanger on %i Wants=network-pre.target Before=network-pre.target BindsTo=sys-subsystem-net-devices-%i.device After=sys-subsystem-net-devices-%i.device

[Service] ExecStart=/usr/bin/macchanger -e %i Type=oneshot

[Install] WantedBy=multi-user.target

Save and close the file. Then enable this service.

sudo systemctl enable macspoof.service

Restart your computer and you will have a spoofed MAC address.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .