Ubuntu 18.04 ethernet not configuring automatically

I have a laptop with Ubuntu 18.04 Desktop installed. The system is eager to configure and operate WiFi, but I need a wired connection because my adapter is slow compared to the 1000BASE-T Ethernet.

Ethernet cable is plugged in, but I see nowhere in the desktop how to configure wired. With WiFi off, there's a "?" next to the volume control. Clicking there shows nothing to do with an Ethernet connection.

On the other hand, if I manually bring the interface up, networking works just fine:

% sudo ifup enp5s0f1
Internet Systems Consortium DHCP Client 4.3.5
Copyright 2004-2016 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/enp5s0f1/78:24:af:ca:08:74
Sending on   LPF/enp5s0f1/78:24:af:ca:08:74
Sending on   Socket/fallback
DHCPDISCOVER on enp5s0f1 to 255.255.255.255 port 67 interval 3 (xid=0x637da107)
DHCPDISCOVER on enp5s0f1 to 255.255.255.255 port 67 interval 5 (xid=0x637da107)
DHCPREQUEST of 192.168.1.24 on enp5s0f1 to 255.255.255.255 port 67 (xid=0x7a17d63)
DHCPOFFER of 192.168.1.24 from 192.168.1.1
DHCPACK of 192.168.1.24 from 192.168.1.1
bound to 192.168.1.24 -- renewal in 41444 seconds.

ssh, ftp, web browser... just works.

I've added information that was requested below:

% sudo lshw -C network
  *-network DISABLED
       description: Wireless interface
       product: AR9462 Wireless Network Adapter
       vendor: Qualcomm Atheros
       physical id: 0
       bus info: pci@0000:04:00.0
       logical name: wlp4s0
       version: 01
       serial: 40:e2:30:ae:5b:17
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list rom ethernet physical wireless
       configuration: broadcast=yes driver=ath9k driverversion=4.15.0-36-generic firmware=N/A latency=0 link=no multicast=yes wirele
ss=IEEE 802.11
       resources: irq:18 memory:f7900000-f797ffff memory:f7980000-f798ffff
  *-network DISABLED
       description: Ethernet interface
       product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0.1
       bus info: pci@0000:05:00.1
       logical name: enp5s0f1
       version: 12
       serial: 78:24:af:ca:08:74
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000
bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full latency=0 link=no multicast
=yes port=MII speed=1Gbit/s
       resources: irq:19 ioport:d000(size=256) memory:f7814000-f7814fff memory:f7810000-f7813fff

Grepping for NetworkManager in syslog:

