当我尝试应用 netplan 时出现此错误。eno2 存在,但 netplan 说它未定义。
network:
version: 2
renderer: networkd
bonds:
bond0:
interfaces: [eno1, eno2]
addresses: [192.168.0.104/24]
gateway4: 192.168.0.1
parameters:
mode: 802.3ad
nameservers:
addresses: [192.168.0.2]
dhcp4: false
optional: true
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:00:00:00:00:da brd ff:ff:ff:ff:ff:ff
inet 192.168.0.12/24 brd 192.168.0.255 scope global dynamic eno1
valid_lft 6374sec preferred_lft 6374sec
inet6 fe80::ae1f:6bff:fefc:a9da/64 scope link
valid_lft forever preferred_lft forever
3: eno2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 00:00:00:00:00:db brd ff:ff:ff:ff:ff:ff
答案1
尽管该设备存在于内核级别,但您必须在 netplan yaml 中提供配置,以定义它供 netplan 使用。否则 netplan 将不会假定此名称的内核设备是您想要的。
network:
version: 2
renderer: networkd
ethernets:
eno1: {}
eno2: {}
bonds:
bond0:
interfaces: [eno1, eno2]
addresses: [192.168.0.104/24]
gateway4: 192.168.0.1
parameters:
mode: 802.3ad
nameservers:
addresses: [192.168.0.2]
dhcp4: false
optional: true