I've just completed a fresh install of Ubuntu Server 18.04 on dedicated hardware. After login, the bonded network interface is not assigned an IP from DHCP. If I run sudo dhclient the bonded interface gets an IP and everything appears to work. After a reboot, I'm back to a non-working network.

If I execute sudo ip address show I can see that my interface is down. After sudo ip link bond0 up the interface comes up without an IP.

I've looked at this question already: Ubuntu 18.04 ethernet not configuring automatically That question does not address my problem. The question includes ifup which is not available on my system. The accepted answer includes /etc/network/interfaces which is not available on 18.04.

I've looked at this question: Ubuntu Server 18.04 waiting for Network at startup although the network is ok which specifically calls out wireless, which is not my situation and also does not have an accepted answer.

There's this question: Ubuntu server 18.04 - No IP address with Netplan This is a zero reputation question with no answer. There's one comment that recommends capturing packets and submitting a bug report. I've run a packet capture with tcpdump on DHCP traffic and the only data I get is 10 packets dropped by interface (I assume this was not DCHP traffic).

I did not find any other existing questions that seemed related.

So my question is twofold:

  1. Is this a bug?
  2. Am I expected to manually set up a networking interface after installation?

Edit: Additional Information

lshw:

  *-network:0
       description: Ethernet interface
       product: 82576 Gigabit Network Connection
       vendor: Intel Corporation
       physical id: 0
       bus info: pci@0000:05:00.0
       logical name: enp5s0f0
       version: 01
       serial: 3e:e4:cf:e3:41:b2
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 32 bits
       clock: 33MHz
       capabilities: pm msi msix pciexpress bus_master cap_list rom ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=igb driverversion=5.4.0-k duplex=full firmware=1.2.3 latency=0 link=yes multicast=yes port=twisted pair slave=yes speed=1Gbit/s
       resources: irq:25 memory:c0000000-c001ffff memory:c0020000-c003ffff ioport:ef80(size=32) memory:c00c0000-c00c3fff memory:c0040000-c005ffff memory:c00c4000-c00e3fff memory:c00e4000-c0103fff
  *-network:1
       description: Ethernet interface
       product: 82576 Gigabit Network Connection
       vendor: Intel Corporation
       physical id: 0.1
       bus info: pci@0000:05:00.1
       logical name: enp5s0f1
       version: 01
       serial: 3e:e4:cf:e3:41:b2
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 32 bits
       clock: 33MHz
       capabilities: pm msi msix pciexpress bus_master cap_list rom ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=igb driverversion=5.4.0-k duplex=full firmware=1.2.3 latency=0 link=yes multicast=yes port=twisted pair slave=yes speed=1Gbit/s
       resources: irq:35 memory:c0060000-c007ffff memory:c0080000-c009ffff ioport:ef40(size=32) memory:c0104000-c0107fff memory:c00a0000-c00bffff memory:c0108000-c0127fff memory:c0128000-c0147fff
  *-network DISABLED
       description: Ethernet interface
       physical id: 1
       logical name: bond0
       serial: 3e:e4:cf:e3:41:b2
       size: 1Gbit/s
       capabilities: ethernet physical
       configuration: autonegotiation=off broadcast=yes driver=bonding driverversion=3.7.1 duplex=full firmware=2 link=no master=yes multicast=yes speed=1Gbit/s

/etc/netplan/*.yaml:

# This file is generated from information provided by
# the datasource.  Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
    bonds:
        bond0:
            addresses: []
            interfaces:
            - enp5s0f0
            - enp5s0f1
            parameters:
                mode: active-backup
    ethernets:
        enp5s0f0:
            addresses: []
            dhcp4: false
            dhcp6: false
        enp5s0f1:
            addresses: []
            dhcp4: false
            dhcp6: false
    version: 2
  • Edit your question to include sudo lshw -C network and cat /etc/netplan/*.yaml. – heynnema Dec 3 at 21:17
  • @heynnema, I've added the additional information to the question. – c3maw Dec 3 at 23:44
  • Please see my answer, below. Report back. – heynnema Dec 4 at 0:18
up vote 0 down vote accepted

My understanding is that on Ubuntu Server, you must configure netplan manually, to match your actual physical and DHCP/address network environment.

Try this...

Note: keep the indentation at 2 spaces.

Note: dhcp4: true can be changed to addresses: [10.1.1.100/24] and gateway4: 10.1.1.1 if a fixed IP is required. (Example addresses only).

network:
  version: 2
  renderer: networkd
    bonds:
      bond0:
        addresses: []
        dhcp4: true
        interfaces:
          - enp5s0f0
          - enp5s0f1
        parameters:
          mode: active-backup
    ethernets:
      enp5s0f0:
        addresses: []
        dhcp4: false
        dhcp6: false
      enp5s0f1:
        addresses: []
        dhcp4: false
        dhcp6: false

In terminal...

sudo netplan -debug generate # generate config files

sudo netplan apply # apply new configuration

reboot # reboot system and confirm network operation

postnote: see here for more netplan examples, or here for netplan references.

  • 1. Following your instructions, I get: "Invalid YAML at //etc/netplan/config.yaml line 3 column 9: mapping values are not allowed in this context" 2. I take by your answer that I am expected to set up networking manually with Ubuntu Server 18.04, is that correct? – c3maw Dec 4 at 16:28
  • I changed the config file to 4 spaces and I was able to get this to work successfully. This is heavily disappointing that, out-of-the-box, I have to mess with Ubuntu's new networking just to get default settings to work. I will accept your answer if you include answers to my actual question (i.e. "No, not a bug. Yes, you must configure DHCP yourself" or "Yes, a bug. You're not expected to configure DHCP yourself.") – c3maw Dec 4 at 17:13
  • @c3maw Did you get the error at line 3 using my exact script, or something else? Line 3 is ** renderer: networkd**, and there's nothing wrong with that line. Hum. And are you saying that using my script, with additional indentation, worked for you? Inquiring minds want to know. I did modify my answer as per your request. – heynnema Dec 4 at 20:12
  • @c3maw just an afterthought... is config.yaml the ONLY .yaml file in /etc/netplan? – heynnema Dec 4 at 20:19
  • correcting the indentation to multiples of 4 spaces of your text did indeed correct the error. I'm currently using your script with 4-space indentation on this machine. There is only one .yaml in that directory now. The name of the old one was useless to me. Created config.yaml using the netplan wiki recommendation. – c3maw Dec 4 at 20:21

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.