0

Doing a clean install of Ubuntu Server 18.04 on a new machine. Currently attempting to configure my Ethernet network interface to use DHCP using netplan.

My config file, dynamic.yaml, reads as follows:

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

When I attempt to load this configuration with

sudo netplan try

I get an error which reads:

Error while loading /etc/netplan/dynamic.yaml, aborting.
sudo netplan --debug try

merely prints out "ERROR:Error while loading /etc/netplan/dynamic.yaml, aborting."

Any ideas what the error is? Or does anyone have any suggestions for how to get netplan to actually specify what the error is?

  • 1
    The netplan-try manual page suggests there's a --debug switch: have you tried sudo netplan --debug try? – steeldriver Aug 24 at 15:50
  • Merely says the same thing unfortunately – user1819128 Aug 24 at 15:58
  • Does sudo netplan --debug generate give any more clues? – heynnema Aug 24 at 16:50
0

netplan is VERY fussy about .yaml file formatting. No tabs, specific indentation, and no extra spaces. Your .yaml looks ok syntactically, but try this variation...

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

sudo netplan --debug generate # generate config files

sudo netplan apply # apply config

reboot # reboot the computer

  • Turns out I was using tabs instead of spaces - switching to spaces fixed the issue, Thanks! – user1819128 Aug 24 at 17:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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