0

I have this configuration file for 01-netcfg.yaml (I tried the 50-cloud-init.yaml too) and nothing works.

I get an error like this:

Error in network definition /etc/netplan/01-netcfg.yaml line 0 column 8: expected mapping

My file:

network:
version: 2
renderer: networkd
ethernets:
enp0s3:
dhcp4: no
dhcp6: no
addresses: [192.168.12.246/24]
gateway4: 192.168.12.1
nameservers:
addresses: [127.0.0.53, 8.8.8.8]

Any help will be thankful.

0

yaml is a structured format that uses indentation to indicate structure. Your pasted file shows that all your lines are left-aligned in the first column. It looks like you've lost the whitespace when copying some example, you will need to add it back.

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.