0

Below are the configs for the yaml: file /etc/netplan/{filename}.yaml

network:
  version: 2
  renderer: networkd
  ethernets:
    eno1:
      dhcp4: false
      dhcp6: false
    addresses:
      [10.0.0.102/24]
    routes:
     - to: default
       via: 10.0.0.1
    nameservers:
      addresses: [8.8.8.8, 8.8.4.4]

The error I get is "Error in network definition: expected mapping (check indentation)" -10.0.0.102/24

Is there a problem with my syntax? Am I missing something? Its pointing to that line but I have tried moving it all over with no avail.

0

1 Answer 1

1

The addresses, routes and nameservers elements should be properties of the eno1 interface, not of ethernets in general... because they should all be associated with a particular interface. So they and their sub-elements should all be indented by two more spaces.

Check the examples in netplan reference documentation

1
  • Thank you I will try this Commented May 8, 2024 at 17:37

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.