0

I recently installed server 21.04 on some new hardware. I'm using it at home, mostly for some dev experiments.

I don't understand everything that happens when the system is booted, but it takes much longer than I expect. When I start the boot sequence, I notice one message that takes far longer to clear than any other:

Host and Network Name Lookups

This is followed on the next line by:

A start job is running for Wait for Network to be Configured

I guess this means that the server is waiting for network addresses to be assigned? That should be handled by the modem / wifi box provided by my ISP? It seems to handle all the other wired and wireless connections without any trouble.

This is in the output from ifconfig:

enp40s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.27  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 2a01:110f:1333:8500:2ef0:5dff:fe9d:f549  prefixlen 64  scopeid 0x0<global>
        inet6 fe80::2ef0:5dff:fe9d:f549  prefixlen 64  scopeid 0x20<link>
        ether 2c:f0:5d:9d:f5:49  txqueuelen 1000  (Ethernet)
        RX packets 20947  bytes 28975249 (28.9 MB)
        RX errors 0  dropped 200  overruns 0  frame 0
        TX packets 9869  bytes 738607 (738.6 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

I can't read this in any detail, but it seems okay? There's an IP4 and an IP6 address granted, and I can connect to the server over SSH by IP4 address or by name.

This is the output from systemd-analyze:

Startup finished in 16.290s (firmware) + 5.242s (loader) + 4.306s (kernel) + 2min 3.331s (userspace) = 2min 29.171s 
graphical.target reached after 2min 3.111s in userspace

I guess this is far too long in userspace for most systems?

Can you suggest possible causes for this long wait? How can I investigate further?

If it is caused by waiting for names and addresses to be assigned, can I manually specify those addresses in .conf files? If I reserve the address on the DHCP server, that shouldn't cause any further problems, right?

EDIT: This is the output from cat /etc/netplan/*.yaml (there is only one file in that directory):

# This is the network config written by 'subiquity'
network:
  ethernets:
    enp40s0:
      dhcp4: true
    enp42s0:
      dhcp4: true
  version: 2

This is the output from 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:28:00.0
       logical name: enp40s0
       version: 15
       serial: 2c:f0:5d:9d:f5:49
       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 driverversion=5.11.0-16-generic duplex=full firmware=rtl8168h-2_0.0.2 02/26/15 ip=192.168.1.27 latency=0 link=yes multicast=yes port=twisted pair speed=1Gbit/s
       resources: irq:37 ioport:e000(size=256) memory:fc604000-fc604fff memory:fc600000-fc603fff
  *-network
       description: Ethernet interface
       product: RTL8125 2.5GbE Controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:2a:00.0
       logical name: enp42s0
       version: 04
       serial: 2c:f0:5d:9d:f5:48
       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-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=5.11.0-16-generic firmware=rtl8125b-2_0.0.2 07/13/20 latency=0 link=no multicast=yes port=twisted pair
       resources: irq:40 ioport:d000(size=256) memory:fc500000-fc50ffff memory:fc510000-fc513fff
  *-network:0
       description: Ethernet interface
       physical id: 1
       logical name: cali43ea770e11b
       serial: ee:ee:ee:ee:ee:ee
       size: 10Gbit/s
       capabilities: ethernet physical
       configuration: autonegotiation=off broadcast=yes driver=veth driverversion=1.0 duplex=full link=yes multicast=yes port=twisted pair speed=10Gbit/s
  *-network:1
       description: Ethernet interface
       physical id: 2
       logical name: vxlan.calico
       serial: 66:9b:20:93:4e:ac
       size: 1Gbit/s
       capacity: 1Gbit/s
       capabilities: ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=vxlan driverversion=0.1 duplex=full ip=10.1.50.0 link=yes multicast=yes port=twisted pair speed=1Gbit/s

The directory /etc/network/interfaces is empty.

6
  • "systemd-analyze blame" showed me that time was being taken up waiting for systemd-networkd-wait-online.service. The docs for that state, "By default, it will wait for all links it is aware of and which are managed by systemd-networkd.service(8) to be fully configured or failed, and for at least one link to be online." There are multiple interfaces shown by ifconfig: cali43ea770e11b, docker0, enp40s0, enp42s0, lo, and vxlan.calico. Can I find which one is slowest to configure without stepping through them one-by-one? May 7, 2021 at 14:00
  • Edit your question and show me cat /etc/netplan/*.yaml and sudo lshw -C network and cat /etc/network/interfaces. Start comments to me with @heynnema or I'll miss them.
    – heynnema
    May 7, 2021 at 14:39
  • @heynnema Done! May 7, 2021 at 14:55
  • Please see my answer. If it's helpful, please remember to accept it by clicking on the checkmark icon that appears just to the left of my answer. Thanks!
    – heynnema
    May 7, 2021 at 15:04
  • Status please...
    – heynnema
    May 10, 2021 at 3:14

1 Answer 1

0

Try this .yaml... keep it EXACTLY as I have it... same indentation, spacing, and no tabs...

network:
  version: 2
  renderer: networkd
  ethernets:
    enp40s0:
      dhcp4: true
      optional: true
    enp42s0:
      dhcp4: true
      optional: true

sudo netplan generate

sudo netplan apply

reboot

1
  • I haven't timed it, but this seems much better. At least a minute faster to get the login prompt, at a guess. Thanks! May 15, 2021 at 14:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .