我有一个使用 Netplan 提供网络的系统,但在配置方面遇到了一些问题。
当我启动盒子时,没有网络。当我尝试运行时netplan apply
,我得到
Error in network definition //etc/netplan/01-netcfg.yaml line 26 column 18: expected sequence
这没有任何意义,因为第 26 行第 18 列是“managementbr0”后面的“:”:
bridges:
managementbro:
为什么那里应该有一个序列?这是我的完整 01-netcfg.yaml
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: no
eth1:
dhcp4: no
ib0:
addresses: [ x.x.x.x/24 ]
mtu: 65520
bonds:
bond0:
interfaces: [ eth0, eth1 ]
parameters:
mode: active-backup
mii-monitor-interval: 100
vlans:
bond0.229:
id: 229
link: bond0
bond0.228:
id: 228
link: bond0
bridges:
managementbr0:
interfaces: bond0
addresses: [ x.x.x.x/22 ]
nameservers:
search: [ foobar.net ]
addresses: [ x.x.x.x, x.x.x.x ]
parameters:
forward-delay: 9
hello-time: 2
max-age: 12
stp: false
routes:
- to: x.x.x.x/8
via: x.x.x.x
br0:
addresses: [ x.x.x.x/22 ]
interfaces: bond0.229
gateway4: x.x.x.x
nameservers:
search: [ foobar.net ]
addresses: [ x.x.x.x, x.x.x.x ]
parameters:
forward-delay: 9
hello-time: 2
max-age: 12
stp: false
br1:
interfaces: bond0.228
parameters:
forward-delay: 9
hello-time: 2
max-age: 12
stp: false
奇怪的是,在具有类似硬件的类似系统上,此配置在启动时有效,但是在启动时有效的同一系统上,如果我运行netplan generate
或netplan apply
,我会得到相同的错误Error in network definition //etc/netplan/01-netcfg.yaml line 26 column 18: expected sequence
在此先感谢您的帮助。
答案1
来自OP的编辑:
我通过将接口括在括号“[” “]”中来解决这个问题