systemd 说“networking.service failed”但网络已启动

systemd 说“networking.service failed”但网络已启动

通常,我使用 openrc init 运行 Gentoo,但正在安装 Debian 10 服务器并且在理解系统时遇到一些困难。服务器通过自定义 dracut initrd 启动,该启动创建了绑定网络接口,然后从 iscsi 根启动。那部分一切正常。启动时会出现三个接口及其各自的网络:192.168.1.0/24、10.0.0.0/24 和 172.16.0.0/24。

我的(小)问题是 systemd 提供以下信息:

# systemctl --failed
  UNIT               LOAD   ACTIVE SUB    DESCRIPTION
● networking.service loaded failed failed Raise network interfaces

我认为这主要是由于其中一个网络在初始化时处于活动状态。在Gentoo中,我可以将一个接口标记为不提供网络服务。 systemd 是否有类似的概念,或者是否有我遗漏的设置?同样,所有接口实际上都已启动并正常工作(2 个网桥,1 个绑定),我已经剪掉了本地接口以及绑定和网桥中的 NICS。

 # ip addr list
[...]
7: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 9000 qdisc noqueue state UP group default qlen 1000
    link/ether 24:6e:96:5e:a3:9c brd ff:ff:ff:ff:ff:ff
    inet 172.16.0.14/24 brd 172.16.0.255 scope global dynamic bond0
       valid_lft 249300sec preferred_lft 249300sec
    inet6 fe80::266e:96ff:fe5e:a39c/64 scope link
       valid_lft forever preferred_lft forever
[...]
9: vmbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 00:10:18:64:0f:3c brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.14/24 brd 192.168.1.255 scope global vmbr0
       valid_lft forever preferred_lft forever
    inet6 fe80::210:18ff:fe64:f3c/64 scope link
       valid_lft forever preferred_lft forever
10: vmbr1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 00:10:18:64:0f:3e brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.14/24 brd 10.0.0.255 scope global vmbr1
       valid_lft forever preferred_lft forever
    inet6 fe80::210:18ff:fe64:f3e/64 scope link
       valid_lft forever preferred_lft forever

# ping -I vmbr0 -c 3 8.8.8.8
PING 8.8.8.8 (8.8.8.8) from 192.168.1.14 vmbr0: 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=57 time=68.4 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=57 time=114 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=57 time=61.6 ms

预先感谢您的任何想法。

[编辑所需的附加信息]

# systemctl status networking.service
● networking.service - Raise network interfaces
   Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2021-05-04 08:47:07 CDT; 4h 13min ago
     Docs: man:interfaces(5)
 Main PID: 1586 (code=exited, status=1/FAILURE)

May 04 08:47:04 proxmox systemd[1]: Starting Raise network interfaces...
May 04 08:47:04 proxmox ifup[1586]: Waiting for a max of 0 seconds for # no delay before a port becomes available to bec
May 04 08:47:05 proxmox ifup[1586]: Waiting for vmbr0 to get ready (MAXWAIT is 2 seconds).
May 04 08:47:06 proxmox ifup[1586]: Waiting for a max of 0 seconds for # no delay before a port becomes available to bec
May 04 08:47:07 proxmox ifup[1586]: Waiting for vmbr1 to get ready (MAXWAIT is 2 seconds).
May 04 08:47:07 proxmox ifup[1586]: RTNETLINK answers: File exists
May 04 08:47:07 proxmox ifup[1586]: ifup: failed to bring up vmbr1
May 04 08:47:07 proxmox systemd[1]: networking.service: Main process exited, code=exited, status=1/FAILURE
May 04 08:47:07 proxmox systemd[1]: networking.service: Failed with result 'exit-code'.
May 04 08:47:07 proxmox systemd[1]: Failed to start Raise network interfaces.

# journalctl -u networking.service
-- Logs begin at Tue 2021-05-04 08:46:28 CDT, end at Tue 2021-05-04 12:17:01 CDT. --
May 04 08:47:04 proxmox systemd[1]: Starting Raise network interfaces...
May 04 08:47:04 proxmox ifup[1586]: Waiting for a max of 0 seconds for # no delay before a port becomes available to bec
May 04 08:47:05 proxmox ifup[1586]: Waiting for vmbr0 to get ready (MAXWAIT is 2 seconds).
May 04 08:47:06 proxmox ifup[1586]: Waiting for a max of 0 seconds for # no delay before a port becomes available to bec
May 04 08:47:07 proxmox ifup[1586]: Waiting for vmbr1 to get ready (MAXWAIT is 2 seconds).
May 04 08:47:07 proxmox ifup[1586]: RTNETLINK answers: File exists
May 04 08:47:07 proxmox ifup[1586]: ifup: failed to bring up vmbr1
May 04 08:47:07 proxmox systemd[1]: networking.service: Main process exited, code=exited, status=1/FAILURE
May 04 08:47:07 proxmox systemd[1]: networking.service: Failed with result 'exit-code'.
May 04 08:47:07 proxmox systemd[1]: Failed to start Raise network interfaces.

答案1

解决了!

我在 /etc/network/interfaces 中定义了两个网关。一旦我删除了除一个之外的所有内容,错误就得到了纠正。

# systemctl --failed
0 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.

相关内容