1

In the (distant?) past, I could assign a MAC address to a network interface by adding the following stanza to to /etc/network/interfaces:

auto         eth0
iface        eth0
  hwaddress  00:12:34:56:78:9a

As of Lubuntu 18.04, this no longer works (because the ifupdown package is not installed by default).

My question is, what configuration file do I edit, and how do I edit it, so that NetworkManager will assign the fixed MAC address of my choice to eth0.

(Aside: Yes, I know that by default Ubuntu 18.04 renames eth0 to a "predictable" name like enp1s0. I have already disabled that renaming, so I do indeed have an eth0 interface on my system.)

I have glanced at the following documentation:

Based on the above documentation, I tried adding something like the below to /etc/NetworkManager/NetworkManager.conf:

[device]
match-device=interface-name:eth0
ethernet.assigned-mac-address=00:22:68:1c:59:b1

Unfortunately, the above does not seem to work.

My use case is that I have installed Lubuntu onto a USB stick. Upon boot of the USB stick on any system, I want NetworkManager to assign a predetermined and fixed MAC address to eth0.

  • as far as i know 18.04 uses netplan Probably this link helps you somehow bugs.launchpad.net/netplan/+bug/1718607 and netplan.io – AlexOnLinux Feb 27 at 0:03
  • The docs says about assigned-mac-address: 'Note that this property only exists in D-Bus API. libnm and nmcli continue to call this property "cloned-mac-address".' So maybe you need cloned-mac-address="00:22:68:1c:59:b1"? – Olorin Feb 27 at 2:57
  • @mpb I wonder is NetworkManager is looking for the 'predictable' interface and not eth0. – Robert Baker Feb 27 at 4:54

Your Answer

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

Browse other questions tagged or ask your own question.