YAML 在 DNS 地址上很烦人:

YAML 在 DNS 地址上很烦人:
~# sudo netplan apply
/etc/netplan/01-netcfg.yaml:16:18: Error in network definition: address '8.8.8.8' is missing /prefixlength
      addresses: [8.8.8.8,8.8.4.4]
                 ^

答案1

network:
 version: 2
 ethernets: {}
 renderer: networkd
 ethernets:
  ens160:
  dhcp4: no
  addresses: [206.80.236.251/29]
  gateway4: 206.80.236.249
  nameservers: 
    addresses: [8.8.8.8,8.8.4.4]

确保在此阶段正确设置间距:

nameserver 

应与gateway&对齐addresses,同时留出空间

相关内容