How do I get NetworkManager to assign a fixed MAC address to eth0?












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:





  • The Gnome NetworkManager.conf documentation


  • The Gnome nm-settings documentation

  • Thomas Haller's Blog - MAC Address Spoofing in NetworkManager 1.4.0


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.










share|improve this question

























  • 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
















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:





  • The Gnome NetworkManager.conf documentation


  • The Gnome nm-settings documentation

  • Thomas Haller's Blog - MAC Address Spoofing in NetworkManager 1.4.0


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.










share|improve this question

























  • 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














1












1








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:





  • The Gnome NetworkManager.conf documentation


  • The Gnome nm-settings documentation

  • Thomas Haller's Blog - MAC Address Spoofing in NetworkManager 1.4.0


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.










share|improve this question
















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:





  • The Gnome NetworkManager.conf documentation


  • The Gnome nm-settings documentation

  • Thomas Haller's Blog - MAC Address Spoofing in NetworkManager 1.4.0


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.







networking lubuntu network-manager configuration






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 27 at 2:47









Olorin

1




1










asked Feb 26 at 22:36









mpbmpb

47039




47039













  • 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



















  • 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

















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





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





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





@mpb I wonder is NetworkManager is looking for the 'predictable' interface and not eth0.

– Robert Baker
Feb 27 at 4:54










0






active

oldest

votes












Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1121523%2fhow-do-i-get-networkmanager-to-assign-a-fixed-mac-address-to-eth0%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1121523%2fhow-do-i-get-networkmanager-to-assign-a-fixed-mac-address-to-eth0%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

Mangá

 ⁒  ․,‪⁊‑⁙ ⁖, ⁇‒※‌, †,⁖‗‌⁝    ‾‸⁘,‖⁔⁣,⁂‾
”‑,‥–,‬ ,⁀‹⁋‴⁑ ‒ ,‴⁋”‼ ⁨,‷⁔„ ‰′,‐‚ ‥‡‎“‷⁃⁨⁅⁣,⁔
⁇‘⁔⁡⁏⁌⁡‿‶‏⁨ ⁣⁕⁖⁨⁩⁥‽⁀  ‴‬⁜‟ ⁃‣‧⁕‮ …‍⁨‴ ⁩,⁚⁖‫ ,‵ ⁀,‮⁝‣‣ ⁑  ⁂– ․, ‾‽ ‏⁁“⁗‸ ‾… ‹‡⁌⁎‸‘ ‡⁏⁌‪ ‵⁛ ‎⁨ ―⁦⁤⁄⁕