0

I am currently trying to change a HWaddr persistently. ifconfig eno0 down, ifconfig eno0 hw ether 01:02:03:04:05:06 and ifconfig eno1 up works fine, but I could not find a way to make this persistent.

I found Changing Network Interfaces name Ubuntu 16.04, which suggests to add net.ifnames=0 biosdevname=0 to GRUB_CMDLINE_LINUX in /etc/default/grub and run update-grub. This did not change anything for me.

Also, like suggested in Configuring a network interface and changing mac adress permanently setting /etc/network/interfaces to

auto lo
iface lo inet loopback
pre-up ifconfig eno1 hw ether 01:02:03:04:05:06

did not work (Hardwareadress just stays the same).

The second advide was to use udev. I tried SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}==01:02:03:04:05:06, ATTR{dev_id}=="0x0", ATTR{type}"=="1", NAME="eno1". While running udevadm control --reload-rules && udevadm trigger --subsystem-match=net seems to change something (as one can see using udevadm control, it does not change the hardware address. After a reboot, the adress also stays the same. Does someone have an idea how to further debug this?

  • If you can change MAC address from command line, why not make a bash script out of your commands and run that script at boot up ? – hatterman Sep 28 '17 at 14:04
  • hatterman is right - taken from above link by George: network device MAC addresses are hardcoded into the device. You can't ever 'permanently' change the MAC address that a device has. What /etc/network/interfaces, MAC Changer, and Network Manager (via the 'cloned MAC address' function) do is they temporarily change the Ethernet address advertised, (...), it needs to be run at boot time. /etc/network/interfaces does this at boot time, but you lose Network Manager management of devices. – d1bro Sep 28 '17 at 14:44

0 Answers0