Ethernet is disabled after reboot – Ubuntu server 20.04.3

Problem

I had a working internet connection over ethernet prior to shutting down, but now that I’ve booted back up I can’t connect to my own network, let alone the internet.

I had a very similar network issue (along with a myriad of display issues) on a previous install of Ubuntu 20.04 Desktop (as opposed to server, which I’m on now) that was installed on the same SSD, which is pretty old (boot drive on a Windows machine for ~6 years). Possibly a corrupted drive?

I run sudo lshw -C network and get the following:

*-network DISABLED
    description: Ethernet Interface
    product: Killer E220x Gigabit Ethernet Controller
...
    logical name: enp2so

First Attempt at Solution

Based on the question here (ethernet not working after reboot on Ubuntu Server 20.04.2 ) I ran the command ip link show:

1: lo: ...
2: enp2so: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether d8:cb:8a:a4:0a:b3 brd ff:ff:ff:ff:ff:ff

And I tried to run the commands sudo ip link set enp2s0 up followed by sudo netplan apply, but apparently netplan isn’t installed on my instance of Ubuntu for some reason. I did this after confirming that /etc/netplan/00-installer-config.yaml is pointing to enp2s0.

Miscellaneous Info

The only other suggestions I’ve found refer to editing files that don’t exist on my system:

  • /etc/NetworkManager/conf.d (the only file in that folder is dispatcher.d)
  • /etc/network/interfaces (file does not exist)
  • /var/lib/NetworkManager/NetworkManager.state (no such folder in /var/lib/)
  • When I try sudo service network-manager restart I just get an error Failed to restart network-manager.service: Unit network-manager.service not found.

Running Services

~ systemctl list-units --type service --state running
  UNIT                      LOAD   ACTIVE SUB     DESCRIPTION                                 
  atd.service               loaded active running Deferred execution scheduler                
  cron.service              loaded active running Regular background program processing daemon
  dbus.service              loaded active running D-Bus System Message Bus                    
  getty@tty1.service        loaded active running Getty on tty1                               
  irqbalance.service        loaded active running irqbalance daemon                           
  multipathd.service        loaded active running Device-Mapper Multipath Device Controller   
  plexmediaserver.service   loaded active running Plex Media Server                           
  polkit.service            loaded active running Authorization Manager                       
  rsyslog.service           loaded active running System Logging Service                      
  ssh.service               loaded active running OpenBSD Secure Shell server                 
  systemd-journald.service  loaded active running Journal Service                             
  systemd-logind.service    loaded active running Login Service                               
  systemd-networkd.service  loaded active running Network Service                             
  systemd-resolved.service  loaded active running Network Name Resolution                     
  systemd-timesyncd.service loaded active running Network Time Synchronization                
  systemd-udevd.service     loaded active running udev Kernel Device Manager                  
  thermald.service          loaded active running Thermal Daemon Service                      
  udisks2.service           loaded active running Disk Manager                                
  user@1000.service         loaded active running User Manager for UID 1000                   

LOAD   = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB    = The low-level unit activation state, values depend on unit type.

19 loaded units listed.

Edit 12/21

