Ubuntu Server 22.04.2 LTS 持续错误 systemd-networkd-wait-online.service

Ubuntu Server 22.04.2 LTS 持续错误 systemd-networkd-wait-online.service

运行 Ubuntu 服务器 22.04.2 LTS,运行正常,但有一个持续失败的 systemd 服务:“systemd-networkd-wait-online.service”,尝试了各种方法,包括禁用(不起作用)屏蔽(再次不允许我这样做),systemctl status 给我降级。networkctl 的输出为:

IDX LINK   TYPE     OPERATIONAL SETUP      
  1 lo     loopback carrier     unmanaged
  2 eno1   ether    routable    configured 
  3 eno2   ether    no-carrier  configuring
  4 usb0   ether    off         unmanaged
  5 virbr0 bridge   no-carrier  unmanaged

5 links listed."

我怀疑它是 eno2 接口,systemctl 的输出显示:

Jul 01 14:00:47 supermicro systemd[1]: Starting Wait for Network to be Configured...
Jul 01 14:00:57 supermicro systemd-networkd-wait-online[7530]: Timeout occurred while waiting for network connectivity.
Jul 01 14:00:57 supermicro systemd[1]: systemd-networkd-wait-online.service: Main process exited, code=exited, status=1/FAILURE
Jul 01 14:00:57 supermicro systemd[1]: systemd-networkd-wait-online.service: Failed with result 'exit-code'.
Jul 01 14:00:57 supermicro systemd[1]: Failed to start Wait for Network to be Configured.

服务器通过 RJ45 电缆连接到路由器,主板上只有一个以太网插槽。不知道还能做什么?欢迎提供任何帮助.....

答案1

您可以添加RequiredForOnline=no到“eno2”的配置中,它将不再检查接口的在线状态。

https://www.freedesktop.org/software/systemd/man/systemd.network.html

答案2

使用以下命令将第二个接口标记为启动时可选https://askubuntu.com/a/1323542

sudo nano /etc/netplan/00-installer-config.yaml 
network:
  ethernets:
    eno2:
      dhcp4: true
      optional: true    # add this

相关内容