我正在尝试启动并运行我的 LAN 端口。我的系统上可用的接口是:
user@user-NUC7i5BNH:~$ cat /etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
# USB device 0x:0x (ath9k_htc)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="e8:de:27:0f:79:8c", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0"
# PCI device 0x8086:0x15d8 (e1000e)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="94:c6:91:1f:26:d4", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
如您所见,wlan0(外部 USB wifi 适配器)和 eth0 可用。但是,插入 LAN 电缆并运行 ifconfig 后,出现以下情况:
user@user-NUC7i5BNH:~$ ifconfig -a
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:1439 errors:0 dropped:0 overruns:0 frame:0
TX packets:1439 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:140959 (140.9 KB) TX bytes:140959 (140.9 KB)
wlan0 Link encap:Ethernet HWaddr e8:de:27:0f:79:8c
inet addr:192.168.100.235 Bcast:192.168.100.255 Mask:255.255.255.0
inet6 addr: fe80::eade:27ff:fe0f:798c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:18714 errors:0 dropped:0 overruns:0 frame:0
TX packets:8301 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:11072061 (11.0 MB) TX bytes:1096635 (1.0 MB)
您可以看到 eth0 没有列出。我尝试调出接口:
user@user-NUC7i5BNH:~$ sudo ifup eth0
Internet Systems Consortium DHCP Client 4.2.4
Copyright 2004-2012 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Cannot find device "eth0"
Error getting hardware address for "eth0": No such device
Failed to bring up eth0.
/etc/network/interfaces 的内容
user@user-NUC7i5BNH:~$ cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
最后完成的是 lshw 的输出:
user@user-NUC7i5BNH:~$ sudo lshw -C network
*-network UNCLAIMED
description: Network controller
product: Intel Corporation
vendor: Intel Corporation
physical id: 0
bus info: pci@0000:3a:00.0
version: 78
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress cap_list
configuration: latency=0
resources: memory:dc100000-dc101fff
*-network UNCLAIMED
description: Ethernet controller
product: Intel Corporation
vendor: Intel Corporation
physical id: 1f.6
bus info: pci@0000:00:1f.6
version: 21
width: 32 bits
clock: 33MHz
capabilities: pm msi bus_master cap_list
configuration: latency=0
resources: memory:dc200000-dc21ffff
*-network
description: Wireless interface
physical id: 2
bus info: usb@1:1
logical name: wlan0
serial: e8:de:27:0f:79:8c
capabilities: ethernet physical wireless
configuration: broadcast=yes driver=ath9k_htc driverversion=4.4.0-130-generic firmware=1.4 ip=192.168.100.235 link=yes multicast=yes wireless=IEEE 802.11
我正在运行 Ubuntu 14.04。
user@user-NUC7i5BNH:~$ uname -a
Linux user-NUC7i5BNH 4.4.0-130-generic #156~14.04.1-Ubuntu SMP Thu Jun 14 13:51:47 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
可用的英特尔驱动程序有:
user@user-NUC7i5BNH:~$ ls /lib/modules/`uname -r`/kernel/drivers/net/ethernet/intel
e1000 e1000e e100.ko fm10k i40e i40evf igb igbvf ixgb ixgbe ixgbevf
有什么想法可以解决这个问题吗?
答案1
您是否检查过驱动程序是否已加载?
sudo lsmod | egrep 'igb|ixgb|e1000'
可用的英特尔网络驱动程序模块应位于
/lib/modules/`uname -r`/kernel/drivers/net/ethernet/intel
如果没有加载任何英特尔驱动程序,您可以使用 modprobe 或 insmod 逐个加载它们,并在每次加载后检查网卡是否被识别。
以下文件可以帮助确定问题:
- /var/log/syslog
- /var/log/udev
- /var/log/dmesg
- /var/log/kern.log