cat /etc/netplan/*.yaml

~ cat /etc/netplan/*.yaml
# This is the network config written by 'subiquity'
network:
  ethernets:
    enp2s0:
      dhcp4: true
  version: 2

sudo lshw -C network

~ sudo lshw -C network
  *-network DISABLED
       description: Ethernet interface
       product: Killer E220x Gigabit Ethernet Controller
       vendor: Qualcomm Atheros
       physical id: 0
       bus info: pci@0000:02:00.0
       logical name: enp2s0
       version: 13
       serial: d8:cb:8a:a4:0a:b3
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm pciexpress msi msix bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=alx latency=0 link=no multicast=yes port=twisted pair
       resources: irq:19 memory:f7c00000-f7c3ffff ioport:e000(size=128)

Edit 12/22
Research (and some helpful comments from @heynnema) has led me to believe that netplan absolutely should be installed on my system for the networking to work – but it is not. Given that networking worked fine before the reboot, does this mean something got corrupted?

Edit 12/23
Some other potentially useful information.

dpkg -l *netplan*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
un  netplan.io     <none>       <none>       (no description available)

and

grep -i netplan /var/log/dpkg.log*
021-08-24 08:43:10 install libnetplan0:amd64 <none> 0.99-0ubuntu1
2021-08-24 08:43:10 status half-installed libnetplan0:amd64 0.99-0ubuntu1
2021-08-24 08:43:10 status unpacked libnetplan0:amd64 0.99-0ubuntu1
2021-08-24 08:43:22 install netplan.io:amd64 <none> 0.99-0ubuntu1
2021-08-24 08:43:22 status half-installed netplan.io:amd64 0.99-0ubuntu1
2021-08-24 08:43:22 status unpacked netplan.io:amd64 0.99-0ubuntu1
2021-08-24 08:43:34 configure libnetplan0:amd64 0.99-0ubuntu1 <none>
2021-08-24 08:43:34 status unpacked libnetplan0:amd64 0.99-0ubuntu1
2021-08-24 08:43:34 status half-configured libnetplan0:amd64 0.99-0ubuntu1
2021-08-24 08:43:34 status installed libnetplan0:amd64 0.99-0ubuntu1
2021-08-24 08:43:57 configure netplan.io:amd64 0.99-0ubuntu1 <none>
2021-08-24 08:43:57 status unpacked netplan.io:amd64 0.99-0ubuntu1
2021-08-24 08:43:57 status half-configured netplan.io:amd64 0.99-0ubuntu1
2021-08-24 08:43:57 status installed netplan.io:amd64 0.99-0ubuntu1
2021-08-24 08:45:10 upgrade libnetplan0:amd64 0.99-0ubuntu1 0.102-0ubuntu1~20.04.2
2021-08-24 08:45:10 status half-configured libnetplan0:amd64 0.99-0ubuntu1
2021-08-24 08:45:10 status unpacked libnetplan0:amd64 0.99-0ubuntu1
2021-08-24 08:45:10 status half-installed libnetplan0:amd64 0.99-0ubuntu1
2021-08-24 08:45:10 status unpacked libnetplan0:amd64 0.102-0ubuntu1~20.04.2
2021-08-24 08:45:11 upgrade netplan.io:amd64 0.99-0ubuntu1 0.102-0ubuntu1~20.04.2
2021-08-24 08:45:11 status half-configured netplan.io:amd64 0.99-0ubuntu1
2021-08-24 08:45:11 status unpacked netplan.io:amd64 0.99-0ubuntu1
2021-08-24 08:45:11 status half-installed netplan.io:amd64 0.99-0ubuntu1
2021-08-24 08:45:11 status unpacked netplan.io:amd64 0.102-0ubuntu1~20.04.2
2021-08-24 08:45:12 configure libnetplan0:amd64 0.102-0ubuntu1~20.04.2 <none>
2021-08-24 08:45:12 status unpacked libnetplan0:amd64 0.102-0ubuntu1~20.04.2
2021-08-24 08:45:12 status half-configured libnetplan0:amd64 0.102-0ubuntu1~20.04.2
2021-08-24 08:45:12 status installed libnetplan0:amd64 0.102-0ubuntu1~20.04.2
2021-08-24 08:45:17 configure netplan.io:amd64 0.102-0ubuntu1~20.04.2 <none>
2021-08-24 08:45:17 status unpacked netplan.io:amd64 0.102-0ubuntu1~20.04.2
2021-08-24 08:45:17 status half-configured netplan.io:amd64 0.102-0ubuntu1~20.04.2
2021-08-24 08:45:17 status installed netplan.io:amd64 0.102-0ubuntu1~20.04.2
2021-12-11 07:27:39 upgrade libnetplan0:amd64 0.102-0ubuntu1~20.04.2 0.103-0ubuntu5~20.04.5
2021-12-11 07:27:39 status half-configured libnetplan0:amd64 0.102-0ubuntu1~20.04.2
2021-12-11 07:27:39 status unpacked libnetplan0:amd64 0.102-0ubuntu1~20.04.2
2021-12-11 07:27:39 status half-installed libnetplan0:amd64 0.102-0ubuntu1~20.04.2
2021-12-11 07:27:39 status unpacked libnetplan0:amd64 0.103-0ubuntu5~20.04.5
2021-12-11 07:27:39 upgrade netplan.io:amd64 0.102-0ubuntu1~20.04.2 0.103-0ubuntu5~20.04.5
2021-12-11 07:27:39 status half-configured netplan.io:amd64 0.102-0ubuntu1~20.04.2
2021-12-11 07:27:39 status unpacked netplan.io:amd64 0.102-0ubuntu1~20.04.2
2021-12-11 07:27:39 status half-installed netplan.io:amd64 0.102-0ubuntu1~20.04.2
2021-12-11 07:27:39 status unpacked netplan.io:amd64 0.103-0ubuntu5~20.04.5
2021-12-11 07:27:44 configure libnetplan0:amd64 0.103-0ubuntu5~20.04.5 <none>
2021-12-11 07:27:44 status unpacked libnetplan0:amd64 0.103-0ubuntu5~20.04.5
2021-12-11 07:27:44 status half-configured libnetplan0:amd64 0.103-0ubuntu5~20.04.5
2021-12-11 07:27:44 status installed libnetplan0:amd64 0.103-0ubuntu5~20.04.5
2021-12-11 07:27:52 configure netplan.io:amd64 0.103-0ubuntu5~20.04.5 <none>
2021-12-11 07:27:52 status unpacked netplan.io:amd64 0.103-0ubuntu5~20.04.5
2021-12-11 07:27:52 status half-configured netplan.io:amd64 0.103-0ubuntu5~20.04.5
2021-12-11 07:27:52 status installed netplan.io:amd64 0.103-0ubuntu5~20.04.5
2021-12-19 23:12:51 status installed netplan.io:amd64 0.103-0ubuntu5~20.04.5
2021-12-19 23:12:51 remove netplan.io:amd64 0.103-0ubuntu5~20.04.5 <none>
2021-12-19 23:12:51 status half-configured netplan.io:amd64 0.103-0ubuntu5~20.04.5
2021-12-19 23:12:51 status half-installed netplan.io:amd64 0.103-0ubuntu5~20.04.5
2021-12-19 23:12:51 status config-files netplan.io:amd64 0.103-0ubuntu5~20.04.5
2021-12-19 23:12:51 status not-installed netplan.io:amd64 <none>
2021-12-19 23:16:52 status installed libnetplan0:amd64 0.103-0ubuntu5~20.04.5
2021-12-19 23:16:52 remove libnetplan0:amd64 0.103-0ubuntu5~20.04.5 <none>
2021-12-19 23:16:52 status half-configured libnetplan0:amd64 0.103-0ubuntu5~20.04.5
2021-12-19 23:16:52 status half-installed libnetplan0:amd64 0.103-0ubuntu5~20.04.5
2021-12-19 23:16:52 status config-files libnetplan0:amd64 0.103-0ubuntu5~20.04.5
2021-12-19 23:16:52 status not-installed libnetplan0:amd64 <none>

Edit 12/23 Part 2
I noticed a red error message when I boot up – it disappears immediately so I needed to record my boot on my phone in slow-mo (there’s presumably a better way…)

The message read [FAILED] Failed to start Service for snap application lxd.activate. I then ran the recommended command and got this output:

‚óŹ snap.lxd.activate.service - Service for snap application lxd.activate
     Loaded: loaded (/etc/systemd/system/snap.lxd.activate.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Fri 2021-12-24 01:17:58 UTC; 3min 12s ago
    Process: 678 ExecStart=/usr/bin/snap run lxd.activate (code=exited, status=203/EXEC)
   Main PID: 678 (code=exited, status=203/EXEC)

Dec 24 01:17:58 ullr systemd[1]: Starting Service for snap application lxd.activate...
Dec 24 01:17:58 ullr systemd[678]: snap.lxd.activate.service: Failed to execute command: No such file or directory
Dec 24 01:17:58 ullr systemd[678]: snap.lxd.activate.service: Failed at step EXEC spawning /usr/bin/snap: No such file or directory
Dec 24 01:17:58 ullr systemd[1]: snap.lxd.activate.service: Main process exited, code=exited, status=203/EXEC
Dec 24 01:17:58 ullr systemd[1]: snap.lxd.activate.service: Failed with result 'exit-code'.
Dec 24 01:17:58 ullr systemd[1]: Failed to start Service for snap application lxd.activate.

I don’t actually know for sure if this is related – but besides the network just not working, it’s the only thing out of the ordinary I’ve noticed.

Edit 12/28
Happy holidays everyone, esp. those helping me out with this. I’m away from the problem computer right now, but my next steps are to reinstall netplan.io and libnetplan0 from a flash drive, as those were apparently uninstalled. Updating those won’t be difficult, but right now my priority is understanding how this happened in the first place. Perhaps it’s possible that running

sudo apt update
sudo apt upgrade

broke something, but that didn’t take effect until the computer was rebooted?

Asked By: Rustle Branch

||

I had this problem and, like you, my netplan seemed to have disappeared for no reason. This may have happened due to auto-upgrade settings and did not become apparent until a reboot.

You are running systemd-networkd.service and this can be configured manually by placing files in /etc/systemd/network/. Create and edit a file called, for instance /etc/systemd/network/10-wired.network:

[Match]
Name=enp* # make this match your interface

[Network]
    
Gateway=192.168.1.254
Address=192.168.1.55/24
DNS=192.168.1.2 # use setting specific to your network

[Route]
Destination=192.168.1.254
Scope=link

This example is for a static address. You can find examples for DHCP in the man pages for systemd (link).

The you need to restart systemd.networkd with sudo systemctl restart systemd-networkd. This should survive a reboot and you do not need to reinstall netplan.

Answered By: Daniel K

This isn’t a satisfying answer – but I ended up reinstalling the OS from scratch. Nothing else worked.

Answered By: Rustle Branch

I search everywhere for an answer for my ubuntu 22.04 LTS, non ethernet startup at boot. Luckily me, I managed to resolve it by a simple tweak

Conflicting and/or repeated network settings where found at these 3 locations, @Netplan, @ifupdown & @NM. I removed settings at 2 locations.

Voila it works like a breeze

Location:1,@ Netplan, /etc/netplan/*.yaml ;put # comments for all settings *.yaml file:

Location:2,@ ifupdown, /etc/network/interfaces ;put #comments for all settings at /etc/network/interfaces file

Location:3, @ NM, /etc/NetworkManager/system-connections ;Keep this settings

Answered By: Nman

Hardware change

In my case I had a hardware-change and the enp4s0 turned into enp5s0. Unfortunately /etc/netplan/*.yaml remains having enp4s0 what was not available anymore.

Answered By: Grim