新 xenial 安装 - 网络不工作

新 xenial 安装 - 网络不工作

希望有人能帮助我,因为我在这里有点困惑。

我已经在一台将用作我的虚拟化服务器的机器上重新安装了 xenial。在安装过程中,它抱怨无法连接 DHCP 服务器,因此我手动输入了网络详细信息 - 无论如何,这台机器都会有一个静态 IP。但是现在,接口显示为关闭,无法启动。这台机器以前工作正常,网卡和交换机都显示链接良好。我可能做了一些愚蠢的事情 - 这是一次略显匆忙的深夜安装 - 现在我对此视而不见......

root@numbersix:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp37s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 60:45:cb:64:2b:c8 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.6/24 brd 192.168.1.255 scope global enp37s0
       valid_lft forever preferred_lft forever
    inet 192.168.1.66/24 brd 192.168.1.255 scope global secondary enp37s0
       valid_lft forever preferred_lft forever
3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether 52:54:00:c3:56:78 brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
       valid_lft forever preferred_lft forever
4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN group default qlen 1000
    link/ether 52:54:00:c3:56:78 brd ff:ff:ff:ff:ff:ff

因此,我检查了网络服务的状态:

root@numbersix:~# systemctl status networking
● networking.service - Raise network interfaces
   Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: enabled)
  Drop-In: /run/systemd/generator/networking.service.d
           └─50-insserv.conf-$network.conf
   Active: failed (Result: exit-code) since Sun 2018-03-11 20:23:57 GMT; 23s ago
     Docs: man:interfaces(5)
  Process: 1984 ExecStart=/sbin/ifup -a --read-environment (code=exited, status=1/FAILURE)
  Process: 1979 ExecStartPre=/bin/sh -c [ "$CONFIGURE_INTERFACES" != "no" ] && [ -n "$(ifquery --read-environment --list --exclude=lo)" ] && udevadm settle (code=exited, status=0/SUCCESS)
 Main PID: 1984 (code=exited, status=1/FAILURE)

Mar 11 20:23:57 numbersix systemd[1]: Starting Raise network interfaces...
Mar 11 20:23:57 numbersix ifup[1984]: RTNETLINK answers: File exists
Mar 11 20:23:57 numbersix ifup[1984]: Failed to bring up enp37s0.
Mar 11 20:23:57 numbersix systemd[1]: networking.service: Main process exited, code=exited, status=1/FAILURE
Mar 11 20:23:57 numbersix systemd[1]: Failed to start Raise network interfaces.
Mar 11 20:23:57 numbersix systemd[1]: networking.service: Unit entered failed state.
Mar 11 20:23:57 numbersix systemd[1]: networking.service: Failed with result 'exit-code'.

并尝试‘开始’:

root@numbersix:~# systemctl start networking
Job for networking.service failed because the control process exited with error code. See "systemctl status networking.service" and "journalctl -xe" for details.

然后检查journalctl:

root@numbersix:~# journalctl -xe
Mar 11 20:23:25 numbersix systemd[1]: Starting Raise network interfaces...
-- Subject: Unit networking.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit networking.service has begun starting up.
Mar 11 20:23:25 numbersix ifup[1934]: RTNETLINK answers: File exists
Mar 11 20:23:25 numbersix ifup[1934]: Failed to bring up enp37s0.
Mar 11 20:23:25 numbersix systemd[1]: networking.service: Main process exited, code=exited, status=1/FAILURE
Mar 11 20:23:25 numbersix systemd[1]: Failed to start Raise network interfaces.
-- Subject: Unit networking.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit networking.service has failed.
-- 
-- The result is failed.
Mar 11 20:23:25 numbersix systemd[1]: networking.service: Unit entered failed state.
Mar 11 20:23:25 numbersix systemd[1]: networking.service: Failed with result 'exit-code'.
Mar 11 20:23:57 numbersix systemd[1]: Starting Raise network interfaces...
-- Subject: Unit networking.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit networking.service has begun starting up.
Mar 11 20:23:57 numbersix ifup[1984]: RTNETLINK answers: File exists
Mar 11 20:23:57 numbersix ifup[1984]: Failed to bring up enp37s0.
Mar 11 20:23:57 numbersix systemd[1]: networking.service: Main process exited, code=exited, status=1/FAILURE
Mar 11 20:23:57 numbersix systemd[1]: Failed to start Raise network interfaces.
-- Subject: Unit networking.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit networking.service has failed.
-- 
-- The result is failed.
Mar 11 20:23:57 numbersix systemd[1]: networking.service: Unit entered failed state.
Mar 11 20:23:57 numbersix systemd[1]: networking.service: Failed with result 'exit-code'.

(我想我已经在这里包含了相关的输出)...

我尝试单独调出界面:

root@numbersix:~# ifup -v enp37s0
Configuring interface enp37s0=enp37s0 (inet)
/bin/run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
run-parts: executing /etc/network/if-pre-up.d/bridge
run-parts: executing /etc/network/if-pre-up.d/ethtool
run-parts: executing /etc/network/if-pre-up.d/ifenslave
+ [ inet = meta ]
+ IF_BOND_SLAVES=
+ [  ]
+ [  ]
+ [ -z  ]
+ exit
run-parts: executing /etc/network/if-pre-up.d/vlan
/bin/ip addr add 192.168.1.66/255.255.255.0 broadcast 192.168.1.255       dev enp37s0 label enp37s0
RTNETLINK answers: File exists
Failed to bring up enp37s0.

然后挖掘了更多信息:

root@numbersix:~# lshw -C network
  *-network DISABLED
       description: Ethernet interface
       product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:25:00.0
       logical name: enp37s0
       version: 15
       serial: 60:45:cb:64:2b:c8
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full ip=192.168.1.6 latency=0 link=no multicast=yes port=MII speed=1Gbit/s
       resources: irq:43 ioport:f000(size=256) memory:fe504000-fe504fff memory:fe500000-fe503fff
  *-network DISABLED
       description: Ethernet interface
       physical id: 1
       logical name: virbr0-nic
       serial: 52:54:00:c3:56:78
       size: 10Mbit/s
       capabilities: ethernet physical
       configuration: autonegotiation=off broadcast=yes driver=tun driverversion=1.6 duplex=full link=no multicast=yes port=twisted pair speed=10Mbit/s


root@numbersix:~# lspci -nnk | grep -i A2 net
    25:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 15)
        Subsystem: ASUSTeK Computer Inc. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [1043:8677]
        Kernel driver in use: r8169
        Kernel modules: r8169


root@numbersix:~# lsmod | grep r8169
r8169                  86016  0
mii                    16384  1 r8169
root@numbersix:~# grep r8169 /etc/modprobe/*
root@numbersix:~#

有任何想法吗?

亚当...

答案1

我强烈怀疑 Terrance 的说法是正确的 - xenial 安装选择了 r8169 驱动程序而不是 r8168,这导致了卡出现问题。我不明白为什么 xenial 安装会这样做,而 zesty 安装(就地升级到 aardvark)却毫无反应。

当然,没有网络,运行的过程更像sudo apt install是 PitA;我尝试了一下,将我需要的驱动程序加载到 U 盘上,但后来意识到我的 Windows PC 上有一个 Centos 7 ISO。准备安装 USB 的工作量与获取构建正确驱动程序所需的软件包的工作量大致相同。Centos 安装了正确的驱动程序 - 当然还有其他一切 - 没有任何问题。

我可能会在某个阶段再玩一次,也许是在 KVM 中......

相关内容