0

After a power cycle, I'm unable to see my ethernet interfaces in ifconfig with the following netplan configuration. ethMine shows up in ip link show, but is not upped.

$ cat /etc/netplan/01-netcfg.yaml 
network:
  version: 2
  renderer: networkd
  ethernets:
    enp38s0f1:
      addresses: [192.168.1.21/24]
      match:
        macaddress: 80:fa:5b:xx:xx:xx
      set-name: ethMine
      nameservers:
        addresses: [8.8.8.8, 8.8.4.4]
      optional: true
  vlans:
    ethMine.200:
      id: 200
      link: ethMine
      addresses: [192.168.1.121/24]
  wifis:
    wlx7ca7b0bbf9f1:
      addresses: [10.10.10.15/24]
      gateway4: 10.10.10.1
      nameservers:
        addresses: [8.8.8.8, 8.8.4.4]
      access-points:
        "myssid":
          password: "mypasswd"
  • On Ubuntu desktop.
  • There are no other netplan configs.
  • /etc/network/interfaces is commented out
$ dmesg | grep ethMine
[    2.881002] r8169 0000:26:00.1 ethMine: renamed from enp38s0f1

On reboot, I see ethMine in ip link show, but it is not up and visible in ifconfig. ethMine.200 does not exist.

systemd logs:

Jul 20 12:47:08 lappy systemd[1]: Starting Network Service...
Jul 20 12:47:08 lappy systemd-networkd[383]: Enumeration completed
Jul 20 12:47:08 lappy systemd[1]: Started Network Service.
Jul 20 12:47:08 lappy systemd-networkd[383]: enp38s0f1: Interface name change detected, enp38s0f1 has been renamed to ethMine.
Jul 20 12:47:08 lappy systemd-networkd[383]: wlan0: Interface name change detected, wlan0 has been renamed to wlx7ca7b0bbf9f1.
Jul 20 12:47:08 lappy systemd-networkd[383]: wlx7ca7b0bbf9f1: IPv6 successfully enabled
Jul 20 12:47:08 lappy systemd-networkd[383]: lo: Link is not managed by us
Jul 20 12:47:08 lappy systemd-networkd[383]: ethMine: Link is not managed by us

sudo systemctl restart systemd-networkd causes ethMine to be upped, but still no vlan with logs:

l 20 12:52:02 lappy systemd[1]: Stopping Network Service...
Jul 20 12:52:02 lappy systemd[1]: Stopped Network Service.
Jul 20 12:52:02 lappy systemd[1]: Starting Network Service...
Jul 20 12:52:02 lappy systemd-networkd[5975]: wlx7ca7b0bbf9f1: Gained IPv6LL
Jul 20 12:52:02 lappy systemd-networkd[5975]: Enumeration completed
Jul 20 12:52:02 lappy systemd[1]: Started Network Service.
Jul 20 12:52:02 lappy systemd-networkd[5975]: wlx7ca7b0bbf9f1: IPv6 successfully enabled
Jul 20 12:52:02 lappy systemd-networkd[5975]: ethMine: Link is not managed by us
Jul 20 12:52:02 lappy systemd-networkd[5975]: lo: Link is not managed by us
Jul 20 12:52:02 lappy systemd-networkd[5975]: ethMine: IPv6 successfully enabled
Jul 20 12:52:02 lappy systemd-networkd[5975]: lo: Link is not managed by us
Jul 20 12:52:02 lappy systemd-networkd[5975]: ethMine: Link UP
Jul 20 12:52:03 lappy systemd-networkd[5975]: wlx7ca7b0bbf9f1: DHCPv4 address 10.53.189.98/24 via 10.53.189.1
Jul 20 12:52:03 lappy systemd-networkd[5975]: wlx7ca7b0bbf9f1: Configured

netplan.io version in Ubuntu 18.04.4 LTS desktop:

$ dpkg -s netplan.io | grep '^Version:'
Version: 0.99-0ubuntu3~18.04.3

These manual steps work post boot:

sudo ip link set enp38s0f1 down
sudo ip link set enp38s0f1 name ethMine
sudo ip link set ethMine up
sudo ip addr add 192.168.1.21/25 dev ethMine