/var/log/syslog.1:Oct 17 21:24:28 myhostname NetworkManager[802]:   [1539825868.9200] bluez5: NAP: removed interface 40:E2:30:AE:5B:16
/var/log/syslog.1:Oct 17 21:24:29 myhostname NetworkManager[802]:   [1539825869.1167] manager: sleep: wake requested (sleeping: yes  enabled: yes)
/var/log/syslog.1:Oct 17 21:24:29 myhostname NetworkManager[802]:   [1539825869.1169] device (wlp4s0): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'managed')
/var/log/syslog.1:Oct 17 21:24:29 myhostname NetworkManager[802]:   [1539825869.1174] manager: NetworkManager state is now DISCONNECTED
/var/log/syslog.1:Oct 17 21:24:29 myhostname NetworkManager[802]:   [1539825869.7907] bluez5: NAP: added interface 40:E2:30:AE:5B:16
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.7085] NetworkManager (version 1.10.6) is starting... (for the first time)
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.7086] Read config: /etc/NetworkManager/NetworkManager.conf (lib: 10-dns-resolved.conf, 20-connectivity-ubuntu.conf, no-mac-addr-change.conf) (run: 10-globally-managed-devices.conf) (etc: default-wifi-powersave-on.conf)
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.7123] manager[0x55ae928e6060]: monitoring kernel firmware directory '/lib/firmware'.
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.7124] monitoring ifupdown state file '/run/network/ifstate'.
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8188] hostname: hostname: using hostnamed
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8189] hostname: hostname changed from (none) to "myhostname"
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8192] dns-mgr[0x55ae92900140]: init: dns=systemd-resolved, rc-manager=symlink, plugin=systemd-resolved
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8199] rfkill1: found WiFi radio killswitch (at /sys/devices/pci0000:00/0000:00:1c.2/0000:04:00.0/ieee80211/phy0/rfkill1) (driver ath9k)
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8200] manager[0x55ae928e6060]: rfkill: WiFi hardware radio set disabled
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8201] manager[0x55ae928e6060]: rfkill: WWAN hardware radio set enabled
/var/log/syslog.1:Oct 17 21:29:46 myhostname dbus-daemon[775]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service' requested by ':1.14' (uid=0 pid=800 comm="/usr/sbin/NetworkManager --no-daemon " label="unconfined")
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8363] init!
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8364]       interface-parser: parsing file /etc/network/interfaces
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8364]       interface-parser: finished parsing file /etc/network/interfaces
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8366] guessed connection type (enp5s0f1) = 802-3-ethernet
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8366] update_connection_setting_from_if_block: name:enp5s0f1, type:802-3-ethernet, id:Ifupdown (enp5s0f1), uuid: a4537f7b-6324-fd3f-6489-f76bfb2af0dc
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8367] adding enp5s0f1 to connections
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8367] adding iface enp5s0f1 to eni_ifaces
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8367] management mode: unmanaged
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8371] devices added (path: /sys/devices/pci0000:00/0000:00:1c.2/0000:04:00.0/net/wlp4s0, iface: wlp4s0)
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8371] device added (path: /sys/devices/pci0000:00/0000:00:1c.2/0000:04:00.0/net/wlp4s0, iface: wlp4s0): no ifupdown configuration found.
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8371] devices added (path: /sys/devices/pci0000:00/0000:00:1c.3/0000:05:00.1/net/enp5s0f1, iface: enp5s0f1)
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8372] locking wired connection setting
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8372] settings-connection[0x55ae928b2360,a4537f7b-6324-fd3f-6489-f76bfb2af0dc]: write: failure to update connection: writing settings not supported
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8372] devices added (path: /sys/devices/virtual/net/lo, iface: lo)
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8372] device added (path: /sys/devices/virtual/net/lo, iface: lo): no ifupdown configuration found.
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8372] end _init.
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8372] settings: loaded plugin ifupdown: (C) 2008 Canonical Ltd.  To report bugs please use the NetworkManager mailing list. (/usr/lib/x86_64-linux-gnu/NetworkManager/libnm-settings-plugin-ifupdown.so)
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8373] settings: loaded plugin keyfile: (c) 2007 - 2016 Red Hat, Inc.  To report bugs please use the NetworkManager mailing list.
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8373] (-1835934528) ... get_connections.
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8373] (-1835934528) ... get_connections (managed=false): return empty list.
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8464] keyfile: new connection /etc/NetworkManager/system-connections/Wired connection 1 (823e4837-330a-3bf9-8be5-6fc1f1fde418,"Wired connection 1")
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8543] keyfile: new connection /etc/NetworkManager/system-connections/Necronomicon (b247a602-6c61-4875-af1e-58d0d88bbd81,"Necronomicon")
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8548] get unmanaged devices count: 1
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8548] manager: rfkill: WiFi disabled by radio killswitch; disabled by state file
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8548] manager: rfkill: WWAN enabled by radio killswitch; enabled by state file
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8548] manager: Networking is enabled by state file
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8549] dhcp-init: Using DHCP client 'dhclient'
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8550] Loaded device plugin: NMBondDeviceFactory (internal)
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8550] Loaded device plugin: NMBridgeDeviceFactory (internal)
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8550] Loaded device plugin: NMDummyDeviceFactory (internal)
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8550] Loaded device plugin: NMEthernetDeviceFactory (internal)
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8550] Loaded device plugin: NMInfinibandDeviceFactory (internal)
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8550] Loaded device plugin: NMIPTunnelDeviceFactory (internal)
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8550] Loaded device plugin: NMMacsecDeviceFactory (internal)
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8550] Loaded device plugin: NMMacvlanDeviceFactory (internal)
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8551] Loaded device plugin: NMPppDeviceFactory (internal)
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8551] Loaded device plugin: NMTunDeviceFactory (internal)
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8551] Loaded device plugin: NMVethDeviceFactory (internal)
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8551] Loaded device plugin: NMVlanDeviceFactory (internal)
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8551] Loaded device plugin: NMVxlanDeviceFactory (internal)
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8570] Loaded device plugin: NMWwanFactory (/usr/lib/x86_64-linux-gnu/NetworkManager/libnm-device-plugin-wwan.so)
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8580] Loaded device plugin: NMAtmManager (/usr/lib/x86_64-linux-gnu/NetworkManager/libnm-device-plugin-adsl.so)
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8602] Loaded device plugin: NMBluezManager (/usr/lib/x86_64-linux-gnu/NetworkManager/libnm-device-plugin-bluetooth.so)
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8611] Loaded device plugin: NMWifiFactory (/usr/lib/x86_64-linux-gnu/NetworkManager/libnm-device-plugin-wifi.so)
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8635] Loaded device plugin: NMTeamFactory (/usr/lib/x86_64-linux-gnu/NetworkManager/libnm-device-plugin-team.so)
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8641] device (lo): carrier: link connected
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8646] manager: (lo): new Generic device (/org/freedesktop/NetworkManager/Devices/1)
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8655] manager: (enp5s0f1): new Ethernet device (/org/freedesktop/NetworkManager/Devices/2)
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8663] wifi-nl80211: (wlp4s0): using nl80211 for WiFi device control
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8664] device (wlp4s0): driver supports Access Point (AP) mode
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8670] manager: (wlp4s0): new 802.11 WiFi device (/org/freedesktop/NetworkManager/Devices/3)
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8679] device (wlp4s0): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'external')
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8723] bluez: use BlueZ version 5
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8735] modem-manager: ModemManager available
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8757] supplicant: wpa_supplicant running
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8760] manager: startup complete
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8767] bluez5: NAP: added interface 40:E2:30:AE:5B:16

