Valid_lft 548176sec preferred_lft 61403sec Inet6 AB:AD:AK:AI/64 scope global temporary dynamic Valid_lft 61791sec preferred_lft 61791sec Sample Output: 1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 ip route list | grep defaultĪlternatively, you can also use device name in particular too, but you should know the names of network devices for that. If you are only interested in the default IP address that connects to the internet, use a grep parameter to list that one. It should display all available IP address including device names. Likewise the match-device=interface-name: setting for route list ip route list command usage in Ubuntu 17.10 You can see that name with ip link or nmcli device. You may restrict a profile to an interface by setting connection.interface-name to the name that was given to the device. Regarding predictable interface names: NetworkManager does not (re)name the device, that's commonly done by udev. Likewise, if you edit the default value in nf, you need to reload it with SIGHUP and reactivate the profile. That's explained in man nf.Īfter modifying a profile, you need to reactivate it for the changes to take effect. By editing nf you specify the default value that is used if the per-profile value is unspecified. Usually you would set this per profile, for example via nmcli connection modify "$PROFILE" ethernet.cloned-mac-address 00:22:68:1c:59:b1. Only on D-Bus API it's called ethernet.assigned-mac-address - that has historic reasons. Upon boot of the USB stick on any system, I want NetworkManager to assign a predetermined and fixed MAC address to eth0.Īs said, the property in keyfile format, nmcli, and nf is called ethernet.cloned-mac-address. My use case is that I have installed Lubuntu onto a USB stick. Unfortunately, the above does not seem to work. Thomas Haller's Blog - MAC Address Spoofing in NetworkManager 1.4.0īased on the above documentation, I tried adding something like the below to /etc/NetworkManager/nf: Įthernet.assigned-mac-address=00:22:68:1c:59:b1.I have glanced at the following documentation: I have already disabled that renaming, so I do indeed have an eth0 interface on my system.) (Aside: Yes, I know that by default Ubuntu 18.04 renames eth0 to a "predictable" name like enp1s0. 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. 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Īs of Lubuntu 18.04, this no longer works (because the ifupdown package is not installed by default). For this and other reasons, I expect I will prefer vanilla Ubuntu over any of its derivatives on all my future installs. And the question probably does not apply to Ubuntu itself. (Yay!) Therefore, this question probably only applies to Ubuntu derivatives that have chosen to exclude the ifupdown package from their default install. It appears the package ifupdown is installed by default on Ubuntu 19.04. (Note: As of Feb 2020, I suspect this paragraph may be incorrect and/or out of date.) This week I installed the desktop version of Ubuntu 19.04.
LINUX FIND MAC ADDRESS OF ETH0 INSTALL
In other words, a default install of Ubuntu (maybe 19.10?) may no longer include the ifupdown package.
LINUX FIND MAC ADDRESS OF ETH0 UPDATE
( systemd-networkd may be better, but still has flaws IMO.) Finally, I am no longer confident that my update is correct. I also started configuring the network on most of my systems via systemd-networkd, rather than NetworkManager or netplan. I also realized I may be able to solve my particular problem by reconfiguring my DHCP server to assign IP addresses based on system names, rather than MAC addresses. I never found an elegant way make NetworkManager assign a particular MAC address to the first/only Ethernet adapter on whatever system my disk happened to boot on.