0

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 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).

Here is the Software Updater settings

BE-Bob
  • 11
  • Edit your question and show me cat /etc/network/interfaces and sudo lshw -C network and cat /etc/default/ntpdate and cat /etc/ntp.conf. Start comments to me with @heynnema or I may miss them. – heynnema May 10 '20 at 19:44
  • @heynnema I added the information you requested. The ntp related files you asked for do not exist. I also added my current netplan configuration. – BE-Bob May 10 '20 at 20:08
  • oh, I just looked closer at your current .yaml, and you're using both networkd and NetworkManager in the same .yaml. If you're going to use netplan, then you need to use enp8s0. – heynnema May 10 '20 at 20:25

1 Answers1

0

For netplan...

network:
  version: 2
  renderer: networkd
  ethernets:
    enp8s0:
      dhcp4: true

For NetworkManager...

network:
  version: 2
  renderer: NetworkManager

sudo netplan --debug generate

sudo netplan apply

reboot

heynnema
  • 70,711
  • this was my original setup with no NetworkManager. I didn't realize that the name of the ethernet adapter had changed again. I reran my testing the updated my questions. But this did not fix the problem. I still get the same "Wired Unmanaged" in the desktop and Software Updater thinks there is no network connection. – BE-Bob May 10 '20 at 21:03
  • @BE-Bob Your .yaml in your answer has the correct ethernet interface (this name shouldn't be changing on you, unless you're changing your hardware configuration), but you still have renderer: NetworkManager. Please use my .yaml. – heynnema May 10 '20 at 21:14
  • Thank you for your help. I did use your yaml, repeated all of the steps and still have the same issue. The network connection always works, but the desktop doesn't recognize it. I actually tried both of the yaml files I listed in the updated question (one of which was yours) and the desktop had the same problem both times. – BE-Bob May 10 '20 at 21:16
  • @BE-Bob Your last comment got cut short. Edit your question and show me ls -al /etc/systemd/network and ip a – heynnema May 10 '20 at 21:21
  • Just dropped the new info into the question – BE-Bob May 10 '20 at 23:21
  • @BE-Bob Are you using my .yaml right now? What does/does not work? Can you get to the Internet in Firefox? Can you ping 8.8.8.8? – heynnema May 10 '20 at 23:25
  • I am using your yaml right now. The network connection is fine from the command line and most GUI applications (I'm using FF now to write this). The issue is that gnome thinks the wired connection is unmanaged and Software Updater thinks there is no connection. I just want gnome to recognize that there is a network connection because at least Software Updater gets confused. I'm sorry for the confusion. I thought I was specific in my question. I wish I could attach an image. – BE-Bob May 10 '20 at 23:31
  • @BE-Bob I just needed to confirm that the problem apparently hasn't changed for you, and I need more data to try and determine where the problem is. Is there a terminal command that fails, and shows the problem? Or does only GUI apps fail? If you start Software Updater from the terminal, does it show any errors? – heynnema May 10 '20 at 23:35
  • @BE-Bob Although it should be unrelated, show me cat /etc/NetworkManager/NetworkManager.conf. Also, are you using any proxies? – heynnema May 10 '20 at 23:42
  • @BE-Bob Does sudo apt-get update and sudo apt-get upgrade work? You can attach an image, if you have one that shows the problem. – heynnema May 10 '20 at 23:55
  • Only GUI apps have a problem. None really fail. Sudo apt update and sudo apt upgrade both work. – BE-Bob May 11 '20 at 00:38
  • @BE-Bob The network drop down is a NetworkManager item, and you're not using NM. Check my answer again, and I've added a .yaml file for NM. Replace your current .yaml with my NM one, do the sudo netplan and reboot commands, then drop down that menu and fill out the "Wired Connection" connection script, and see if it looks like it all works. – heynnema May 11 '20 at 01:40
  • I"m sorry but we're back to where I started. I appreciate your help, but I don't think you've actually read the question. The issue is how to get both to work. The two options seems to be: NetworkManager: Gnome is happy, but NTP servers specified by dhcp are ignored or Networkd: NTP servers specified by dhcp are properly applied, but Gnome is confused about whether or not there is a network connection. I can't believe that there is no way to fix this. I came to linux because linux is all about control and flexibility. Yet here we are. – BE-Bob May 12 '20 at 00:08