Changing MAC "permanently"?

Magnamuz

New Member
Joined
Apr 18, 2018
Messages
1
Reaction score
1
Credits
0
I have an Ubuntu 14 and have to change the MAC address but with:
Code:
sudo ifconfig eth0 down
sudo ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx
sudo ifconfig eth0 up

it changes back when I restart (or power goes off and starts itself back). Is there an easy way to change it permanently by console?
 


HI @Magnamuz, and welcome. At the bottom of this page, it gives this info that may help you:

On Debian, Ubuntu, and similar systems, place the following in the appropriate section of /etc/network/interfaces (within an iface stanza, e.g., right after the gateway line) so that the MAC address is set when the network device is started:
Code:
hwaddress ether 02:01:02:03:04:08  #with your own mac address, of course

You will probably have to edit the /etc/network/interfaces as root (or using sudo). Save the file and reboot to see if it works.

Good luck!
 
Just a note on the above "sleepless beastie" reference (& nice find, Capta :)) for The Viewers - where it says

Code:
sudo service networking restart

... if you are using a version of Ubuntu from 15.10 on, systemd replaced the upstart init process, and you would use

Code:
sudo systemctl restart networking

... note the syntax. The OP should be OK with it, as he is using 14.04 'Trusty Tahr'.

And welcome to linux.org @Magnamuz :D

Chris Turner
wizardfromoz
 


Top