Grepping for enp5s0f1:

/var/log/syslog.1:Oct 17 21:29:46 myhostname kernel: [    1.210408] r8169 0000:05:00.1 enp5s0f1: renamed from eth0
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8366] guessed connection type (enp5s0f1) = 802-3-ethernet
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8366] update_connection_setting_from_if_block: name:enp5s0f1, type:802-3-ethernet, id:Ifupdown (enp5s0f1), uuid: a4537f7b-6324-fd3f-6489-f76bfb2af0dc
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8367] adding enp5s0f1 to connections
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8367] adding iface enp5s0f1 to eni_ifaces
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8371] devices added (path: /sys/devices/pci0000:00/0000:00:1c.3/0000:05:00.1/net/enp5s0f1, iface: enp5s0f1)
/var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:   [1539826186.8655] manager: (enp5s0f1): new Ethernet device (/org/freedesktop/NetworkManager/Devices/2)

Contents of /etc/network/interfaces:

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

From /etc/netplan/01-network-manager-all.yaml

# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: NetworkManager

Thanks for any help,

Charles


Solution 1:

If you're running on a SSD, you run the risk of things booting faster than the network is coming online and then you'll need to modify the following file: /etc/systemd/system/network-online.target.wants/NetworkManager-wait-online.service

[Unit]
Description=Network Manager Wait Online
Documentation=man:nm-online(1)
Requires=NetworkManager.service
After=NetworkManager.service
Before=network-online.target

[Service] Type=oneshot ExecStart=/usr/bin/nm-online -s -q --timeout=60 RemainAfterExit=yes

[Install] WantedBy=network-online.target

and change the timeout from 30 to 60. Reboot.

Update #1:

  • In terminal...

rfkill list

if this shows any blocked devices...

rfkill unblock all

and make sure that no "wireless" hardware switch, or function key, is set to "disabled".

  • Edit /etc/network/interfaces and change...

this:

iface enp5s0f1 inet dhcp

to this:

#iface enp5s0f1 inet dhcp

  • Edit /etc/NetworkManager/NetworkManager.conf and make sure that this line is set to false...

[ifupdown]

managed=false

Reboot the system and retest both wired and wireless connections. Show me sudo lshw -C network again.