It takes 20 s NetworkManager to connect network
This was originally reported downstream on 2019-03-21 at https://bugzilla.suse.com/show_bug.cgi?id=1130002.
Since some of the past updates in the last month or two, it takes quite some time NetworkManager to connect after resume. It receives the reply from the DHCP server, ping works on the command line, but nm-applet still shows checking internet connectivity and won't finish for 15 more seconds. Excerpt from the NM log:
> 06:15:41 manager: (eth1): new Ethernet device (/org/freedesktop/NetworkManager/Devices/51)
> 06:15:41 device (eth1): carrier: link connected
> 06:15:41 dhcp4 (eth1): dhclient started with pid 12103
> 06:15:45 device (eth1): carrier: link connected
> 06:15:46 dhcp4 (eth1): address 192.168.1.49
> 06:15:46 dhcp4 (eth1): state changed unknown -> bound
> 06:15:46 device (eth1): state change: ip-config -> ip-check (reason 'none', sys-iface-state: 'managed')
> 06:15:47 dhcp6 (eth1): activation: beginning transaction (timeout in 45 seconds)
> 06:15:47 dhcp6 (eth1): dhclient started with pid 12198
> 06:15:48 dhcp6 (eth1): address 2a0b:e7c0:...
> 06:15:48 dhcp6 (eth1): state changed unknown -> bound, event ID="f3:f6:6d:0c|1553145348"
> 06:16:06 device (eth1): state change: ip-check -> secondaries (reason 'none', sys-iface-state: 'managed')
> 06:16:06 device (eth1): state change: secondaries -> activated (reason 'none', sys-iface-state: 'managed')
> 06:16:06 device (eth1): Activation: successful, device activated.
Happens both on ethernet and wifi.
$ rpm -q NetworkManager
NetworkManager-1.16.0-3.1.x86_64
zypp history:
2018-11-30 19:49:02|install|NetworkManager|1.14.4-2.1|x86_64||repo-oss|ac355937f547f10bda531645819813c20069d6a3d5812df91bbaa22a91430e99|
2019-02-23 13:44:06|install|NetworkManager|1.14.4-3.1|x86_64||repo-oss|2d19a157c2a954ca014f4d435a62a1d7432939cef923e97ec890b56c30f519b3|
2019-03-04 07:31:32|install|NetworkManager|1.14.6-1.1|x86_64|root@anemoi2|repo-oss|ae703147f10dbce9c69b2851be54393952bed12898377c297a4d83fda3cc2281|
2019-03-25 09:30:34|install|NetworkManager|1.16.0-1.1|x86_64||repo-oss|5b3e0f924b645854b4dace0d854c322e4e543cb3be8cdbeb3cdae9d0a414573d|
2019-04-10 12:38:36|install|NetworkManager|1.16.0-3.1|x86_64||repo-oss|54e5d5dd8ea38931cbf6dd3bb0df9fcd852dbdcaf1a0544033a2c61b03019945|
In the ip-check phase, I can ping an IP, but DNS server returns:
$ host www.seznam.cz
Host www.seznam.cz not found: 5(REFUSED)
I have a local dnsmasq server. So:
> 06:15:40 dnsmasq: no servers found in /var/run/dnsmasq-forwarders.conf, will retry
> ...
> 06:16:06 dnsmasq: reading /var/run/dnsmasq-forwarders.conf
dnsmasq tries to read forwarders written by NM, but the forwarders file is empty initially and is only available when dnsmasq retries which takes those 26 seconds.
So either dnsmasq should not have been woken at 6:15:40 or it should be woken at 06:15:46 -- when DHCP reply was received and network configured.
Not sure whether this is a NM or dnsmasq issue.
OK, but /var/run/dnsmasq-forwarders.conf has no servers for the whole period since the DHCP reply up to the point when the network starts working.
Doing
# echo 'nameserver 192.168.1.1' >> /var/run/dnsmasq-forwarders.conf
after the DHCP reply, brings the network up immediately.
So I don't know why netconfig does not write the file with the DHCP reply. It seems it waits for something to happen and writes it after some timeout.
Does netconfig/NM wait for nscd? As I disabled nscd on 24th Feb due to issues it causes and that could be the point in time this all started happening...