我花了一段时间才找到 Netplan 与 VLAN 正常工作的正确格式。无论如何,这适用,但会破坏两个 VLAN 上的 ping 和 ssh。我还希望只在 VLAN 接口上使用 ip 地址,而不是实际的 bond0 接口,这可能吗?
network:
bonds:
bond0:
addresses:
- (ip addr of bond0)/27
gateway4: (gw of bond 0)
interfaces:
- eno1
- eno2
nameservers:
addresses:
- (internal dns server 1)
- (internal dns server 2)
parameters:
lacp-rate: slow
mode: 802.3ad
transmit-hash-policy: layer2
ethernets:
eno1: {}
eno2: {}
version: 2
vlans:
bond0.6:
id: 6
link: bond0
addresses: [ (ip addr of vlan 6)/27 ]
bond0.12:
id: 12
link: bond0
addresses: [ (ip addr of vlan 12)/24 ]