Debian 静态 ip,无法调出界面:“RTNETLINK 答案:文件存在”

Debian 静态 ip,无法调出界面:“RTNETLINK 答案:文件存在”

我全新安装了 SELKS(Debian 9),并且手动配置了网络,但无法启动接口eno1

我收到错误:

RTNETLINK answers: File exists
ifup: failed to bring up eno1

我的/etc/network/interface配置如下:

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eno1
iface eno1 inet static
    address 192.168.200.32/24
    gateway 192.168.200.1
    # dns-* options are implemented by the resolvconf package, if installed
    dns-nameservers 8.8.8.8

它是当我在安装程序中单击手动配置网络时由 Debian 安装程序自动生成的,所以我猜它是正确的。

我还注意到该/var/run/network/ifstate文件不包含eno1,并且该ifstate.eno1文件是空的:

root@user:/home/user# cat /var/run/network/ifstate
lo=lo
root@user:/home/user# ls /var/run/network/
ifstate  ifstate.eno1  ifstate.lo
root@user:/home/user# cat /var/run/network/ifstate.eno1 

root@user:/home/user# 

即使我尝试手动输入该值,eno1=eno1界面仍然无法启动。

我尝试关闭接口然后打开它,以及刷新接口(ip addr flush dev eno1),但结果是一样的:

root@user:/home/user# ifdown eno1
ifdown: interface eno1 not configured

root@user:/home/user# ifup -vvv eno1

ifup: configuring interface eno1=eno1 (inet)
/bin/run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
run-parts: executing /etc/network/if-pre-up.d/ethtool
run-parts: executing /etc/network/if-pre-up.d/wireless-tools
run-parts: executing /etc/network/if-pre-up.d/wpasupplicant
/bin/ip addr add 192.168.200.32/255.255.255.0 broadcast 192.168.200.255       dev eno1 label eno1
RTNETLINK answers: File exists
ifup: failed to bring up eno1

root@user:/home/user# ip addr flush dev eno1
root@user:/home/user# ifup eno1
RTNETLINK answers: No such file or directory
ifup: failed to bring up eno1

ethtool -i另外,以下是和的输出dmseg

root@user:/home/user# ethtool -i eno1
driver: bnx2
version: 2.2.6
firmware-version: 6.2.12 bc 5.2.3 NCSI 2.0.11
expansion-rom-version: 
bus-info: 0000:02:00.0
supports-statistics: yes
supports-test: yes
supports-eeprom-access: yes
supports-register-dump: yes
supports-priv-flags: no

root@user:/home/user# dmesg | grep -i eth
[    1.801411] bnx2: QLogic bnx2 Gigabit Ethernet Driver v2.2.6 (January 29, 2014)
[    1.802139] bnx2 0000:02:00.0 eth0: Broadcom NetXtreme II BCM5716 1000Base-T (C0) PCI Express found at mem da000000, IRQ 16, node addr bc:30:5b:d9:17:72
[    1.802971] bnx2 0000:02:00.1 eth1: Broadcom NetXtreme II BCM5716 1000Base-T (C0) PCI Express found at mem dc000000, IRQ 17, node addr bc:30:5b:d9:17:73
[    1.830740] bnx2 0000:02:00.0 eno1: renamed from eth0
[    1.849481] bnx2 0000:02:00.1 eno2: renamed from eth1
[    6.694317] ACPI Error: Method parse/execution failed [\_SB.PMI0._GHL] (Node ffff9202369ae460), AE_NOT_EXIST (20160831/psparse-543)
[    6.694558] ACPI Error: Method parse/execution failed [\_SB.PMI0._PMC] (Node ffff9202369aee38), AE_NOT_EXIST (20160831/psparse-543)

我尝试了这里针对该主题提出的几乎所有建议,但仍然找不到任何答案。

任何帮助均感激不尽。

答案1

您之前已手动分配了 IP 地址,但当您尝试启动接口时,地址分配失败。

第二个错误可能是由手动编辑文件引起的/var/run/network/ifstate.eno1。不要这样做!

因此,正确的步骤是:

  • ifdown --force -vvv <iface>
  • ip address flush dev <iface>
  • ip link set <iface> down
  • ifup -vvv <iface>

相关内容