启动时不会显示 netplan 中的桥接配置

启动时不会显示 netplan 中的桥接配置

我有一个正在运行的 ubuntu 18.04,并决定将其移至 Proxmmox 中的 VM。

配置包括一个桥接器,它在之前的系统中运行良好,但它并没有在 Proxmox VM 启动时出现。

这是我的 netplan 配置:

network:
    renderer: networkd
    ethernets:
            ens18:
                    dhcp4: false
                    addresses: [172.18.0.4/29]
                    gateway4: 172.18.0.1
                    nameservers:
                            addresses: [8.8.8.8]
            ens19:
                    dhcp4: false
            ens20:
                    dhcp4: false
            ens21:
                    dhcp4: false
    bridges:
            br0:
                    addresses: [10.0.0.1/16]
                    interfaces: [ens19, ens20, ens21]
                    gateway4: 10.0.0.1
                    dhcp4: false
    version: 2

当系统启动时我可以运行

netplan apply

并且运行完美。

我也尝试过使用 crontab 来临时解决这个问题,

@reboot netplan apply

但它也不起作用。

netplan --debug generate

不会产生错误。

我在 journalctl 中看到了这些消息

Jul 11 10:20:49 kernel: br0: port 3(ens19) entered disabled state
Jul 11 10:20:49 kernel: br0: port 2(ens20) entered disabled state
Jul 11 10:20:49 kernel: br0: port 1(ens21) entered disabled state
Jul 11 10:20:49 systemd-networkd[643]: br0: Lost carrier
Jul 11 10:20:49 systemd-timesyncd[657]: Network configuration changed, trying to establish connection.
Jul 11 10:20:49 kernel: device ens19 left promiscuous mode
Jul 11 10:20:49 kernel: br0: port 3(ens19) entered disabled state
Jul 11 10:20:49 systemd-timesyncd[657]: Network configuration changed, trying to establish connection.
Jul 11 10:20:49 kernel: device ens20 left promiscuous mode
Jul 11 10:20:49 kernel: br0: port 2(ens20) entered disabled state
Jul 11 10:20:49 kernel: device ens21 left promiscuous mode
Jul 11 10:20:49 kernel: br0: port 1(ens21) entered disabled state
Jul 11 10:20:49 networkd-dispatcher[785]: WARNING:Unknown index 3 seen, reloading interface list
Jul 11 10:20:49 systemd-timesyncd[657]: Network configuration changed, trying to establish connection.
Jul 11 10:20:49 systemd-timesyncd[657]: Network configuration changed, trying to establish connection.
Jul 11 10:20:49 networkd-dispatcher[785]: WARNING:Unknown index 4 seen, reloading interface list
Jul 11 10:20:49 systemd-timesyncd[657]: Network configuration changed, trying to establish connection.
Jul 11 10:20:49 systemd-timesyncd[657]: Network configuration changed, trying to establish connection.
Jul 11 10:20:49 systemd-timesyncd[657]: Network configuration changed, trying to establish connection.
Jul 11 10:20:49 systemd-timesyncd[657]: Network configuration changed, trying to establish connection.
Jul 11 10:20:49 networkd-dispatcher[785]: WARNING:Unknown index 5 seen, reloading interface list
Jul 11 10:20:49 systemd-networkd[643]: ens19: Could not join netdev: No such device
Jul 11 10:20:49 systemd-networkd[643]: ens19: Failed
Jul 11 10:20:49 systemd-timesyncd[657]: Network configuration changed, trying to establish connection.
Jul 11 10:20:49 systemd-timesyncd[657]: Network configuration changed, trying to establish connection.
Jul 11 10:20:49 systemd-networkd[643]: ens20: Could not join netdev: No such device
Jul 11 10:20:49 systemd-networkd[643]: ens20: Failed
Jul 11 10:20:49 systemd-timesyncd[657]: Network configuration changed, trying to establish connection.
Jul 11 10:20:49 systemd-timesyncd[657]: Network configuration changed, trying to establish connection.
Jul 11 10:20:49 systemd-networkd[643]: ens21: Could not join netdev: No such device
Jul 11 10:20:49 systemd-networkd[643]: ens21: Failed

所以我怀疑在尝试创建桥梁时接口尚未准备好。

我一直在寻找一种方法来在这些接口准备就绪后执行 netplan apply,但还没有找到方法。我相信同一项服务可以同时完成这两件事。

为什么启动时不应用配置?我是不是丢失了什么?Proxmox 和 Ubuntu 桥接器存在问题吗?

相关内容