In summary: I would like to find a way that allows my wired network connection to properly use all of the information supplied by my dhcp server and still allow gnome to realize that there is an active network connection. The details of this request are provided in this admittedly long description:
I am running Ubuntu 18.04.4 desktop on one physical host (called Host1). On my network, I have set up two servers (N1 and N2, both running Ubuntu 18.04 server) with the following daemons: isc-bind9, isc-dhcp-server, and chrony. These provide DNS, DHCP, and NTP service on my LAN.
I have Host1 set up as a IPv4 DHCP client. I would like to have the DHCP client accept the information provided by my DHCP servers. This information includes a reserved IP address, my local DNS servers (local authoritative and resolvers for all else), AND my NTP servers. Unfortunately, NetworkManager apparently has a longstanding bug (since 2009) that it ignores almost everything from the DHCP server except for the IP address, default route, and DNS servers. See this bug report from July 2009.
I did some research and found that there seems to be a lot of misinformation/confusion regrading how networking is setup on Ubuntu from 18.04 onward. Based on my research, netplan handles the setup of the network connections as an abstraction that can use either NetworkManager or systemd-networkd as the "renderer" (the actual service that sets up the network implementation) for a given connection.
Since NetworkManager wasn't doing what I needed (or what I thought it should be doing), I switched to networkd to set up the wired network connection to Host1 via dhcp. The defaults in networkd are to use all of the information supplied by the dhcp server. I followed the netplan example here to setup the ethernet connection via networkd using dhcp4. Here was my 01-config-networkd.yaml file:
# use networkd to setup the wired ethernet
network:
version: 2
renderer: networkd
ethernets:
enp8s0:
dhcp4: true
# assuming networkd dhcp4 defaults
# such as the following default to true:
# use-dns, use-ntp, send-hostname, use-mtu, use-routes
This worked great (NTP server was properly listed) except for one major issue: gnome desktop now thought that the wired network connection was unmanaged. This wouldn't be a problem except that Software Updater thought there was no connection and wouldn't download the descriptions of the pending updates. It still updated the packages, but I like to review the details and I was unsure what other problems there might be. This post appears related, but not quite the same. This post is exactly what happens with networkd as the renderer, but the solution that was proposed and used was to go back to NetworkManager. That is not an option for me unless the NTP issue (and other future issues) can be resolved. This also appeared to be a common issue to people installing the gnome desktop onto a server install of Ubuntu 18.04. See this forum for example.
This askUbuntu post How to use neworkd instead of NetworkManager on ubuntu 18.04 desktop seemed to be exactly what I was looking for, but the actual question asked was how to configure static IP (not what the title indicated). One answer described how to leave NetworkManager as the general renderer but have networkd specifically render the wired connection. I tried this and it did nothing different than the one above. Any time networkd takes over an adapter, NetworkManager considers it unmanaged and apparently tells gnome that there is no connection (based on Software Updater), even though there is an active connection that gnome apps use. Here is the netplan config for this setup:
# Let Network Manager manage all devices on this system
network:
version: 2
renderer: NetworkManager
ethernets:
# use networkd to setup the wired ethernet
enp8s0:
renderer: networkd
dhcp4: true
# assuming networkd dhcp4 defaults
# such as the following default to true:
# use-dns, use-ntp, send-hostname, use-mtu, use-routes
Ultimately, I found no way to have the wired ethernet connection be rendered (properly) by networkd while keeping the desktop from thinking that the network connection is unavailable. Any help that doesn't require the hard-coding of the information supplied by dhcp would be appreciated.
Edit 10 May 2020:
cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
sudo lshw -C network
*-network
description: Ethernet interface
product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
bus info: pci@0000:08:00.0
logical name: enp8s0
version: 15
serial: a8:a1:59:15:2b:9c
size: 1Gbit/s
capacity: 1Gbit/s
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress msix bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=r8169 duplex=full firmware=rtl8168h-2_0.0.2 02/26/15 ip=192.168.1.89 latency=0 link=yes multicast=yes port=MII speed=1Gbit/s
resources: irq:38 ioport:d000(size=256) memory:f7504000-f7504fff memory:f7500000-f7503fff
cat /etc/default/ntpdate
cat: /etc/default/ntpdate: No such file or directory
cat /etc/ntp.conf
cat: /etc/ntp.conf: No such file or directory
ls -al /etc/systemd/network
total 8
drwxr-xr-x 2 root root 4096 Oct 4 2017 .
drwxr-xr-x 5 root root 4096 Feb 22 11:20 ..
ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp8s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether a8:a1:59:15:2b:9c brd ff:ff:ff:ff:ff:ff
inet 192.168.1.89/24 brd 192.168.1.255 scope global dynamic enp8s0
valid_lft 34882sec preferred_lft 34882sec
inet6 fe80::aaa1:59ff:fe15:2b9c/64 scope link
valid_lft forever preferred_lft forever
edit with images:
Here is the gnome drop-down:
Here is the Software Updater settings showing that it thinks there is no internet connection. This is after it updated all of the repositories. Since there are no updates, it won't show the main window where it indicates that there is no internet connection (after it has updated the list).
cat /etc/network/interfaces
andsudo lshw -C network
andcat /etc/default/ntpdate
andcat /etc/ntp.conf
. Start comments to me with @heynnema or I may miss them. – heynnema May 10 '20 at 19:44