大网数据广告活动
服务器运维问答

networking.service fails in Debian buster

· 52CE 我爱测

networking.service fails to bring up eth0:2 and eth0:3, but my configuration seems correct. I tried several things, also renamed the NIC from ens3 to eth0 /etc/network/interfaces: auto lo iface lo inet loopback allow-hotplug eth0…

问题原文

原帖链接 · Tim Altgeld · CC BY-SA 4.0

networking.service fails to bring up eth0:2 and eth0:3, but my configuration seems correct.

I tried several things, also renamed the NIC from ens3 to eth0

/etc/network/interfaces:

auto lo
iface lo inet loopback

allow-hotplug eth0

auto eth0
iface eth0 inet static
    address xx.xxx.xxx.xxx/22
    gateway xx.xxx.xxx.x

allow-hotplug eth0:1
auto eth0:1
iface eth0:1 inet6 static
    address 2a03:xxxx:x:xxxx::1000/64
    gateway fe80::1

allow-hotplug eth0:2
iface eth0:2 inet6 static
    address 2a03:xxxx:x:xxxx::2000/64
    gateway fe80::1

allow-hotplug eth0:3
iface eth0:3 inet6 static
    address 2a03:xxxx:x:xxxx::3000/64
    gateway fe80::1

Expected:

On boot, eth0 and eth0:1 are brought up automatically.

ifup eth0:2 and ifup eth0:3 brings up the other NICs

Actual:

ifup eth0:2
RTNETLINK answers: File exists
ifup: failed to bring up eth0:2

ifup eth0:3
RTNETLINK answers: File exists
ifup: failed to bring up eth0:3

It gives an ERROR, but despite the error, the adapter is loaded and the IPv6 is working.

Also, if i add

auto eth0:2

auto eth0:3

networking.service fails on boot:


● networking.service - Raise network interfaces
   Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2019-07-19 20:29:26 CEST; 1min 21s ago
     Docs: man:interfaces(5)
  Process: 409 ExecStart=/sbin/ifup -a --read-environment (code=exited, status=1/FAILURE)
 Main PID: 409 (code=exited, status=1/FAILURE)
Jul 19 20:29:24 root systemd[1]: Starting Raise network interfaces...
Jul 19 20:29:24 root ifup[409]: ifup: waiting for lock on /run/network/ifstate.eth0
Jul 19 20:29:26 root ifup[409]: Waiting for DAD... Done
Jul 19 20:29:26 root ifup[409]: RTNETLINK answers: File exists
Jul 19 20:29:26 root ifup[409]: ifup: failed to bring up eth0:2
Jul 19 20:29:26 root ifup[409]: RTNETLINK answers: File exists
Jul 19 20:29:26 root ifup[409]: ifup: failed to bring up eth0:3
Jul 19 20:29:26 root systemd[1]: networking.service: Main process exited, code=exited, status=1/FAILURE
Jul 19 20:29:26 root systemd[1]: networking.service: Failed with result 'exit-code'.
Jul 19 20:29:26 root systemd[1]: Failed to start Raise network interfaces.

Despite the networking.service fails, all IPv6 are working.

I have no clue whats the problem.

已采纳解答

原帖链接 · Michael Hampton · CC BY-SA 4.0

You're trying to use the obsolete interface alias format (eth0:x) with IPv6, and that doesn't work. These are not actually separate interfaces, and never have been. It has also been recommended not to use them for more than a decade. You should not do so. (And you should ignore the long obsolete warning in the Debian wiki about this method.)

The correct configuration is to place all of the addresses in interface eth0 (or, rather, ens3 as it should not be eth0 anymore).

auto lo
iface lo inet loopback

allow-hotplug eth0

auto eth0
iface eth0 inet static
    address xx.xxx.xxx.xxx/22
    gateway xx.xxx.xxx.x

iface eth0 inet6 static
    address 2a03:xxxx:x:xxxx::1000/64
    gateway fe80::1

iface eth0 inet6 static
    address 2a03:xxxx:x:xxxx::2000/64

iface eth0 inet6 static
    address 2a03:xxxx:x:xxxx::3000/64

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-07-19)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。