# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled} network:
network:
ethernets:
eno1:
addresses:
- 10.10.6.50/24
dhcp4: false
gateway4: 10.10.6.1
nameservers:
addresses:
- 8.8.8.8
- 8.8.4.4
search: []
enp3s2:
dhcp4: false
bridges:
br0:
dhcp4: false
interfaces:
- enp3s2
addresses:
- 10.10.7.50/24
version: 2
當我運行時sudo netplan apply
出現以下錯誤
//etc/netplan/50-cloud-init.yaml 第 17 行第 2 列處的 YAML 無效:未找到預期的金鑰
我想要的只是創建一個工作橋接網絡,但受 yaml 困擾,有人可以幫忙嗎?
答案1
一些建議:
1) 「版本:2」必須在「乙太網路」的同一層級上被辨識。我曾經將其添加為網路之後的第一行:
2) 在兩個配置(eno1 和 br0)上加上“dhcp6: false”