0

Have 2 Ubuntu Servers. Tried to configure static IP on both of them. Server 1 everything is working file. Server 2 giving error:

/etc/netplan/50-cloud-init.yaml:10:18: Invalid YAML: inconsistent
indentation:
dhcp4: false
^

file /etc/netplan/50-cloud-init.yaml:

network:  
    ethernets:  
        eno1:  
            addresses:[10.0.0.2/24]  
            dhcp4: false  
            gateway4: 10.0.0.1  
            nameservers:  
                addresses: [8.8.8.8,1.1.1.1]  
    version: 2
1

I followed instructions here to update netplan config file and it worked. The following uses the correct indentation:

network:
  version: 2
  ethernets:
    eno1:
     dhcp4: no
     addresses: [10.0.0.2/24]
     gateway4: 10.0.0.1
     nameservers:
       addresses: [8.8.8.8,1.1.1.1]

Then, use the following command to apply the changes:

sudo netplan apply

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.