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
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
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.