Debian 11 (Bullseye) 中只有一个 IP 地址可见/可用

Debian 11 (Bullseye) 中只有一个 IP 地址可见/可用

从 Buster 升级到 Bullseye 后,只有一个接口具有有效的 IPv4 配置。

我有一个双网卡 Intel PCIx 卡和一个板载 RealTec 网卡(目前在 BIOS 中禁用),但我无法让网卡#2(和#3)工作。系统检测卡,并相应地重命名它,但不会检测链接,也不会在分配后使用 IP 地址(静态/dhcp)

来自 dmesg:

[    1.004895] igb 0000:01:00.0: added PHC on eth0
[    1.004900] igb 0000:01:00.0: Intel(R) Gigabit Ethernet Network Connection
[    1.004904] igb 0000:01:00.0: eth0: (PCIe:2.5Gb/s:Width x4) 1c:fd:08:73:60:e0
[    1.004986] igb 0000:01:00.0: eth0: PBA No: E43709-006
[    1.004989] igb 0000:01:00.0: Using MSI-X interrupts. 4 rx queue(s), 4 tx queue(s)
[    1.096063] usb 1-1: new high-speed USB device number 2 using xhci_hcd
[    1.180841] igb 0000:01:00.1: added PHC on eth1
[    1.180845] igb 0000:01:00.1: Intel(R) Gigabit Ethernet Network Connection
[    1.180849] igb 0000:01:00.1: eth1: (PCIe:2.5Gb/s:Width x4) 1c:fd:08:73:60:e1
[    1.180931] igb 0000:01:00.1: eth1: PBA No: E43709-006
[    1.180934] igb 0000:01:00.1: Using MSI-X interrupts. 4 rx queue(s), 4 tx queue(s)
[    1.183527] igb 0000:01:00.0 enp1s0f0: renamed from eth0
.
[    1.204343] igb 0000:01:00.1 enp1s0f1: renamed from eth1
.
[    5.596440] igb 0000:01:00.0 enp1s0f0: igb: enp1s0f0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX
[    5.596675] IPv6: ADDRCONF(NETDEV_CHANGE): enp1s0f0: link becomes ready

两个接口都在 /etc/network/interfaces 中配置:

auto enp1s0f0
allow-hotplug enp1s0f0
iface enp1s0f0 inet static
address 192.168.22.1
netmask 255.255.255.0
broadcast 192.168.22.255

auto enp1s0f1
allow-hotplug enp1s0f1
iface enp1s0f1 inet dhcp

ifconfig /ip a 仅报告 lo 和 enp1s0f0:

enp1s0f0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.22.1  netmask 255.255.255.0  broadcast 192.168.22.255
.
.

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
.
.

即使 dhclient 已启动 enp1s0f1 :

Sep 18 11:54:17 vile dhclient[529]: Listening on LPF/enp1s0f1/1c:fd:08:73:60:e1
Sep 18 11:54:17 vile sh[529]: Listening on LPF/enp1s0f1/1c:fd:08:73:60:e1
Sep 18 11:54:17 vile sh[529]: Sending on   LPF/enp1s0f1/1c:fd:08:73:60:e1
Sep 18 11:54:17 vile sh[529]: Sending on   Socket/fallback
Sep 18 11:54:17 vile sh[529]: DHCPDISCOVER on enp1s0f1 to 255.255.255.255 port 67 interval 3
Sep 18 11:54:17 vile sh[529]: send_packet: Network is down
Sep 18 11:54:17 vile sh[529]: dhclient.c:2446: Failed to send 300 byte long packet over enp1s0f1 interface.

ifup 说:

#> ifup enp1s0f1
ifup: interface enp1s0f1 already configured

指定接口名称会显示卡上的信息:

#> ifconfig enp1s0f1 
enp1s0f1: flags=4098<BROADCAST,MULTICAST>  mtu 1500
        ether 1c:fd:08:73:60:e1  txqueuelen 1000  (Ethernet)
.
.

手动升起界面,

#> ifconfig enp1s0f1 up

为接口提供 dhcp-address :

