0

Since upgrading to 18.04 from 16.04 I can't connect to websites. I understand with netplan that resolv.conf is no longer used. I can ping all sites with ip addresses and tie into server via ssh. I had to ceate /etc/netplan 01-netcfg.yaml. Which checks out as valid yaml but when I sudo netplan apply I get an error of "Error in network definition //etc/netplan/01-netcfg.yaml line 4 column 15: expected mapping" My yaml is as follows and appears as observed samples.

# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
  ethernets:
    addresses: "192.168.1.161"
    dhcp4: false
    enp3s0: ~
    gateway4: "192.168.1.1"
    nameservers:
      addresses:
        - "71.242.0.12"
        - "71.250.0.12"
    renderer: networkd
    version: 2

What am I doing wrong? Any help would be greatly appreciated. I have limited knowledge of linux so examples are much appreciated. Tom

  • I noticed from official documentation that the renderer should be just above the line ethernets – George Udosen Sep 7 '18 at 17:45
0

after ethernets, on next line you have to specify name of your interface, something like

 version: 2
  renderer: networkd
  ethernets:
    eth4:
      dhcp4: yes
      dhcp6: False
    eth0:
      dhcp4: False
      dhcp6: False
      addresses: [192.168.110.2/24]

Which means your enp3so must go after ethernets and then the rest, properly formatted, you need to add some spaces at the beginning

| improve this answer | |
  • I have a fixed ip (shown under ethernets) and it is entered manually without a DHCP and I have disabled IPV6. The name servers are the dns servers issued by Verizon. What would I change to get this yaml to work. – TomM Sep 7 '18 at 17:54
  • George, I tried your yaml and got this error "Invalid YAML at //etc/netplan/01-netcfg.yaml line 9 column 16: mapping values are not allowed in this context" What might I have done wrong? Thanks – TomM Sep 7 '18 at 18:12
  • This is my new yaml – TomM Sep 7 '18 at 19:45
  • # This file describes the network interfaces available on your system # For more information, see netplan(5). network: version: 2 renderer: networkd ethernets: addresses: 192.168.1.161 dhcp4: false enp3s0: ~ gateway4: 192.168.1.1 nameservers: addresses: - 71.242.0.12 - 71.250.0.12 – TomM Sep 8 '18 at 14:06

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.