sudo ip link add link ethMine name ethMine.200 type vlan id 200
sudo ip addr add 192.168.1.121/26 dev ethMine.200
sudo ip link set dev ethMine.200 up
tarabyte
  • 274
  • 1
  • 4
  • 14
  • Does this help? [Netplan does not apply at startup](https://askubuntu.com/q/1019146/1046773) – P.P Jul 09 '20 at 20:57
  • Re-applying at /etc/rc.local works, but should not be required. This smells like a race with whatever is renaming my ethernet interface from `enp38s0f1`. – tarabyte Jul 09 '20 at 21:04
  • Just for the record, I don't think you need to edit `/etc/network/interfaces`, everything that is needed for the network to run properly should be set by netplan. – sheldrake Jun 20 '21 at 08:41

1 Answers1

0

/etc/network/interfaces should look like this...

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

/etc/netplan/01-netcfg.yaml should look like this...

network:
  version: 2
  renderer: networkd
  ethernets:
    enp38s0f1:
      addresses: [192.168.1.67/24]
      gateway4: 192.168.1.1
      match:
        macaddress: 80:fa:5b:7d:94:8f
      #set-name: ethMine
      nameservers:
        addresses: [8.8.8.8, 8.8.4.4]
      optional: true
  vlans:
    ethMine.200:
      id: 200
      link: enp38s0f1
      addresses: [192.168.1.167/24]
  wifis:
    wlx7ca7b0bbf9f1:
      addresses: [10.10.10.15/24]
      gateway4: 10.10.10.1
      nameservers:
        addresses: [8.8.8.8, 8.8.4.4]
      access-points:
        "myssid":
          password: "mypasswd"

sudo netplan --debug generate

sudo netplan apply

reboot

heynnema
  • 68,647
  • 15
  • 124
  • 180
  • yes, `set-name` syntax error. even with udev rule removed at `/etc/udev/rules.d/`, this race seems to persist. i can get netplan to do the renaming (shows in `dmesg | grep ethMine`), but not at the right time. – tarabyte Jul 09 '20 at 22:06
  • @tarabyte Tell me ethernet MAC address, and wireless device name wlxxxx. I added a match statement in my .yaml. Show me `cat /etc/network/interfaces`. What udev rule? – heynnema Jul 09 '20 at 22:12
  • ah `systemd-networkd` wasn't running. `sudo systemctl enable systemd-networkd` – tarabyte Jul 10 '20 at 16:25
  • @tarabyte How did that happen? If you have me your ethernet MAC address, and wireless device name wlxxxx, I can complete my .yaml. Does my .yaml work for you? – heynnema Jul 10 '20 at 19:39
  • sorry linux machine is down at the moment. i can confirm whether this works to set the name in the next couple days. – tarabyte Jul 10 '20 at 21:09
  • @tarabyte Status please... – heynnema Jul 18 '20 at 20:24
  • I'm getting very strange behavior and potentially some conflicts with ifupdown and NetworkManager. I don't have a good way to remove those from the story in Ubuntu 18 – tarabyte Jul 20 '20 at 07:06
  • @tarabyte Are you using a desktop or server installation? With the current .yaml, ifupdown and NetworkManager shouldn't even come into play. Did you use my /etc/network/interfaces file? Please describe more about what's going on. Also, please give me the ethernet MAC address, and wireless device name, so that I can complete my .yaml (third request). – heynnema Jul 20 '20 at 12:11
  • Retrying....... – tarabyte Jul 20 '20 at 18:46
  • Nothing in `/etc/network/interfaces`, Ethernet MAC address added, udev rule for Ethernet renaming removed, renaming Ethernet interface in netplan config seems to succeed via `dmesg` log `[ 2.678470] r8169 0000:26:00.1 ethMine: renamed from enp38s0f1 `, but still no interface for the vlan shows up in `ip link show` and the `ethMine` interface is not upped on reboot, and vlan does NOT show after manually `sudo systemctl enable systemd-networkd`. – tarabyte Jul 20 '20 at 18:54
  • @tarabyte If systemd-networkd was down, enable will just enable it, but not start it. You have to also do `sudo systemctl start systemd-networkd`. You should probably just reboot at this point then and see what you get. You didn't answer whether this was a desktop or server installation. – heynnema Jul 20 '20 at 19:03
  • Sorry, desktop Ubuntu. I just updated with some logs post boot and following a restart of systemd-networkd. – tarabyte Jul 20 '20 at 19:58
  • @tarabyte Since you have a Desktop installation, why did you decide to use netplan, instead of NetworkManager? – heynnema Jul 20 '20 at 20:15
  • Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/110825/discussion-between-tarabyte-and-heynnema). – tarabyte Jul 20 '20 at 20:16
  • Thank you for your help. This issue unfortunately persists, though. – tarabyte Jul 21 '20 at 15:59
  • @tarabyte Please go to chat and update me with the current status. I'll check in just a little later. Be sure to notify me with "@heynnema" at the start of comments, from chat. – heynnema Jul 21 '20 at 16:26