我使用的是 Mint 10 和 2.6.35-32-generic
这台电脑有两张有线以太网卡。它们都是一样的。一张内置在主板上,另一张是 PCI-E 卡。我使用的是内置的,但都不再工作了。在我的以太网停止工作之前,我最近对系统所做的唯一更改是安装 Mint KDE 12.04 64bit 作为双启动。奇怪的是,内置以太网卡每次都能正常工作。该内核是 3.2 版。
因此突然之间,Ifconfig 告诉我没有显示 eth0。
dmesg | grep r816 gives me nothing.
我检查了几乎每个我能找到的启动板/询问 ubuntu/ubuntu 论坛链接,我得到的最佳结果来自这里:
我甚至尝试过这个$(uname -r)
选项,几年前 r8169 的黑名单就已经存在了,当时我在这台机器上遇到过类似的问题。Build-essentials 已安装。
附件是我最近尝试运行的终端命令的副本。我没有其他方法可以在这台机器上连接互联网,所以我不得不将其复制并粘贴到一个新的文本文件中,然后通过 USB 将其传输到我的笔记本电脑上。
root@DesktopBlack:~$ cd r8168-8.031.00/
root@DesktopBlack:~/r8168-8.031.00$ make clean modules
make -C src/ clean
make[1]: Entering directory `/home/badcam/r8168-8.031.00/src'
make -C /lib/modules/2.6.35-32-generic/build SUBDIRS=/home/badcam/r8168-8.031.00/src clean
make[2]: Entering directory `/usr/src/linux-headers-2.6.35-32-generic'
CLEAN /home/badcam/r8168-8.031.00/src/.tmp_versions
CLEAN /home/badcam/r8168-8.031.00/src/Module.symvers /home/badcam/r8168-8.031.00/src/modules.order
make[2]: Leaving directory `/usr/src/linux-headers-2.6.35-32-generic'
make[1]: Leaving directory `/home/badcam/r8168-8.031.00/src'
make -C src/ modules
make[1]: Entering directory `/home/badcam/r8168-8.031.00/src'
make -C /lib/modules/2.6.35-32-generic/build SUBDIRS=/home/badcam/r8168-8.031.00/src modules
make[2]: Entering directory `/usr/src/linux-headers-2.6.35-32-generic'
CC [M] /home/badcam/r8168-8.031.00/src/r8168_n.o
CC [M] /home/badcam/r8168-8.031.00/src/r8168_asf.o
CC [M] /home/badcam/r8168-8.031.00/src/rtl_eeprom.o
CC [M] /home/badcam/r8168-8.031.00/src/rtltool.o
LD [M] /home/badcam/r8168-8.031.00/src/r8168.o
Building modules, stage 2.
MODPOST 1 modules
CC /home/badcam/r8168-8.031.00/src/r8168.mod.o
LD [M] /home/badcam/r8168-8.031.00/src/r8168.ko
make[2]: Leaving directory `/usr/src/linux-headers-2.6.35-32-generic'
make[1]: Leaving directory `/home/badcam/r8168-8.031.00/src'
root@DesktopBlack:~/r8168-8.031.00$ make install
make -C src/ install
make[1]: Entering directory `/home/badcam/r8168-8.031.00/src'
make -C /lib/modules/2.6.35-32-generic/build SUBDIRS=/home/badcam/r8168-8.031.00/src INSTALL_MOD_DIR=kernel/drivers/net modules_install
make[2]: Entering directory `/usr/src/linux-headers-2.6.35-32-generic'
INSTALL /home/badcam/r8168-8.031.00/src/r8168.ko
DEPMOD 2.6.35-32-generic
make[2]: Leaving directory `/usr/src/linux-headers-2.6.35-32-generic'
make[1]: Leaving directory `/home/badcam/r8168-8.031.00/src'
root@DesktopBlack:~/r8168-8.031.00$ insmod ./src/r8168.ko
root@DesktopBlack:~/r8168-8.031.00$ mkinitramfs -o /boot/initrd.img-$(uname -r) $(uname -r)
Warning: No support for locale: en_NZ.utf8
root@DesktopBlack:~/r8168-8.031.00$ lspci -v
00:00.0 Host bridge: Advanced Micro Devices [AMD] RS780 Host Bridge Alternate
Subsystem: Advanced Micro Devices [AMD] RS780 Host Bridge Alternate
Flags: bus master, 66MHz, medium devsel, latency 32
Memory at <ignored> (64-bit, non-prefetchable)
Capabilities: [c4] HyperTransport: Slave or Primary Interface
Capabilities: [54] HyperTransport: UnitID Clumping
Capabilities: [40] HyperTransport: Retry Mode
Capabilities: [9c] HyperTransport: #1a
Capabilities: [f8] HyperTransport: #1c
03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 03)
Subsystem: Giga-byte Technology GA-EP45-DS5 Motherboard
Flags: bus master, fast devsel, latency 0, IRQ 45
I/O ports at ce00 [size=256]
Memory at fdfff000 (64-bit, prefetchable) [size=4K]
Memory at fdff8000 (64-bit, prefetchable) [size=16K]
[virtual] Expansion ROM at fdf00000 [disabled] [size=128K]
Capabilities: [40] Power Management version 3
Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
Capabilities: [70] Express Endpoint, MSI 01
Capabilities: [ac] MSI-X: Enable- Count=4 Masked-
Capabilities: [cc] Vital Product Data
Capabilities: [100] Advanced Error Reporting
Capabilities: [140] Virtual Channel
Capabilities: [160] Device Serial Number 03-00-00-00-68-4c-e0-00
Kernel driver in use: r8168
Kernel modules: r8169
root@DesktopBlack:~/r8168-8.031.00$ lsmod | grep r816
r8168 237114 0
root@DesktopBlack:~/r8168-8.031.00$ sudo ethtool eth0
Settings for eth0:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised pause frame use: Symmetric Receive-only
Advertised auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
MDI-X: Unknown
Supports Wake-on: pumbg
Wake-on: g
Current message level: 0x00000033 (51)
Link detected: yes
root@DesktopBlack:~/r8168-8.031.00$ dmesg | grep r816
[ 1527.700515] r8168 Gigabit Ethernet driver 8.031.00-NAPI loaded
[ 1527.700568] r8168 0000:03:00.0: PCI INT A -> GSI 18 (level, low) -> IRQ 18
[ 1527.700597] r8168 0000:03:00.0: setting latency timer to 64
[ 1527.700731] r8168 0000:03:00.0: irq 45 for MSI/MSI-X
[ 1527.769143] r8168: This product is covered by one or more of the following patents: US5,307,459, US5,434,872, US5,732,094, US6,570,884, US6,115,776, and US6,327,625.
[ 1527.769148] r8168 Copyright (C) 2012 Realtek NIC software team <[email protected]>
root@DesktopBlack:~/r8168-8.031.00$ sudo ifconfig eth0 up
root@DesktopBlack:~/r8168-8.031.00$ sudo ifconfig -a
eth0 Link encap:Ethernet HWaddr 1c:6f:65:21:68:98
inet6 addr: fe80::1e6f:65ff:fe21:6898/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:240 (240.0 B) TX bytes:3213 (3.2 KB)
Interrupt:45 Base address:0xe000
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:16436 Metric:1
RX packets:38307 errors:0 dropped:0 overruns:0 frame:0
TX packets:38307 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1111719 (1.1 MB) TX bytes:1111719 (1.1 MB)
tap0 Link encap:Ethernet HWaddr de:ba:fd:35:c8:bf
inet addr:10.0.1.1 Bcast:10.255.255.255 Mask:255.0.0.0
inet6 addr: fe80::dcba:fdff:fe35:c8bf/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:35 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
vboxnet0 Link encap:Ethernet HWaddr 0a:00:27:00:00:00
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
root@DesktopBlack:~/r8168-8.031.00$ nano /etc/network/interfaces
auto lo
iface lo inet loopback
#auto eth0
#iface eth0 inet dhcp
iface eth0 inet static
address 192.168.1.2
netmask 255.255.255.0
pre-up /usr/sbin/ethtools -S eth0 speed 1000 autoneg off
gateway 192.168.1.1
network 192.168.1.0
broadcast 192.168.1.255
#auto eth1
#iface eth1 inet dhcp
#iface eth1 inet static
#address 192.168.1.10
#netmask 255.255.255.0
#gateway 192.168.1.1
#network 192.168.1.0
#broadcast 192.168.1.255
#sudo ifdown eth0
#sudo ifup eth0
#sudo ifdown eth1
#sudo ifup eth1
所以,一切(对我来说)看起来都应该正常工作。但事实并非如此。一旦我重新启动(我也尝试过多次完全关闭电源的方法),我就会失去一切,回到原点。
我被困住了。
这两张卡会相互冲突吗?我可能会尝试移除一张卡,同时等待答案。
为什么 Kubuntu KDE 12.04 可以工作(我认为是内核),而我以前信任的 Mint 10 却不行?有没有一种可行的解决方案是升级内核?或者,这样做真的很糟糕吗?如果需要,我可以逆转它吗?
我发现这个帖子这个命令确实使我的 Eth0 工作起来。
然后我尝试
sudo service network-manager stop
其次是
sudo dhclient3 eth0
但重启后,我又丢失了所有内容。我注意到,即使
sudo dhclient3 eth0
我的 Gnome 面板网络管理器仍然显示没有以太网连接,左键单击显示
网络管理器未运行
所以这让我想到了这个启动板错误报告
其中描述的解决方案可以使网络管理器小程序正常工作。
service network-manager stop
rm /var/lib/NetworkManager/NetworkManager.state
service network-manager start
我还添加到 NetworkManager.state[main]:
NetworkingEnabled=true
这意味着,只要我重新安装驱动程序,以太网就会恢复运行,但重启时驱动程序仍然会丢失。所以现在,我猜我需要的只是让我的以太网驱动程序在重启时不消失。
答案1
这是我为了让驱动程序设置保持不变所做的事情:
sudo -s nano /etc/initramfs-tools/modules --- added r8168 (saved) update-initramfs -v -u -k `uname -r`
...就是这样。我已经重启了好几次,甚至完全关闭了电源。