Sep 18 12:45:35 vile kernel: [ 3080.994947] igb 0000:01:00.1 enp1s0f1: igb: enp1s0f1 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX/TX
Sep 18 12:45:35 vile kernel: [ 3080.995217] IPv6: ADDRCONF(NETDEV_CHANGE): enp1s0f1: link becomes ready
Sep 18 12:45:37 vile ntpd[801]: bind(28) AF_INET6 fe80::1efd:8ff:fe73:60e1%3#123 flags 0x11 failed: Cannot assign requested address
Sep 18 12:45:37 vile ntpd[801]: unable to create socket on enp1s0f1 (11) for fe80::1efd:8ff:fe73:60e1%3#123
Sep 18 12:45:37 vile ntpd[801]: failed to init interface for address fe80::1efd:8ff:fe73:60e1%3
Sep 18 12:45:37 vile dhclient[2556]: DHCPDISCOVER on enp1s0f1 to 255.255.255.255 port 67 interval 3
Sep 18 12:45:37 vile dhclient[2556]: DHCPOFFER of 10.0.1.2 from 10.0.1.1
Sep 18 12:45:37 vile dhclient[2556]: DHCPREQUEST for 10.0.1.2 on enp1s0f1 to 255.255.255.255 port 67
Sep 18 12:45:37 vile dhclient[2556]: DHCPACK of 10.0.1.2 from 10.0.1.1
Sep 18 12:45:37 vile dhclient[2556]: bound to 10.0.1.2 -- renewal in 33797 seconds.

但是,ifconfig 仍然不显示任何 IPv4 地址:

enp1s0f1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::1efd:8ff:fe73:60e1  prefixlen 64  scopeid 0x20<link>
        ether 1c:fd:08:73:60:e1  txqueuelen 1000  (Ethernet)

并且 iproute2 中不可见/不使用任何路由信息:

#> ip ro ls
0.0.0.0/1 via 10.251.4.1 dev tun9
default via 192.168.22.254 dev enp1s0f0
10.251.4.0/24 dev tun9 proto kernel scope link src 10.251.4.77
128.0.0.0/1 via 10.251.4.1 dev tun9
155.4.89.151 via 192.168.22.254 dev enp1s0f0
192.168.22.0/24 dev enp1s0f0 proto kernel scope link src 192.168.22.1

#> ip ro get 10.0.1.1
10.0.1.1 via 10.251.4.1 dev tun9 src 10.251.4.77 uid 0
    cache

tcpdump 显示接口上的流量

我已经使用板载 RealTec-nic 尝试了相同的步骤,具有相同的行为。我也尝试过旧的 Buster-kernel ( Linux 版本 4.19.0-16-amd64 ([电子邮件受保护]) (gcc 版本 8.3.0 (Debian 8.3.0-6)) #1 SMP Debian 4.19.181-1 (2021-03-19) )

蒂亚/约翰

答案1

作为解决方法,我设法使用 NetworkManager (cli-version :) )来管理辅助网卡。

设备 enp1s0f0 不再在 /etc/network/interfaces 中配置,NetworkManager 守护程序自动管理该接口

#> nmcli device 
DEVICE    TYPE      STATE                   CONNECTION
enp1s0f1  ethernet  connected               Wired connection 1
enp1s0f0  ethernet  unmanaged               --
lo        loopback  unmanaged               --

现在, ifconfig / ip a 给出 #> ifconfig enp1s0f0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.22.1 netmask 255.255.255.0 Broadcast 192.168.22.255 。 。 。

enp1s0f1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
    inet xxx.xxx.xxx.xxx  netmask 255.255.255.192  broadcast xxx.xxx.xxx.255
.
.
.

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0

iproute2 也很高兴:

#> ip ro ls
0.0.0.0/1 via 10.251.3.1 dev tun9
default via xxx.xxx.xxx.193 dev enp1s0f1 proto dhcp metric 100
10.251.3.0/24 dev tun9 proto kernel scope link src 10.251.3.50
xxx.xxx.xxx.192/26 dev enp1s0f1 proto kernel scope link src xxx.xxx.xxx.213 metric 100
128.0.0.0/1 via 10.251.3.1 dev tun9
192.168.22.0/24 dev enp1s0f0 proto kernel scope link src 192.168.22.1

并且接口正在通过 NetworkManager 接收 DHCP 地址:

Dec  7 15:38:29 host NetworkManager[615]: <info>  [1638887909.8445] dhcp4 (enp1s0f1): state changed extended -> extended, address=xxx.xxx.xxx.213

因此,在等待“正确”的解决方案时,我将此作为解决方法。

//约翰

答案2

编辑你的/etc/NetworkManager/NetworkManager.conf如下:

[main]
plugins=ifupdown,keyfile

[ifupdown]
managed=true

[device]
wifi.scan-rand-mac-address=no

允许managed=trueNM 管理 中配置的接口/etc/network/interfaces。看启用接口管理然后运行:

sudo service NetworkManager restart

相关内容